diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 7665f8e..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -objs/* -!objs/ndk_* -.pc/ -.vscode/ -modules/media-framework/ -modules/nginx-srt-module/ -modules/nginx-vod-module/ -Makefile -*.orig -*.txt \ No newline at end of file diff --git a/auto/make b/auto/make index fad0844..25ee3fb 100644 --- a/auto/make +++ b/auto/make @@ -2,11 +2,6 @@ # Copyright (C) Igor Sysoev # Copyright (C) Nginx, Inc. -basename_last2() { - local basename_1=`basename \`dirname $1\`` - local basename_2=$(basename "$1") - echo $(printf "$basename_1/$basename_2" | sed 's/\.\.\///') -} echo "creating $NGX_MAKEFILE" @@ -179,7 +174,7 @@ ngx_all_srcs=`echo $ngx_all_srcs | sed -e "s/\//$ngx_regex_dirsep/g"` for ngx_src in $NGX_ADDON_SRCS do - ngx_obj="addon/`basename_last2 \`dirname $ngx_src\``" + ngx_obj="addon/`basename \`dirname $ngx_src\``" test -d $NGX_OBJS/$ngx_obj || mkdir -p $NGX_OBJS/$ngx_obj @@ -418,7 +413,7 @@ if test -n "$NGX_ADDON_SRCS"; then for ngx_src in $NGX_ADDON_SRCS do - ngx_obj="addon/`basename_last2 \`dirname $ngx_src\``" + ngx_obj="addon/`basename \`dirname $ngx_src\``" ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \ | sed -e "s/\//$ngx_regex_dirsep/g"` @@ -581,7 +576,7 @@ END ngx_obj=$ngx_src ;; *) - ngx_obj="addon/`basename_last2 \`dirname $ngx_src\``" + ngx_obj="addon/`basename \`dirname $ngx_src\``" mkdir -p $NGX_OBJS/$ngx_obj ngx_obj="$ngx_obj/`basename $ngx_src`" ;; @@ -643,7 +638,7 @@ END ngx_obj=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"` ;; *) - ngx_obj="addon/`basename_last2 \`dirname $ngx_source\``" + ngx_obj="addon/`basename \`dirname $ngx_source\``" ngx_obj=`echo $ngx_obj/\`basename $ngx_source\` \ | sed -e "s/\//$ngx_regex_dirsep/g"` ;; diff --git a/configure.docker.sh b/configure.docker.sh deleted file mode 100755 index 4131c20..0000000 --- a/configure.docker.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -./configure \ - --with-cc-opt="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -D_FORTIFY_SOURCE=2 -I/tmp/build/quickjs/" \ - --with-ld-opt="-Wl,-z,relro -Wl,-z,now -fPIC -L/tmp/build/quickjs/" \ - --sbin-path=/usr/local/sbin/nginx \ - --conf-path=/video_server/nginx/nginx.conf \ - --error-log-path=/var/log/nginx/error.log \ - --pid-path=/var/run/nginx/nginx.pid \ - --lock-path=/var/lock/nginx/nginx.lock \ - --http-log-path=/var/log/nginx/access.log \ - --http-client-body-temp-path=/tmp/nginx-client-body \ - --with-compat \ - --with-debug \ - --with-pcre-jit \ - --with-http_ssl_module \ - --with-http_stub_status_module \ - --with-http_realip_module \ - --with-http_auth_request_module \ - --with-http_v2_module \ - --with-http_dav_module \ - --with-http_slice_module \ - --with-threads \ - --with-http_addition_module \ - --with-http_flv_module \ - --with-http_gunzip_module \ - --with-http_gzip_static_module \ - --with-http_mp4_module \ - --with-http_random_index_module \ - --with-http_secure_link_module \ - --with-http_sub_module \ - --with-mail_ssl_module \ - --with-stream_ssl_module \ - --with-stream_ssl_preread_module \ - --with-stream_realip_module \ - --with-http_geoip_module=dynamic \ - --with-http_image_filter_module=dynamic \ - --with-http_perl_module=dynamic \ - --with-http_xslt_module=dynamic \ - --with-mail=dynamic \ - --with-stream=dynamic \ - --with-stream_geoip_module=dynamic \ - --add-module=./modules_deb/libnginx-mod-http-ndk-0.3.4 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-brotli-1.0.0~rc \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-cache-purge-2.5.3 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-echo-0.63 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-geoip2-3.4 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-headers-more-filter-0.38 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-memc-0.20 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-set-misc-0.33 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-srcache-filter-0.33 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-subs-filter-0.6.4 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-upstream-fair-0.0~git20120408.a18b409 \ - --add-dynamic-module=./modules_deb/libnginx-mod-nchan-1.3.7+dfsg \ - --add-dynamic-module=./modules/njs/nginx \ - --add-dynamic-module=./modules/nginx-vod-module \ - --add-module=./modules/media-framework/nginx-common \ - --add-dynamic-module=./modules/nginx-stream-preread-str-module \ - --add-dynamic-module=./modules/media-framework/nginx-kmp-in-module \ - --add-dynamic-module=./modules/media-framework/nginx-kmp-out-module \ - --add-dynamic-module=./modules/media-framework/nginx-rtmp-module \ - --add-dynamic-module=./modules/media-framework/nginx-rtmp-kmp-module \ - --add-dynamic-module=./modules/media-framework/nginx-mpegts-module \ - --add-dynamic-module=./modules/media-framework/nginx-mpegts-kmp-module \ - --add-dynamic-module=./modules/media-framework/nginx-kmp-cc-module \ - --add-dynamic-module=./modules/media-framework/nginx-kmp-rtmp-module \ - --add-dynamic-module=./modules/media-framework/nginx-live-module \ - --add-dynamic-module=./modules/nginx-srt-module \ - --add-dynamic-module=./modules/media-framework/nginx-pckg-module \ - --add-dynamic-module=./modules/nginx-secure-token-module \ No newline at end of file diff --git a/configure.sh b/configure.sh deleted file mode 100755 index 3d780fe..0000000 --- a/configure.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -./configure \ - --with-cc-opt="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -D_FORTIFY_SOURCE=2 -I/usr/local/include/quickjs/" \ - --with-ld-opt="-Wl,-z,relro -Wl,-z,now -fPIC -L/usr/local/lib/quickjs/" \ - --prefix=/usr/local/temp/nginx/ \ - --error-log-path=stderr \ - --lock-path=/var/lock/nginx.lock \ - --pid-path=/run/nginx.pid \ - --with-compat \ - --with-debug \ - --with-pcre-jit \ - --with-http_ssl_module \ - --with-http_stub_status_module \ - --with-http_realip_module \ - --with-http_auth_request_module \ - --with-http_v2_module \ - --with-http_dav_module \ - --with-http_slice_module \ - --with-threads \ - --with-http_addition_module \ - --with-http_flv_module \ - --with-http_gunzip_module \ - --with-http_gzip_static_module \ - --with-http_mp4_module \ - --with-http_random_index_module \ - --with-http_secure_link_module \ - --with-http_sub_module \ - --with-mail_ssl_module \ - --with-stream_ssl_module \ - --with-stream_ssl_preread_module \ - --with-stream_realip_module \ - --with-http_geoip_module=dynamic \ - --with-http_image_filter_module=dynamic \ - --with-http_perl_module=dynamic \ - --with-http_xslt_module=dynamic \ - --with-mail=dynamic \ - --with-stream=dynamic \ - --with-stream_geoip_module=dynamic \ - --add-module=./modules_deb/libnginx-mod-http-ndk-0.3.4 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-brotli-1.0.0~rc \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-cache-purge-2.5.3 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-echo-0.63 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-geoip2-3.4 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-headers-more-filter-0.38 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-memc-0.20 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-set-misc-0.33 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-srcache-filter-0.33 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-subs-filter-0.6.4 \ - --add-dynamic-module=./modules_deb/libnginx-mod-http-upstream-fair-0.0~git20120408.a18b409 \ - --add-dynamic-module=./modules_deb/libnginx-mod-nchan-1.3.7+dfsg \ - --add-dynamic-module=./modules/njs/nginx \ - --add-dynamic-module=./modules/nginx-vod-module \ - --add-module=./modules/media-framework/nginx-common \ - --add-dynamic-module=./modules/nginx-stream-preread-str-module \ - --add-dynamic-module=./modules/media-framework/nginx-kmp-in-module \ - --add-dynamic-module=./modules/media-framework/nginx-kmp-out-module \ - --add-dynamic-module=./modules/media-framework/nginx-rtmp-module \ - --add-dynamic-module=./modules/media-framework/nginx-rtmp-kmp-module \ - --add-dynamic-module=./modules/media-framework/nginx-mpegts-module \ - --add-dynamic-module=./modules/media-framework/nginx-mpegts-kmp-module \ - --add-dynamic-module=./modules/media-framework/nginx-kmp-cc-module \ - --add-dynamic-module=./modules/media-framework/nginx-kmp-rtmp-module \ - --add-dynamic-module=./modules/media-framework/nginx-live-module \ - --add-dynamic-module=./modules/nginx-srt-module \ - --add-dynamic-module=./modules/media-framework/nginx-pckg-module \ - --add-dynamic-module=./modules/nginx-secure-token-module \ No newline at end of file diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index dc71efa..0000000 --- a/debian/README.source +++ /dev/null @@ -1,63 +0,0 @@ -Debian Packaging -================ - -We use git-buildpackage for packaging. - -Workflow for Unstable -===================== - -We use the standard git-buildpackage workflow. - -Dynamic Modules -=============== - -Since v1.9.11 Nginx added dynamic module support. This will sanitize the -nginx packaging flow in the long term, but there is a lot work to be done -in order to get there. We gradually convert all modules to dynamic -as they add support for it. - -[0] https://www.nginx.com/blog/dynamic-modules-nginx-1-9-11/ - -Workflow for Experimental -========================= - -Nginx mainline releases (1.11.x series) are been packaged for experimental, -as they lack security support. - -The workflow we use is based on the assumption that packaging work happens on -origin/master and experimental builds are a trivial patch away from that. - -The direct consequence of treating experimental as a patchset for origin/master -is that the relevant branches are forced-pushed whenever we release a new -1.11.x version. In other words, **it is not safe to base your work on the -experimental branch**. - -This is a brief description of our experimental branches and how we are using -them. - -* experimental-base - Force-pushed when origin/master changes. - - experimental-base tracks the changes needed for building the 1.11.x branch, - such as new configure parameters, etc. On new 1.11.x releases, it is rebased - on origin/master so it is always up-to-date with our latest packaging work. - -* experimental - Force-pushed on every 1.11.x release. - - This branch points to the latest 1.11.x release. - Before release this branch is reset to experimental-base, and then merged - with the new upstream-1.11 branch. Finally all the release specific changes - are commited (changelog entry etc) and the build is made. - -* upstream-1.11 - Pushed on every 1.11.x release. - - Before a new 1.11.x release origin/upstream is dummy merged (-s ours) into - ustream-1.11. This is a technicallity so we can avoid resolving conflicts - when a new 1.10.x release happens between two experimental releases. - -Older 1.11.x releases are not referenced by any branch, but they can be found -by the relevant debian/* tag. - - diff --git a/debian/apport/source_nginx.py b/debian/apport/source_nginx.py deleted file mode 100644 index aec6e8e..0000000 --- a/debian/apport/source_nginx.py +++ /dev/null @@ -1,19 +0,0 @@ -''' -apport package hook for nginx packages - -Copyright (c) 2015, Thomas Ward -''' - -import apport.hookutils -import os -import subprocess - -def add_info(report, ui): - if (report['Package'].split()[0] != 'nginx-common' - and report['ProblemType'] == 'Package' - and os.path.isdir('/run/systemd/system')): - report['Journalctl_Nginx.txt'] = apport.hookutils.command_output( - ['journalctl', '-xe', '--unit=nginx.service']) - report['SystemctlStatusFull_Nginx.txt'] = subprocess.Popen( - ['systemctl', '-l', 'status', 'nginx.service'], - stdout=subprocess.PIPE).communicate()[0] diff --git a/debian/autoscripts/postinst-nginx b/debian/autoscripts/postinst-nginx deleted file mode 100644 index aa376d5..0000000 --- a/debian/autoscripts/postinst-nginx +++ /dev/null @@ -1,26 +0,0 @@ -for confpair in #NAMES# ; do - from=$(echo $confpair | cut -d: -f1) - to=$(echo $confpair | cut -d: -f2) - - if [ -L /etc/nginx/modules-enabled/$to.removed ]; then - rm /etc/nginx/modules-enabled/$to.removed - removed_link=true - else - removed_link=false - fi - - # Symlink on - # 1) Fresh installations - # 2) Reinstalls after automatic removes (preserve admin actions) - if [ -z "$2" -o "$removed_link" = "true" ]; then - ln -sf /usr/share/nginx/modules-available/$from \ - /etc/nginx/modules-enabled/$to - fi -done - -if [ "$1" = "configure" ] ; then - if which dpkg-trigger >/dev/null 2>&1 ; then - dpkg-trigger --no-await nginx-reload - fi - -fi diff --git a/debian/autoscripts/postrm-nginx b/debian/autoscripts/postrm-nginx deleted file mode 100644 index 8769983..0000000 --- a/debian/autoscripts/postrm-nginx +++ /dev/null @@ -1,28 +0,0 @@ -if [ "$1" = "purge" ] ; then - for confpair in #NAMES# ; do - from=$(echo $confpair | cut -d: -f1) - to=$(echo $confpair | cut -d: -f2) - - if [ -L /etc/nginx/modules-enabled/$to ]; then - rm /etc/nginx/modules-enabled/$to - fi - if [ -L /etc/nginx/modules-enabled/$to.removed ]; then - rm /etc/nginx/modules-enabled/$to.removed - fi - done -fi - -if [ "$1" = "remove" ] ; then - for confpair in #NAMES# ; do - from=$(echo $confpair | cut -d: -f1) - to=$(echo $confpair | cut -d: -f2) - - if [ -L /etc/nginx/modules-enabled/$to ]; then - mv /etc/nginx/modules-enabled/$to /etc/nginx/modules-enabled/$to.removed - fi - done - - if which dpkg-trigger >/dev/null 2>&1 ; then - dpkg-trigger --no-await nginx-reload - fi -fi diff --git a/debian/autoscripts/prerm-nginx b/debian/autoscripts/prerm-nginx deleted file mode 100644 index c36a883..0000000 --- a/debian/autoscripts/prerm-nginx +++ /dev/null @@ -1,10 +0,0 @@ -if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then - for confpair in #NAMES# ; do - from=$(echo $confpair | cut -d: -f1) - to=$(echo $confpair | cut -d: -f2) - - if [ -L /etc/nginx/modules-enabled/$to ]; then - mv /etc/nginx/modules-enabled/$to /etc/nginx/modules-enabled/$to.removed - fi - done -fi diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 8ec0edd..0000000 --- a/debian/changelog +++ /dev/null @@ -1,2897 +0,0 @@ -nginx (1.26.3-3) unstable; urgency=medium - - [ Jan Mojžíš ] - * d/changelog: fix whitespace in 1.26.3-2 record - * d/control: add libnginx-mod-http-lua dependency for nginx-extras package - for riscv64 platform - - [ Thomas Ward ] - * d/nginx-common.nginx.service: Add ConditionFileIsExecutable to - SystemD service file, prevents starting of service if nginx is - not installed (which can happen if nginx-common is installed - independently from `nginx` itself (Closes: #1098477) - - -- Jan Mojžíš Thu, 15 May 2025 15:31:38 +0200 - -nginx (1.26.3-2) unstable; urgency=medium - - * Team upload - * Upload to unstable - - -- Jérémy Lal Fri, 07 Feb 2025 12:53:11 +0100 - -nginx (1.26.3-1) experimental; urgency=medium - - * Team upload - * New upstream version 1.26.3 - - -- Jérémy Lal Wed, 05 Feb 2025 19:08:02 +0100 - -nginx (1.26.2-1) experimental; urgency=medium - - * Team upload - * New upstream version 1.26.2 - * Add Sergey Kandaurov pgp public key - * Drop upstream patches - - [ Jan Mojžíš ] - * d/gbp.conf: add upstream-signatures = on - * d/{control,copyright}: update my email to "janmojzis@debian.org" - * d/copyright: bump my copyright year - - -- Jérémy Lal Sun, 02 Feb 2025 21:08:45 +0100 - -nginx (1.26.0-3) unstable; urgency=medium - - * d/control: Resolve dependency loop between nginx and nginx-common. - (Fixes: #1082373) - - -- Thomas Ward Fri, 20 Sep 2024 21:35:42 -0400 - -nginx (1.26.0-2) unstable; urgency=medium - - [ Jan Mojžíš ] - * d/rules: enable QUIC and HTTP/3 module (Closes: 1070488) - * d/control: bump Standards-Version: 4.7.0, no changes - * d/p/nginx-1.26.1.patch add, backport changes from the nginx 1.26.1 and fix - CVE-2024-32760, CVE-2024-31079, CVE-2024-35200, CVE-2024-34161 - * d/p/CVE-2024-7347.patch add, backport CVE-2024-7347 fix (Closes: 1078971) - * d/libnginx-mod.abisubstvars updated comment when ABI needs to be changed - - [ Thomas Ward ] - * d/conf/nginx.conf: Update default options for current security - practices and standards. SSL protos, disable prefer server - ciphers, hide server tokens/versions in responses. - - -- Jan Mojžíš Mon, 19 Aug 2024 18:46:30 +0200 - -nginx (1.26.0-1) unstable; urgency=medium - - * New upstream version 1.26.0 - * nginx ABI release: nginx-abi-1.26.0-1 (Closes: 1069997) - * d/libnginx-mod.abisubstvars: remove third-party modules version constraints - * d/u/signing-key.asc add Roman Arutyunyan’s PGP public key, - the key is used to sign the 1.26.0 release - * d/p/CVE-2023-44487.patch remove, fixed in upstream - * d/ufw/nginx update, add QUICK, thanks Marcus Bointon - * d/conf/mime.types add application/xslt+xml, thanks K. Widholm - * d/copyright: updated copyright related to new upstream version - * d/copyright: bump my copyright year - * d/conf/nginx.conf: add worker_cpu_affinity auto (Closes: 1063659) - * d/gbp.conf: add sign-tags = True, [pull] track-missing = True, - [import-orig] merge-mode = replace - - -- Jan Mojžíš Sun, 05 May 2024 18:48:05 +0200 - -nginx (1.24.0-2) unstable; urgency=medium - - * d/control added dependency nginx-common to nginx (Closes: 1039905) - After nginx installation, the nginx-common package is installed - automatically due to its dependencies. The nginx-common package includes - the systemd unit, which becomes enabled and activated upon installation. - When the nginx is removed, nginx-common package and the systemd unit will - remain in the system. Adding a dependency nginx-common to nginx solves - this problem. - * d/control fixed binNMU safe dependency declaration nginx to nginx-common, - nginx is 'any', nginx-common is 'all' -> dependency '= ${source:Version}' - * d/rules removed override_dh_strip, migration to automatic debug symbols is - already done, fixes debug-symbol-migration-possibly-complete lint. warning - * d/po/ro.po added Romanian debconf translation. (Closes: 1033084), - Thanks to Remus-Gabriel Chelu - * d/po/sv.po added Swedish debconf translation. (Closes: 1050443), - Thanks to Peter Kvillegård - * d/conf/mime.types added video/ogg, video/x-matroska (Closes: 1028144) - * d/p/CVE-2023-44487.patch adds additional mitigations for CVE-2023-44487 - that according to NGINX developers on nginx-devel are already suitably - mitigated with the default config options for keepalive. (Closes: 1053770) - * d/control added nginx-dev dependency on ${nginx:abi} - * d/debhelper/nginx_mod.pm automatic libnginx-mod-stream dependencies - - -- Jan Mojžíš Wed, 11 Oct 2023 01:17:51 +0200 - -nginx (1.24.0-1) unstable; urgency=medium - - * New upstream version 1.24.0 - * nginx ABI release: nginx-abi-1.24.0-1 - * d/libnginx-mod.abisubstvars update version constraints of the 3rd party - modules - * d/p/bug-{1024605,973861}.patch removed, fixed in upstream - * d/copyright: updated copyright for files src/event/ngx_event_udp.h, - src/os/win32/ngx_dlopen - - -- Jan Mojžíš Tue, 27 Jun 2023 23:19:31 +0200 - -nginx (1.22.1-9) unstable; urgency=medium - - * d/control: nginx-common Breaks+Replaces: nginx (<< 1.22.1-8) - (Closes: 1032929) - - -- Jan Mojžíš Tue, 14 Mar 2023 16:19:32 +0100 - -nginx (1.22.1-8) unstable; urgency=medium - - * Main change: - Configuration files returned to nginx-common package. This fixes - the serious problem of losing configuration files during upgrade. - This is a rollback of a change made in 1.22.1-6 (Closes: 1032517) - * d/control: fix nginx-full dependencies - * d/libnginx-mod.abisubstvars: update libnginx-mod-http-lua version - - -- Jan Mojžíš Tue, 14 Mar 2023 06:53:32 +0100 - -nginx (1.22.1-7) unstable; urgency=medium - - * nginx ABI release: nginx-abi-1.22.1-7 - * nginx ABI: Nginx now provides nginx-abi- to better manage - dependencies between nginx and 3rd party modules. Credit to Jérémy Lal. - * switched to libpcre2 (Closes: 1000013) - * d/p/bug-973861: added, lingering close for connections with pipelined - requests. The patch is backported from the upstream. (Closes: 973861) - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: updated to be compatible with 'cme update dpkg-copyright' - - -- Jan Mojžíš Mon, 13 Feb 2023 13:04:16 +0100 - -nginx (1.22.1-6) unstable; urgency=medium - - * Main change: - Nginx binary moved to package nginx, also moved basic - configuration files from nginx-common to package nginx. - The packages nginx-{light,core,extras,common} are replaced - by a metapackage. (Closes: 1025763) - Users should simply install 'nginx' and 'libnginx-mod-...' - instead of these packages. - * Additional changes: - * d/nginx-{light,core,extras,full,common}.NEWS: added warning that - nginx-{light,core,extras,full,common} are deprecated - * d/control: fixed dependencies for safe binNMU - * d/copyright: updated debian/* copyright - * d/copyright: added missing copyright for d/apport/* - * d/copyright: added missing GPL-2+ copyright for d/debhelper/dh_nginx - * d/copyright: added missing copyright for d/help/examples/nginx_modsite - * d/po/it.po: added Italian debconf translation. (Closes: 1019160) - * d/control: removed dependency on obsolete package lsb-base - * d/control: bump Standards-Version: 4.6.2, no changes - - -- Jan Mojžíš Wed, 08 Feb 2023 17:20:27 +0100 - -nginx (1.22.1-5) unstable; urgency=medium - - [ Jan Mojžíš ] - * Since version 1.22.1-5 all third party modules are removed from Debian NGINX - package and all these modules are maintained in separate external packages. - Removed namely these remaining modules: - - libnginx-mod-http-geoip2 - - libnginx-mod-stream-geoip2 - - libnginx-mod-http-auth-pam - - libnginx-mod-http-echo - - libnginx-mod-http-upstream-fair - - libnginx-mod-http-headers-more-filter - - libnginx-mod-http-cache-purge - - libnginx-mod-http-fancyindex - - libnginx-mod-http-uploadprogress - - libnginx-mod-http-subs-filter - - libnginx-mod-http-dav-ext - * d/tests: all *-simple and *-deps tests updated to check if nginx works - after installation/reload/restart for all flavours - * d/control: updated nginx-common dependency, fixes lintian warning - maybe-not-arch-all-binnmuable - - [ Jérémy Lal ] - * d/rules: default error-log-path is stderr (--error-log-path=stderr) - instead of hardcoded /var/log/nginx/error.log (Closes: 1025858) - * dh nginx: auto-detect build-dependency on ndk-dev - * dh nginx: absolute /usr/sbin/nginx path for nginx tests - * d/p/nginx-ssl_cert_cb_yield.patch SSL_CTX_set_cert_cb() callback yielding - patch update - * d/conf/nginx.conf: Set global error_log to /var/log/error.log - Now that error_log default value is stderr, it is possible - to override that config using nginx -g 'error_log stderr;' - - [ Miao Wang ] - * d/control: removed unnecessary dependencies after removing 3rd party modules - * d/rules: enabled stream_realip_module (--with-stream_realip_module) - * d/rules: explicitly disabled pcre2 (--without-pcre2) - - -- Jan Mojžíš Tue, 20 Dec 2022 10:36:19 +0100 - -nginx (1.22.1-4) unstable; urgency=medium - - * d/t/*-module-deps: updated, added curl timeout 300 seconds and - added nginx restart before calling curl - * d/t/*-module-deps: update: - - added tests for new ext. module libnginx-mod-http-set-misc - - added tests for new ext. module libnginx-mod-http-brotli-filter - - added tests for new ext. module libnginx-mod-http-brotli-static - - added tests for new ext. module libnginx-mod-http-memc - - added tests for new ext. module libnginx-mod-http-srcache-filter - * removed 3th party modules and moved to separate packages: - - libnginx-mod-nchan module - - libnginx-mod-rtmp module - - libnginx-mod-http-ndk module - - -- Jan Mojžíš Thu, 08 Dec 2022 14:15:15 +0100 - -nginx (1.22.1-3) unstable; urgency=medium - - * d/control: added Multi-Arch: foreign for package nginx-dev - * d/rules: enabled NDK upstream list module NDK_UPSTREAM_LIST - * d/p/bug-1024605.patch: added header Forwarded: not-needed - - -- Jan Mojžíš Mon, 05 Dec 2022 18:25:16 +0100 - -nginx (1.22.1-2) unstable; urgency=medium - - [ Jan Mojžíš ] - * d/control: fixed spelling-error-in-description - * d/nginx-*.postinst: fixed postinst script, used invoke-rc.d instead of - pidof and ad-hoc tests, tnx Gioele Barabucci - * d/tests/ssi-module-test added, simple ngx_http_ssi_filter_module test - * d/p/bug-1024605.patch added: fixes problem when a subrequest has SSI - enabled but its main request does not, the SSI module may crash the worker - due to NULL-pointer dereference. The patch is backported from the upstream - (Closes: 1024605) - * d/control: updated implicit dependencies of third-party modules - for easier transition to third-party modules in separate packages. - - [ Jérémy Lal ] - * d/debhelper: set nginx_mod buildsystem by default - * d/control: nginx-dev provides dh-sequence-nginx (Closes: #1024879) - * d/control: remove Uploaders that are part of nginx-team, - keep only the most recent active one, per policy 5.6.3. - - [ Debian Janitor ] - * Remove constraints unnecessary since buster (oldstable): - + nginx-dev: Drop versioned constraint on dpkg-dev in Depends. - - -- Jan Mojžíš Wed, 30 Nov 2022 17:39:42 +0100 - -nginx (1.22.1-1) unstable; urgency=medium - - [ Jan Mojžíš ] - * New upstream version 1.22.1 - * d/control: added implicit version of dependency libnginx-mod-http-lua - (>=1:0.10.22-3~), it is a rebuilt version with nginx 1.22.1. - * Added libnginx-mod-http-lua powerpc architecture - - [ Debian Janitor ] - * Fix day-of-week for changelog entry 0.5.11-1. - - -- Jan Mojžíš Thu, 10 Nov 2022 18:21:43 +0100 - -nginx (1.22.0-3.1) unstable; urgency=medium - - * Non-maintainer upload. - * No source change upload to rebuild with debhelper 13.10. - - -- Michael Biebl Sat, 15 Oct 2022 12:28:07 +0200 - -nginx (1.22.0-3) unstable; urgency=medium - - * d/changelog: fixed typo in bug number 61261 -> 861261 (Closes: 861261) - * d/p/nginx-ssl_cert_cb_yield.patch added (Closes: 884434) - * http-lua: removed the http-lua module and moved it to a separate package - - -- Jan Mojžíš Wed, 17 Aug 2022 18:38:15 +0200 - -nginx (1.22.0-2) unstable; urgency=medium - - [ Miao Wang ] - * adding a new libnginx-mod-http-ndk-dev package including necessary - headers to build a 3rd party module depending on ndk. - - [ Jan Mojžíš ] - * d/nginx-common.nginx.service: added Systemd dependency - Wants=network-online.target and updated Systemd "After" dependency to - recommended NGINX values, namely: - - network-online.target (Closes: 861261) (Closes: 1000406) - - remote-fs.target (Closes: 898896) - - nss-lookup.target - * d/p/0003-define_gnu_source-on-other-glibc-based-platforms.patch: forwarded - to upstream (Closes: 859082) - * d/t/reboot: added, tests if nginx works after reboot - * d/m/p/http-subs-filter/pcre2.patch: added PCRE2 support - * d/p/nginx-fix-pidfile.patch: Fix NGINX PIDfile handling to avoid - SystemD race condition, this fix is backported from Ubuntu (Closes: 876365) - * d/apport/source_nginx.py: Add apport hooks for additional bug - information gathering, the script is backported from Ubuntu (Closes: 963668) - * d/nginx-common.install: Add install rule for apport hooks. - - [ Debian Janitor ] - * Remove constraints unnecessary since buster: - + Build-Depends: Drop versioned constraint on dpkg-dev. - + nginx-common: Drop versioned constraint on lsb-base in Depends. - + nginx-core: Drop versioned constraint on nginx in Breaks. - + nginx-full: Drop versioned constraint on nginx in Breaks. - + nginx-light: Drop versioned constraint on nginx in Breaks. - + nginx-extras: Drop versioned constraint on nginx in Breaks. - + libnginx-mod-http-perl: Drop versioned constraint on nginx-extras in - Replaces. - + Remove 5 maintscript entries from 1 files. - - -- Jan Mojžíš Sun, 07 Aug 2022 16:14:59 +0200 - -nginx (1.22.0-1) unstable; urgency=medium - - [ Thomas Ward ] - * New upstream release (1.22.0) - * Additional changes: - * d/conf/mime.types: Fix a typo in font/woff2 extension in - mime.types. (Closes: #1010798) - * d/upstream/signing-key.asc: Additional signing keys observed - in upstream (Konstantin Pavlov ) during - upstream merge/import by Thomas Ward, additional signing key - was added to the keyring while keeping Maxim's key in signing - keys as well. - * d/copyright: Updated copyright for src/core/ngx_murmurhash.c - and debian/modules/http-ndk/src/hash/murmurhash2.c to be - public-domain (Closes: #1011936) - * d/control: Use libluajit-5.1-dev for s390x. - Due to src:luajit2 landing in Unstable, superseding src:luajit, - and due to luajit2 having s390x support, we can use s390x now - with luajit instead of standard Lua. - Thanks to Paul Gevers for the heads up on luajit2 supporting s390x. - * d/control: Use liblua for ppc64el - src:luajit2 is still not ppc64el - stable and there seems to be nobody willing to support it. (Closes: 1013807) - - [ Jan Mojžíš ] - * d/patches/CVE-2021-3618.patch removed, fix is included in new upstream - release - * d/copyright: bump nginx copyright years - * d/copyright: added copyright for src/stream/ngx_stream_set_module.c - * d/copyright: removed copyright for src/http/v2/ngx_http_v2_huff_encode.c - * d/control: bump Standards-Version to 4.6.1, no changes - - [ Bastian Germann ] - * d/copyright: Update copyright for d/debhelper/* - - [ Miao Wang ] - * dh_nginx: support auto generating module config files - * adding a new nginx-dev package including necessary headers and debhelper - scripts to build and package a 3rd party module. (Closes: 985133) - * d/p/0002-Make-sure-signature-stays-the-same-in-all-nginx-buil.patch - removed, because feature already implemented with --with-compat configure - option since 1.11.5 - - -- Thomas Ward Tue, 10 May 2022 12:08:02 -0400 - -nginx (1.20.2-2) unstable; urgency=medium - - [ Thomas Ward ] - * d/patches/CVE-2021-3618.patch: Include upstream changeset from NGINX - that adds mitigations into the Mail module for CVE-2021-3618.patch. - (Closes: #991328) - - [ Jan Mojžíš ] - * d/p/0003-define_gnu_source-on-other-glibc-based-platforms.patch update, - fixes build on hurd-i386 platform - - -- Thomas Ward Wed, 04 May 2022 16:04:59 -0400 - -nginx (1.20.2-1) unstable; urgency=medium - - [ Ondřej Nový ] - * d/control: Update Uploaders for new maintainers. - - [ Thomas Ward ] - * Update to latest upstream Stable version (1.20.2) (Closes: #1008855) - * d/patches/Resolver-fixed-off-by-one-write-in-ngx_resolver - _copy.patch: Drop CVE-2021-23017 patch, as this is fixed in 1.20.1 - and we are now using 1.20.2 which already contains the patch. - * Refreshed d/patches/0002-Make-sure-signature-stays-the-same- - in-all-nginx-buil.patch (fuzz thanks to 1.20.2) - * d/conf/mime.types: Update mime.types to more match upstream mime.types - and include upstream changes with mime.types from 1.21.x via nginx.org - mercurial repository versions. - * d/control: Remove self from Uploaders per other Debian devs, who want - that commit to be done by someone on the current uploaders/maintainers - group instead. - - -- Thomas Ward Tue, 19 Apr 2022 09:50:42 -0400 - -nginx (1.18.0-9) unstable; urgency=medium - - [ Jan Mojžíš ] - * http-lua: Downgrade to 0.10.13 (Closes: #1008787). - * http-lua: Backport upstream bugfix for segfault in nginx core >= 1.15.0 - when libnginx-mod-http-lua is loaded and init_worker_by_lua* is used. - * d/control: Add mips64el,ppc64,kfreebsd-amd64 to list of luajit platforms. - * d/control: fix Homepage nginx.net -> nginx.org (Closes: #976158) - - [ Thomas Ward ] - * d/watch: Update watch syntax to match all even versions of NGINX releases - rather than use a watch syntax that is static to one specific version. - This will fix the untracked "New upstream stable versions" problem. - * d/control: Update 'uploaders' as Thomas Ward is now a maintainer in - the Salsa repository. - - -- Jan Mojžíš Tue, 05 Apr 2022 19:11:47 +0200 - -nginx (1.18.0-8) unstable; urgency=medium - - * Restore patch: - d/p/Resolver-fixed-off-by-one-write-in-ngx_resolver_copy.patch - - -- Ondřej Nový Tue, 15 Mar 2022 13:23:06 +0100 - -nginx (1.18.0-7) unstable; urgency=medium - - [ Ondřej Nový ] - * d/p/CVE-2019-20372.patch: Drop, applied upstream. - * http-auth-pam: Upgrade to 1.5.3. - * http-echo: Upgrade to 0.62. - * nchan: Upgrade to 1.2.15. - * http-fancyindex: Upgrade to 0.5.2. - * rtmp: Upgrade to 1.2.2. - * http-lua: Upgrade to 0.10.15 (Closes: #994178). - * http-lua: Rebase patch. - * nchan: Drop GCC 10 patch, applied upstream. - * d/watch: Bump version to 4. - * Bump standards version to 4.6.1 (no changes). - * d/copyright: Bump my copyright year. - - [ Ondřej Surý ] - * Add arm64 and ppc64el to list of luajit platforms. - - [ Athos Ribeiro ] - * d/nginx-common.nginx.service: Fix service shutdown description to mention - SIGQUIT instead of SIGSTOP (LP: #1919965). - - -- Ondřej Nový Tue, 15 Mar 2022 11:50:18 +0100 - -nginx (1.18.0-6.1) unstable; urgency=high - - * Non-maintainer upload. - * Resolver: fixed off-by-one write in ngx_resolver_copy() (CVE-2021-23017) - (Closes: #989095) - - -- Salvatore Bonaccorso Sat, 29 May 2021 16:21:37 +0200 - -nginx (1.18.0-6) unstable; urgency=medium - - * Fix GCC-10 compatibility (Closes: #957605). - - -- Ondřej Nový Wed, 19 Aug 2020 15:27:02 +0200 - -nginx (1.18.0-5) unstable; urgency=medium - - * Prevented request smuggling in LUA - CVE-2020-11724 - Closes: #964950 - - -- Ondřej Nový Tue, 14 Jul 2020 10:08:15 +0200 - -nginx (1.18.0-4) unstable; urgency=medium - - * Revert: libnginx-mod-* now depends on nginx- (Closes: #963860). - * Update ngx_http_auth_pam_module upstream URL. - * libnginx-mod-* recommends nginx now. - * http-auth-pam: Upgrade to 1.5.2 (Closes: #963567). - * d/copyright: Bump year of http-auth-pam. - - -- Ondřej Nový Fri, 03 Jul 2020 09:34:49 +0200 - -nginx (1.18.0-3) unstable; urgency=medium - - * Source-only upload to allow migration. - - -- Ondřej Nový Thu, 11 Jun 2020 15:14:59 +0200 - -nginx (1.18.0-2) unstable; urgency=medium - - [ Ondřej Nový ] - * d/copyright: - - Update for upstream release - - Add Thomas Ward from Ubuntu for debian/* - * d/conf/sites-available/default: Update PHP path for PHP 7.4 - * d/conf/nginx.conf: - - Enable TLSv1.3 - - Remove tcp_nodelay on, which is same as default - - Remove keepalive_timeout 65 and use default value 75s. - - Remove trailing whitespaces - * Introduce nginx-core and make it new default for "nginx" - * Add stream-geoip and stream-geoip2 modules - * d/ngx-conf: Convert to Python 3 - * d/control: Add GeoIP2 into description - * Build dynamic modules only in extras flavour - * libnginx-mod-* now depends on nginx- - * Check if port 80 is free before starting during install - - [ Ondřej Surý ] - * http-geoip2: Add ngx_http_geoip2_module 3.3 - - -- Ondřej Nový Fri, 05 Jun 2020 18:28:40 +0200 - -nginx (1.18.0-1) unstable; urgency=medium - - [ Ondřej Nový ] - * New upstream version 1.18.0 - * Add REMOTE_USER fastcgi param - * Use debhelper-compat instead of debian/compat - * Replace dh_systemd_enable with dh_installsystemd - * Set Rules-Requires-Root: no - * d/rules/dh_installinit: Replace --no-restart-on-upgrade with - --no-stop-on-upgrade - * Bump debhelper compat level to 13 - * Use package.maintscript instead of dpkg-maintscript-helper - * Bump standards version to 4.5.0 - * d/watch: Change to 1.18.x - * d/patches/CVE-2019-20372.patch: Rebase - * Convert d/ngxmod to Python 3 (Closes: #953025) - * nchan: Upgrade to 1.2.7 - * http-fancyindex: Upgrade to 0.4.4 - * d/copyright: Add myself for Debian part - * Add myself as uploader - - [ Mohamed Akram ] - * Enable --with-compat configure option (Closes: #897926) - - -- Ondřej Nový Fri, 29 May 2020 19:03:30 +0200 - -nginx (1.16.1-3) unstable; urgency=high - - * Handle CVE-2019-20372, error page request smuggling - (Closes: #948579) - - -- Christos Trochalakis Sat, 11 Jan 2020 09:36:00 +0200 - -nginx (1.16.1-2) unstable; urgency=medium - - * http-lua: Downgrade to 0.10.13 (Closes: #941917) - Temporary fix FTBFS on architectures where Luajit is not available. - - -- Christos Trochalakis Sat, 12 Oct 2019 17:59:23 +0300 - -nginx (1.16.1-1) unstable; urgency=medium - - * New upstream version (Closes: #929200) - * Follow stable 1.16 releases (Closes: #929199) - * Drop already included debian patches - * http-ndk: Upgrade to 0.3.1 - * http-lua: Upgrade to 0.10.15 - - -- Christos Trochalakis Mon, 09 Sep 2019 18:24:43 +0300 - -nginx (1.14.2-3) unstable; urgency=high - - * Backport upstream fixes for 3 CVEs (Closes: #935037) - Those fixes affect Nginx HTTP/2 implementation, which might cause - excessive memory consumption and CPU usage. - (CVE-2019-9511, CVE-2019-9513, CVE-2019-9516). - - -- Christos Trochalakis Mon, 19 Aug 2019 11:30:08 +0300 - -nginx (1.14.2-2) unstable; urgency=medium - - [ Kartik Mistry ] - * po/tr.po: - + Added Turkish translation. Thanks Atila KOÇ - (Closes: #915728) - - [ Christos Trochalakis ] - * http-dav-ext: Upgrade to 3.0.0 (Closes: #851651) - * Use a minimal export of the upstream signing key - * Bump Standards-Version, no changes needed - - -- Christos Trochalakis Thu, 27 Dec 2018 12:49:34 +0200 - -nginx (1.14.2-1) unstable; urgency=medium - - [ Olaf van der Spek ] - * Reference PHP 7.3 (Closes: 913250) - - [ Christos Trochalakis ] - * Adjust fastcgi_split_path_info snippet to handle the `/example.php/` case - (Closes: #911398) - - -- Christos Trochalakis Thu, 13 Dec 2018 10:05:37 +0200 - -nginx (1.14.1-1) unstable; urgency=medium - - [ Kartik Mistry ] - * Removed unused lintian override. - * Fixed trailing whitespaces in changelog. - - [ Christos Trochalakis ] - * New upstream version. (Closes: #913090) - + CVE-2018-16843 Excessive memory usage in HTTP/2 - + CVE-2018-16844 Excessive CPU usage in HTTP/2 - + CVE-2018-16845 Memory disclosure in the ngx_http_mp4_module - - -- Christos Trochalakis Wed, 07 Nov 2018 07:16:00 +0200 - -nginx (1.14.0-1) unstable; urgency=medium - - [ Kartik Mistry ] - * debian/control: - + Removed duplicate Build-Depends. - + Use https in Homepage. - - [ Christos Trochalakis ] - * http-lua: Upgrade to 0.10.13 - * http-lua: Drop our OpenSSL patch, OpenSSL 1.1 is now supported upstream - * http-fancyindex: Upgrade to 0.4.3 - * Order nginx after nss-lookup.target to synchronize host/network name lookups - (Closes: #900790) - * Merge ru translations. - Thanks to Lev Lamberov (Closes: #883104) - - -- Christos Trochalakis Fri, 31 Aug 2018 15:28:04 +0300 - -nginx (1.13.12-1) unstable; urgency=medium - - * New upstream version - - -- Christos Trochalakis Wed, 11 Apr 2018 08:19:23 +0300 - -nginx (1.13.11-1) unstable; urgency=medium - - * New upstream version - - -- Christos Trochalakis Tue, 10 Apr 2018 14:55:11 +0300 - -nginx (1.13.10-1) unstable; urgency=medium - - * New upstream version - - -- Christos Trochalakis Wed, 21 Mar 2018 16:16:22 +0200 - -nginx (1.13.9-1) unstable; urgency=medium - - [ Michael Lustfield ] - * Remove non-uploading users - - [ Christos Trochalakis ] - * New upstream version 1.13.9 - * Move packaging repository to salsa.debian.org - * Bump Standards-Version to 4.1.3, no changes needed - - -- Christos Trochalakis Wed, 21 Feb 2018 11:24:53 +0200 - -nginx (1.13.8-1) unstable; urgency=medium - - * New upstream release. - - -- Christos Trochalakis Wed, 27 Dec 2017 09:24:36 +0200 - -nginx (1.13.7-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream version 1.13.7 - * Bump Standards-Version, no changes needed - * debian/watch: switch to HTTPS for the upstream check - - [ Mpampis Kostas ] - * Automate modules watch & upgrade process (Closes: #869499) - - [ Christos Trochalakis ] - * Bits & pieces for ngxmod - * http-headers-more-filter: Upgrade to 0.33 - * http-echo: Upgrade to 0.61 - * http-lua: Upgrade to 0.10.11 - * http-dav-ext: Upgrade to 0.1.0 (Closes: #878611) - * http-fancyindex: Upgrade to 0.4.2 - * rtmp: Upgrade to 1.2.1 (Closes: #880718) - - -- Christos Trochalakis Thu, 14 Dec 2017 11:04:36 +0200 - -nginx (1.13.6-2) unstable; urgency=medium - - * rtmp: Ship docs & examples (Closes: #878368) - - -- Christos Trochalakis Fri, 13 Oct 2017 12:59:28 +0300 - -nginx (1.13.6-1) unstable; urgency=medium - - * New upstream version - * Normalize module paths in packaging repository - * Bump Standards-Version, no changes needed - * Drop dh-systemd dependency since we depend on debhelper >= 10 - - -- Christos Trochalakis Thu, 12 Oct 2017 10:37:29 +0300 - -nginx (1.13.5-1) unstable; urgency=medium - - * New upstream version 1.13.5 - * doc: Improve example WordPress configuration - Thanks to Larry Holish (Closes: #863343) - * Remove upstart conffile (Closes: #874319) - - -- Christos Trochalakis Wed, 06 Sep 2017 10:10:24 +0300 - -nginx (1.13.4-1) unstable; urgency=medium - - * New upstream version 1.13.4 - * nginx-lua: - + Add a simple lua autopkgtest - + Discover LuaJIT 2.1 (FTBFS) (Closes: #873319) - + Update to v0.10.10 - + Update OpenSSL 1.1 patch - + Drop patch to build against Nginx 1.11.11, now included upstream - * tests: Fix race between reload and curl's http request - * Explicitly disable autoreconf (debhelper 10) - * Drop Upstart configuration - * Bump Standards to 4.1.0 - + Switch all packages to Priority optional, extra is considered deprecated - - -- Christos Trochalakis Tue, 29 Aug 2017 10:49:03 +0300 - -nginx (1.13.3-1) unstable; urgency=high - - * New upstream version 1.13.3. - Fixes CVE-2017-7529 (Closes: #868109) - * Drop gzip_disable "msie6" directive. (Closes: #867024) - - -- Christos Trochalakis Wed, 12 Jul 2017 11:20:27 +0300 - -nginx (1.13.2-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream version 1.13.2. - * Fix nginx-cache-purge segfaults (Closes: #866750) - * Merge ca translations. - Thanks to Alytidae (Closes: #865996) - * Merge es translations. - Thanks to Jonathan Bustillos (Closes: #855610) - * Merge pt translations. - Thanks to Rui Branco (Closes: #858741) - * Bump Standards to 4.0.0. - - Switch the copyright-format URL to https. - - [ Nicolas Dandrimont ] - * Introduce libnginx-mod-rtmp (Closes: #843777) - - -- Christos Trochalakis Mon, 03 Jul 2017 13:44:59 +0300 - -nginx (1.13.1-2) unstable; urgency=medium - - * Upload to unstable. - - -- Christos Trochalakis Tue, 20 Jun 2017 14:16:52 +0300 - -nginx (1.13.1-1) experimental; urgency=medium - - * New upstream version 1.13.1. - - -- Christos Trochalakis Wed, 31 May 2017 11:41:59 +0300 - -nginx (1.13.0-1) experimental; urgency=medium - - * New upstream release. - We now target nginx mainline (1.13.x). - - -- Christos Trochalakis Wed, 10 May 2017 11:40:38 +0300 - -nginx (1.12.0-1) experimental; urgency=medium - - [ Michael Lustfield ] - * debian/rules: - - Configure build flags to work with other arches and downstreams. - Thanks to Thomas Ward. - - [ Christos Trochalakis ] - * New upstream release. - * Patch nginx-upstream-fair to build against nginx 1.11.6. - * Patch nginx-lua to build against nginx 1.11.11. - * Patch nginx-echo to build against nginx 1.11.11. - * Drop curve list patch, it's included upstream. - * Drop perl build flags patch, it is now handled upstream. - * Enable SSL Preread builtin module on nginx-full & nginx-extras. - (Closes: #854214) - * Switch to debhelper 10, no changes needed. - - -- Christos Trochalakis Fri, 05 May 2017 11:16:30 +0300 - -nginx (1.10.3-1) unstable; urgency=medium - - * New upstream release. (Closes: #855113) - * Update Vcs fields to the new location. - The repo is now moved under the pkg-nginx namespace. - - -- Christos Trochalakis Wed, 15 Feb 2017 09:58:13 +0200 - -nginx (1.10.2-4) unstable; urgency=medium - - * Switch module reloading logic to dpkg triggers. - * Enable modules after a remove -> install cycle. - * Move module patches to debian/modules/patches. - * Backport curve list support from 1.11.x. (Closes: #846085) - * Add a NEWS entry regarding dynamic modules. - * Merge de,fr,nl,pt_BR,da translations. - Thanks to Chris Leick. (Closes: #843770) - Thanks to Julien Patriarca. (Closes: #844712) - Thanks to Frans Spiesschaert. (Closes: #845693) - Thanks to Adriano Rafael Gomes. (Closes: #846522) - Thanks to Joe Dalton. (Closes: #850857) - - -- Christos Trochalakis Sun, 22 Jan 2017 12:19:30 +0200 - -nginx (1.10.2-3) unstable; urgency=medium - - [ Michael Lustfield ] - * debian/conf/sites-enabled/default: - + Correcting location of default php-fpm socket. (Closes: #846145) - - [ Christos Trochalakis ] - * debian/rules: Correctly clean patched modules. - Thanks to Sven-Haegar Koch for the initial patch. (Closes: #844506) - * mod: Upgrade nchan to 1.0.8. (Closes: #844473) - * mod: Upgrade nginx-lua to 0.10.7. - * Update nginx-lua OpenSSL 1.1.0 patch. - * Reactivate PIE. - Thanks to Markus Waldeck for the suggestion. - * mod: Check if nginx binary exists before reloading. - * mod: Upgrade headers-mode to 0.32. - * mod: Upgrade development kit to 0.3.0. - - -- Christos Trochalakis Sat, 24 Dec 2016 12:11:21 +0200 - -nginx (1.10.2-2) unstable; urgency=medium - - * Build against OpenSSL 1.1.0. (Closes: #828453) - + Patch for nginx-lua by Alessandro Ghedini. - + Patch for nginx-upstream-fair by Kurt Roeckx. - * debian/modules: - + Rethink module patching logic. - + Convert dav-ext to a dynamic module package: - o libnginx-mod-http-dav-ext - - -- Christos Trochalakis Sat, 12 Nov 2016 09:18:12 +0200 - -nginx (1.10.2-1) unstable; urgency=high - - [ Christos Trochalakis ] - * New upstream release. - * debian/nginx-common.postinst: - + CVE-2016-1247: Secure log file handling (owner & permissions) - against privilege escalation attacks. /var/log/nginx is now owned - by root:adm. Thanks ro Dawid Golunski for the report. - Changing /var/log/nginx permissions effectively reopens #701112, - since log files can be world-readable. This is a trade-off until - a better log opening solution is implemented upstream (trac:376). - (Closes: #842295) - * debian/control: - + Version depend on lsb-base (>= 3.0-6). - Fixes lintian init.d-script-needs-depends-on-lsb-base. - * debian/nginx-*.lintian-overrides: - + Drop unused spelling-error-in-binary override. - - [ Michael Lustfield ] - * debian/conf/sites-available/default: - + Updated PHP sample configuration block. (Closes: #841230) - - -- Christos Trochalakis Sat, 29 Oct 2016 08:45:09 +0300 - -nginx (1.10.1-3) unstable; urgency=medium - - * debian/control: - + Drop nginx-*-dbg packages in favor of autogenerated -dbgsym packages. - + Remove relic Breaks/Replaces from nginx-common. - + Fix lsb-base dependencies. - + Switch Maintainer to the Nginx Packaging Team and keep active maintainers - as uploaders. Jose, Fabio, Dmitry & Cyril, thanks a lot for all your - contributions! - - -- Christos Trochalakis Thu, 15 Sep 2016 15:20:58 +0300 - -nginx (1.10.1-2) unstable; urgency=medium - - [ Christos Trochalakis ] - * debian/control: - + Don't allow building against liblua5.1-0-dev on architectures - that libluajit is available. - + Enable slice module on all flavors. (Closes: #815080) - + Enable SCGI & uWSGI module for nginx-light. - + Convert to dynamic module packages: - o libnginx-mod-nchan - o libnginx-mod-http-echo - o libnginx-mod-http-upstream-fair - o libnginx-mod-http-headers-more-filter - o libnginx-mod-http-cache-purge - o libnginx-mod-http-fancyindex - o libnginx-mod-http-uploadprogress - o libnginx-mod-http-subs-filter - * debian/modules: - + Replace http-push with nchan v1.0.2 (Closes: #836134) - + Upgrade nginx-lua to v0.10.6 - + Upgrade nginx-echo to v0.60 - + Upgrade headers-more to v0.31 - + Upgrade fancyindex to v0.4.1 - + Upgrade upload-progress to v0.9.2 - - [ Michael Lustfield ] - * debian/patches/0003-*.patch: - + Use _GNU_SOURCE on GNU/kFreeBSD. (Closes: #826061) - Thanks Steven Chamberlain for the patch. - * debian/nginx-*.postinst: - + Make nginx-*.postinst use invoke-rc.d. (Closes: #823435) - Thanks Simon Deziel for the patch. - - -- Christos Trochalakis Tue, 06 Sep 2016 11:06:26 +0300 - -nginx (1.10.1-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release (1.10.1) - Fixes CVE-2016-4450 - NULL pointer dereference while writing client request body. - (Closes: #825960) - - * debian/control: - + Generate dbgsym packages only if dh_strip supports it. - Thanks Faidon Liambotis for the hint. - - -- Christos Trochalakis Tue, 31 May 2016 22:01:25 +0300 - -nginx (1.10.0-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release (1.10.0) - - -- Christos Trochalakis Fri, 29 Apr 2016 10:31:46 +0300 - -nginx (1.9.14-2) unstable; urgency=medium - - [ Christos Trochalakis ] - * debian/control: - + Fix upgrading nginx-extras from testing. (Closes: #822553) - + Bump Standards to 3.9.8, no changes needed. - * debian/libnginx-mod-http-perl.lintian-overrides: - + Override wrong-section-according-to-package-name warning. - - -- Christos Trochalakis Wed, 27 Apr 2016 16:43:02 +0300 - -nginx (1.9.14-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release (1.9.14) (Closes: #812806) - * debian: - + Setup dynamic module flow, and implement a simple dh_nginx helper for - internal use. - + Split modules in libnginx-mod-* packages. - Not all modules are ready for dynamic building. - * debian/control: - + Enable http/2, thread pool & WebDAV on nginx-light. - In order for dynamic modules to be loadable in all nginx flavors we need - to ensure they share the same build signature. (Closes: #816095) - + nginx-common & nginx-doc are now 'Multi-Arch: foreign'. (Closes: #812484) - Thanks Elrond for the report and the initial patch. - + Use secure VCS uri (lintian). - + Bump Standards to 3.9.7. - * debian/rules: - + Disable PIE for now so we can build dynamic modules. - * debian/tests/control: - + Test if modules are loadable in nginx-light. - * debian/nginx-common.nginx.service: - + Documentation points to nginx man page. - * debian/modules/nginx-lua: - + Update nginx-lua to v0.12 and convert it to a dyn module. - Fixes buiding failures with nginx 1.9.11. - * debian/modules/nginx-auth-pam: - + Update http-auth-pam module to 1.5 and convert it to a dyn module. - (Closes: #819062) - - -- Christos Trochalakis Tue, 19 Apr 2016 11:05:35 +0300 - -nginx (1.9.10-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release (1.9.10) (Closes: #812806) - * debian/control: - + Drop python dependency from nginx-common. (Closes: #808699) - - -- Christos Trochalakis Tue, 26 Jan 2016 20:12:06 +0200 - -nginx (1.9.9-1) unstable; urgency=medium - - [ Michael Lustfield ] - * debian/nginx-common.nginx.logrotate: - + Switching logrotate to 14 days. (Closes: #805322) - - [ Christos Trochalakis ] - * New upstream release (1.9.9). - * debian/modules/nginx-lua: - + Update nginx-lua to v0.10.0. - - -- Christos Trochalakis Thu, 14 Jan 2016 10:40:35 +0200 - -nginx (1.9.6-2) unstable; urgency=medium - - [ Christos Trochalakis] - * debian/modules/nginx-lua: - + Update nginx-lua to v0.9.19 fixing HTTP/2 compatibility. - - -- Christos Trochalakis Fri, 13 Nov 2015 16:08:01 +0200 - -nginx (1.9.6-1) unstable; urgency=medium - - [ Christos Trochalakis] - * New upstream release. - * Enable http2 module in nginx-full & nginx-extras - - -- Christos Trochalakis Tue, 03 Nov 2015 08:59:21 +0200 - -nginx (1.9.4-1) unstable; urgency=medium - - [ Christos Trochalakis] - * New upstream release. - * debian/copyright: - + Fix licence order. - - -- Christos Trochalakis Mon, 24 Aug 2015 16:23:20 +0300 - -nginx (1.9.3-1) unstable; urgency=medium - - [ Christos Trochalakis] - * New upstream Release. (Closes: #789924) - * debian/control: - + Remove XS-Testsuite header, it is now automatically added when - `debian/tests/control` is present. - * debian/modules/nginx-lua: - + Update nginx-lua to v0.9.16 and drop our backported patches. - * debian/conf/*: - + Add REQUEST_SCHEME to fcgi, wsgi and scgi configs (sync with upstream). - - -- Christos Trochalakis Tue, 14 Jul 2015 20:24:52 +0300 - -nginx (1.9.2-1) unstable; urgency=medium - - [ Michael Lustfield ] - * debian/nginx-common.nginx.init: - + Init script now returns the proper exit status. (Closes: #788573) - + Cleaned up the init script to have consistent naming/structure. - - [ Christos Trochalakis ] - * New upstream Release. - * debian/rules: - + Add stream module to nginx-full & nginx-extras. - + Add thread pool support to nginx-full & nginx-extras. - * debian/modules/nginx-lua: - + Backport upstream's 9531e5e7 fixing build failure when thread pool - support is enabled. - - -- Christos Trochalakis Mon, 22 Jun 2015 10:16:19 +0300 - -nginx (1.9.1-1) unstable; urgency=medium - - [ Michael Lustfield ] - * debian/conf/nginx.conf: - + Switch worker_processes to auto. (Closes: #781711) - * debian/conf/sites-available/default: - + Add comment about disabling gzip in HTTPS. (Closes: #773332) - + Add comment about checking ssl_ciphers. (Closes: #765782) - * debian/modules/*: - + Updated nginx-auth-pam 1.3 -> 1.4. (Closes: #777120) - + Updated nginx-echo v0.56 -> v0.57. - + Updated nginx-lua v0.9.13 -> v0.9.15. - + Updated nginx-cache-purge 2.1 -> 2.3. - + Updated ngx-fancyindex v0.3.4 -> v0.3.5. - * debian/nginx-common.NEWS: - + Document potential issues with newer versions on i386. - * debian/nginx-common.{dirs,install}, debian/vim/*: - + Installing vim syntax highlighting from package. (Closes: #771609) - Thanks Emmanuel Bouthenot for building this patch. - * debian/nginx-common.nginx.upstart: - + Created file to support upstart jobs. (Closes: #745483) - Thanks Cameron Norman for building this file. - * debian/rules: - + Add hardening flags with dpkg-buildflags. (Closes: #747025, #781703) - Thanks Thomas Ward. - + Supply custom DEB_BUILD_MAINT_OPTIONS for debian_ldflags generation. - Thanks Thomas Ward. - + Added back missing module gunzip. (Closes: #782065) - Thanks Peter Wu for the initial patch. - * debian/modules/nginx-lua/*: - + Updated module version. (Closes: #762494) - * debian/ngx-conf/* - + Added configuration utility, not shipped yet. (Closes: #652108) - * debian/nginx-common.manpages: - + Replaced man page with upstream maintained version. (Closes: #781345) - * debian/nginx-common.install: - + Changed debian/index.html -> html/index.html. This installs the package - maintained version of this file as opposed to our out of date version. - - [ Christos Trochalakis ] - * New upstream release. Switching to mainline version. (Closes: #777677) - * debian/nginx-common.manpages: - + Build & ship manpages with binary packages. - * debian/rules: - + Adjust configure flags for limit_zone module (renamed to limit_conn). - * debian/modules/nginx-lua: - + Backport upstream's f4e1311 fixing build failure with mainline nginx. - * debian/control: - + Depend on libgd-dev now that jessie is released. - - -- Christos Trochalakis Fri, 12 Jun 2015 15:42:49 +0300 - -nginx (1.6.2-5) unstable; urgency=medium - - [ Christos Trochalakis ] - * debian/conf/nginx.conf: - + Drop SSLv3 protocol (POODLE), and prefer server ciphers - by default. (Closes: #767456) - * debian/copyright: - + Add copyright for ngx_http_substitutions_filter_module. - * debian/nginx-common.{preinst,postinst,postrm}: - + Remove /etc/nginx/naxsi-ui.conf conffile. (Closes: #768233) - * debian/README.Debian: - + Add a list of important changes since wheezy. - - -- Christos Trochalakis Sun, 30 Nov 2014 10:39:55 +0200 - -nginx (1.6.2-4) unstable; urgency=medium - - [ Christos Trochalakis ] - * debian/modules/nginx-development-kit: - + Upgrade v0.2.17-7-g24202b4 -> v0.2.19 - * debian/modules/nginx-echo: - + Upgrade v0.51 -> v0.56 - * debian/modules/nginx-upload-progress: - + Upgrade v0.9.0-0-ga788dea -> 0.9.1 - * debian/modules/ngx-fancy-index: - + Upgrade v0.3.3 -> v0.3.4 - * debian/copyright: - + Rewrite copyright file fixing various issues. - * debian/nginx-common.nginx.logrotate: - + Switch postrotate to the initscript's rotate command. - - -- Christos Trochalakis Sun, 19 Oct 2014 08:23:33 +0300 - -nginx (1.6.2-3) unstable; urgency=medium - - [ Christos Trochalakis ] - * Change the default document root to /var/www/html according to debian - policy 3.9.6.0. (Closes: #730382) - * Provide a new, debian specific, default landing page. - * debian/nginx-common.nginx.service: - + Graceful stopping of nginx was not handled correctly with systemd. - * debian/nginx-common.nginx.init: - + Gracefully stop nginx by default, we are switcing to a configurable - STOP/5/TERM/5/KILL/5 schedule. We are now in sync with the systemd - service file. (Closes: #762708) - * debian/conf: - + Introduce a `snippets/fastcgi-php.conf` snippet with a basic - php configuration that can be included when needed. (Closes: #762491) - + Introduce a `snippets/snakeoil.conf` snippet that enabled https - using the certs installed by the ssl-cert package. - + Suggest disabling SSLv3 in default site with a ref to POODLE. - * debian/control: - + nginx-common now suggests ssl-cert. - - -- Christos Trochalakis Thu, 16 Oct 2014 13:34:29 +0300 - -nginx (1.6.2-2) unstable; urgency=medium - - [ Christos Trochalakis ] - * Drop nginx-naxsi, nginx-naxsi-dbg, nginx-naxsi-ui packages. - (Closes: #746199, #737146, #712445) - * debian/conf/nginx.conf: - + Remove relic passenger stanga. - - -- Christos Trochalakis Fri, 26 Sep 2014 11:06:47 +0300 - -nginx (1.6.2-1) unstable; urgency=high - - [ Christos Trochalakis ] - * New upstream release. - CVE-2014-3616: "it was possible to reuse SSL sessions in unrelated - contexts if a shared SSL session cache or the same TLS session ticket - key was used for multiple "server" blocks". - (Closes: #761940) - - -- Christos Trochalakis Wed, 17 Sep 2014 11:19:01 +0300 - -nginx (1.6.1-2) unstable; urgency=medium - - [ Christos Trochalakis ] - * debian/control: - + Build nginx-extras against luajit (Closes: #755875) - * debian/modules/nginx-lua: - + Update nginx-lua to v0.9.12 - * debian/nginx-common.nginx.init: - + Better pidfile extraction from nginx.conf (Closes: #747329) - * debian/conf/mime.types: - + Upgrade to the latest upstream mime types. - As a consequence, nginx now uses "application/javascript" for - javascript files. - * debian/conf/nginx.conf: - + Add application/javascript to the gzip_types list. (Closes: #737176) - * debian/rules: - + Make naxsi module first in configure parameters. - Fixes erratic naxsi behaviour. (Closes: #758642) - * debian/conf/{koi-utf,koi-win,scgi_params,uwsgi_params}: - + Sync with upstream config files. - * debian/conf/fastcgi_params: - + Sync with upstream and remove `SCRIPT_FILENAME` parameter. - This change might break fastcgi sites. (Closes: #718639) - + debian/conf/fastcgi.conf: - + Ship upstream file. - * debian/nginx-common.NEWS: - + Document syncing conf files with upstream. - * debian/tests/control: - + Include some simple autopkgtests. - Thanks to Robie Basak for the initial patch. (Closes: #756391) - * debian/modules/nginx-http-push: - + Update to v0.73. - Fixes fd leak on reload. (Closes: #745921) - - -- Christos Trochalakis Thu, 04 Sep 2014 13:00:46 +0300 - -nginx (1.6.1-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release. - Handle CVE-2014-3556 SMTP STARTTLS vulnerability (Closes: #757196) - http://mailman.nginx.org/pipermail/nginx-announce/2014/000144.html - - -- Christos Trochalakis Wed, 06 Aug 2014 10:05:08 +0300 - -nginx (1.6.0-2) unstable; urgency=medium - - [ gregor herrmann ] - * Patch from Gregor Herrmann : - Fix "hardcodes /usr/lib/perl5": - - drop debian/nginx-extras.dirs, not needed, dh_install uses the - directories from debian/nginx-extras.install - - make debian/nginx-extras.install executable, and use $Config{vendorarch} - for the perl library path there - (Closes: #752796) - - -- Kartik Mistry Tue, 29 Jul 2014 04:56:03 +0000 - -nginx (1.6.0-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release. - * debian/rules: - + Enable auth request http module. (Closes: #725732) - * debian/patches/series: - + Remove backported openssl guard patch. - - -- Christos Trochalakis Thu, 24 Apr 2014 19:23:22 +0300 - -nginx (1.4.7-2) unstable; urgency=medium - - [ Christos Trochalakis ] - * debian/rules: - + Convert to dh $@ - As a side effect, fixes make dependency issues (Closes: #744050) - - -- Christos Trochalakis Thu, 17 Apr 2014 14:30:27 +0300 - -nginx (1.4.7-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release. (Closes: #742059) - + Fixes pottential arbitrary code execution (CVE-2014-0133) - Debian build was not vulnerable since it was compiled - with the --with-debug configure option. - * debian/modules/nginx-http-push: - + Update to v0.711 (Closes: #732251) - * debian/modules/headers-more-nginx-module: - + Update to v0.25, containing several bugfixes. - * debian/modules/nginx-echo: - + Update to v0.51, containing several bugfixes. - * debian/modules/nginx-dav-ext-module: - + Update to v0.0.3, containing some uri encoding fixes. - * debian/modules/ngx_http_substitutions_filter_module: - + Update to v0.6.4, containing some enhancements. - * debian/modules/nginx-auth-pam: - + Update to v1.3. - This version contains our downstream patch (See: #721702) - - -- Christos Trochalakis Tue, 18 Mar 2014 22:03:47 +0200 - -nginx (1.4.6-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release. - * debian/rules: - + Avoid double declaration of hardening flags. - + Expand buildflags so the build log is easier to follow. - + Switch to --with--cc-opt, --with-ld-opt configure flags. - Nginx is now compiled with --Werror, making all warnings - into errors. - + Split common configure options. - + Enable realip module for nginx-light. - + Enable debug module for nginx-light and nginx-extras. - * debian/patches/perl-use-dpkg-buildflags.patch: - + Rewrite patch to just just override LDDLFLAGS and not - CCFLAGS since this is handled by --with-cc-opt. - * debian/watch, debian/upstream/signing-key.asc: - + Fix upstream signature verification. - - -- Christos Trochalakis Tue, 04 Mar 2014 18:06:55 +0200 - -nginx (1.4.5-1) unstable; urgency=medium - - [ Christos Trochalakis ] - * New upstream release. - * debian/modules/nginx-lua: - + Update nginx-lua to v0.9.4 - * debian/nginx-naxsi-ui.preinst: - + Fix exit status issue (Closes: #735152) - * debian/control: - + Fix arch:all to arch:any dependencies - + Make nginx depend on specific flavor version - * debian/nginx-*.postinst: - + Make nginx start by default (Closes: #735551) - * debian/nginx-*.prerm: - + No need to check for invoke-rc.d, - correctly set the exit code on error - * debian/nginx-common.nginx.init: - + Rewrite some parts of the initscript - + Introduce rotate command - + Introduce upgrade command - - -- Christos Trochalakis Thu, 13 Feb 2014 11:41:49 +0200 - -nginx (1.4.4-4) unstable; urgency=medium - - [ Christos Trochalakis ] - * debian/nginx-common.postinst: - + Fix log re-opening issue due to wrong /var/log/nginx - permissions. (Closes: #734139) - - -- Christos Trochalakis Sat, 04 Jan 2014 09:41:40 +0200 - -nginx (1.4.4-3) unstable; urgency=medium - - [ Christos Trochalakis ] - * debian/nginx-naxsi-ui.postinst: - + Fix early exit issue (Closes: #715435) - - -- Christos Trochalakis Tue, 31 Dec 2013 11:47:07 +0200 - -nginx (1.4.4-2) unstable; urgency=low - - [ Michael Lustfield ] - * debian/control: - + Added Provides: httpd-cgi to packages. (Closes: #701508) - + Added other options to nginx depends. (Closes: #729860) - + Added Spdy to nginx-full package description. - * debian/nginx-common.nginx.init: - + Added missing line from patch. (Closes: #728103) - * debian/conf/sites-available/default: - + Changed ssl_protocols and ssl_ciphers. (Closes: 730142) - * debian/nginx-common.preinst: - + Modify permissions of /var/log/nginx. (Closes: #701112) - * debian/rules: - + Added spdy support to nginx-full. (Closes: #730432) - - [ Christos Trochalakis ] - * debian/nginx-doc,docs, debian/nginx-common.NEWS: - + Ship NEWS with nginx-common instead of nginx-doc. - * debian/conf/proxy_params: - + Host header should be passed unmodified to the proxied server. - + Pass X-Forwarded-Proto header to the proxied server. - * debian/control: - + Fix nginx-naxsi-ui Depends and Conflicts lines. - - [ Neutron Soutmun ] - * debian/patches/guard-use-of-deprecated-openssl-definition.patch: - + Fix FTBFS against the recent libssl-dev. (Closes: #733107) - - [ Kartik Mistry ] - * debian/control: - + Updated to Standards-Version 3.9.5 - * debian/watch, debian/upstream-signing-key.pgp: - + Use upstream PGP signature to verify by watch file. - - -- Kartik Mistry Fri, 27 Dec 2013 21:16:01 +0530 - -nginx (1.4.4-1) unstable; urgency=low - - [ Christos Trochalakis ] - * New upstream release. (Closes: #730012) - * debian/nginx-*.postinst: - + Wait for the new master to write its pid file before sending QUIT to the - old master. This solves an issue with systemd and the upgrade mechanism. - Systemd receives the SIGCHLD from the old master but it can't see the new - pid because the new master has not written it yet. As a result, it kills - everything inside the cgroup, including the new master. - * debian/modules/ngx-fancyindex: - + Upgrade Fancy Index module to v0.3.3 (Closes: #728721) - * debian/control: - + Remove Upload module from nginx-extras description (Closes: #729003) - - [ Michael Lustfield ] - * debian/control: - + Added spdy to package description (Closes: #728038) - * debian/nginx-common.nginx.init: - + Showing better start/stop messages. Thanks Pim van den Berg. - (Closes: #728103) - - -- Michael Lustfield Thu, 21 Nov 2013 19:25:50 +0530 - -nginx (1.4.3-2) unstable; urgency=low - - [ Kartik Mistry ] - * Renamed debian/nginx-common.service to debian/nginx-common.nginx.service so - it is installed properly for systemd. Thanks to Christos Trochalakis. - * Set debian/compat to 9 and updated debhelper dependency. - - [ Christos Trochalakis ] - * debian/rules, debian/nginx-common.dirs, - debian/debian-common.nginx.logrotate: - + Switch to dh_installlogrotate. - * debian/rules: - + *-stamp files are deleted by dh_clean. - + Remove unused mime-types target. - + Remove not needed config.sub and config.guess targets. - * debian/nginx-common.dirs: - + Don't ship an empty /run dir. - * debian/nginx-{light,full,extras}.lintian-overrides: - + Override false lintian spelling error warning. - - -- Kartik Mistry Wed, 16 Oct 2013 14:58:11 +0530 - -nginx (1.4.3-1) unstable; urgency=low - - [ Cyril Lavier ] - * debian/nginx-naxsi-ui.postinst, debian/nginx-naxsi-ui.preinst: - + Added missing arguments to have clean postinst/preinst scripts. - * debian/conf/fastcgi_params: - + Defined fastcgi param HTTPS the same as upstream default. - (Closes: #712989) - - [ Michael Lustfield ] - * conf/sites-available/default: - + Removed /doc/ section per bug #715804. - - [ Christos Trochalakis ] - * New upstream release. (Closes: #722640) - * debian/nginx-common.nginx.init: - + Better pidfile extraction from nginx.conf. We now accept multiple - spaces and tabs as a field separator. - * debian/modules/nginx-auth-pam: - + Fixed upstream bug. (Closes: #721702) - * debian/watch: - + Only check for stable releases. - * debian/conf/sites-available/default: - + Correctly fallback to 404 when the requested file is missing. - (Closes: #724232) - * debian/logrotate: - + Gracefully handle empty pidfile in logrotate script. - (Closes: #696797) - - [ Kartik Mistry ] - * Switch to dh-systemd (Closes: #713853) - - -- Kartik Mistry Thu, 10 Oct 2013 17:28:56 +0530 - -nginx (1.4.1-3) unstable; urgency=low - - [ Kartik Mistry ] - * debian/control: - + Changed libgd2-dev build-dep to libgd2-dev|libgd2-noxpm-dev allow - backporting (Closes: #711505) - - [ Cyril Lavier ] - * debian/nginx-naxsi-ui.preinst - + Added argument "install" to the preinst script. (Closes: #711590) - - -- Kartik Mistry Sun, 09 Jun 2013 13:07:52 +0530 - -nginx (1.4.1-2) unstable; urgency=medium - - [ Kartik Mistry] - * Urgency set to medium due to Security and RC bugs. - * debian/conf/sites-available/default: - + Fixed typo in listen ipv6only=on (Closes: #707684) - - [ Cyril Lavier ] - * debian/control: - + Replaced the build-dep libgd2-noxpm-dev to libgd2-dev as part of - the libgd2-{xpm,noxpm}-dev -> libgd2-dev transition. - * debian/nginx-naxsi-ui.preinst, debian/nginx-naxsi-ui.postinst, - debian/conf/naxsi-ui.conf.1.4.1: - + Added preinst script and renamed the new config file to avoid - prompting the user. (Closes: #707291) - * debian/rules: - + Made "debian/rules binary" enough to build binary package. - (Closes: #708522) - - -- Kartik Mistry Thu, 06 Jun 2013 12:55:23 +0530 - -nginx (1.4.1-1) unstable; urgency=low - - * New upstream release: - + Fixes arbitrary code execution (CVE-2013-2028). - * Uploaded to unstable. - * debian/control: - + Updated Standards-Version to 3.9.4 - - -- Kartik Mistry Tue, 07 May 2013 19:53:46 +0530 - -nginx (1.4.0-2) experimental; urgency=low - - [ Ondřej Surý ] - * debian/modules/: - + Updated nginx-echo, nginx-cache-purge and naxsi modules. - + Removed useless .gitignore, .gitmodules files. - - [ Kartik Mistry ] - * debian/modules/nginx-upload: - + This module no longer works with 1.3.x and above. Removed as of now. - * debian/modules/ngx-fancyindex: - + Added Fancy Indexes module (Closes: #704210) - * debian/copyright: - + Fixed path for modules in Files: field. - + Updated copyright for debian/* - * debian/rules: - + Enabled spdy module (Closes: #706195). - * debian/control: - + Suggests: fcgiwrap (Closes: #701508). - - [ Cyril Lavier ] - * debian/conf/naxsi-ui.conf: - + Added configuration file for nginx-naxsi-ui using SQLite - (Closes: #699678). - * debian/nginx-naxsi-ui.config, debian/nginx-naxsi-ui.postinst, - debian/nginx-naxsi-ui.postrm, debian/nginx-naxsi-ui.prerm, - debian/nginx-naxsi-ui.templates: - + Removed these files as they are not necessary anymore with the - database engine switching from MySQL to SQLite. - * debian/control: - + Removed dependencies against MySQL. - * debian/rules, debian/modules/ngx_http_substitutions_filter_module, - debian/README.Modules-versions: - + Added http_substitutions_filter module. (Closes: #706456) - - -- Kartik Mistry Wed, 01 May 2013 10:48:43 +0530 - -nginx (1.4.0-1) experimental; urgency=low - - [ Kartik Mistry ] - * New upstream release (Closes: #706127). - * debian/rules, debian/modules/: - + Removed chunkin-nginx-module as it no longer supported for nginx 1.3.9+ - + Updated nginx-lua module to 0.8.0 - + Patched nginx-upload module as described in modules/README file. - * Refreshed debian/patches/perl-use-dpkg-buildflags.patch - * debian/logrotate: - + Set default log to keep for 52 weeks instead of 52 days. Thanks to - RjY for patch (Closes: #696440) - * debian/rules: - + Added cache purge module to nginx-extras. - * debian/control: - + Suggests: nginx-docs. Thanks to colliar for - reporting bug (Closes: #702923) - * debian/copyright: - + Updated copyright year. - + Fixed broken license text. - - [ Michael Lustfield ] - * debian/conf/sites-available/default: - + Added ipv6_only=on to default server block. (Closes: #700857) - + Added default_server to ipv4 default server block. Now matches ipv6. - * debian/rules: - + Removed obsolete --with-md5 and --with-sha1 - - -- Kartik Mistry Thu, 25 Apr 2013 12:51:45 +0530 - -nginx (1.2.6-1) unstable; urgency=low - - [ Kartik Mistry ] - * New upstream release. - * debian/nginx-common.nginx.init: - + Used log_*_msg instead of echo for better init messages. - + Added patch to check start-stop-daemon exit status, Thanks to - Sergey B Kirpichev (Closes: #695374). - * debian/po/ja.po: - + Added new Japanese translation. Thanks to victory - (Closes: #692481). - * debian/po/pt_BR.po: - + Added new Brazilian Portuguese translation. Thanks to - Adriano Rafael Gomes (Closes: #692481). - - [ Cyril Lavier ] - * debian/rules - + Added RealIP module in nginx-naxsi (Closes: #693302). - * debian/modules/nginx-cache-purge/ - + Updated nginx-cache-purge module with the 2.0 version. - * debian/modules/nginx-lua/ - + Updated nginx-lua module with the 0.7.8 version. - * debian/modules/nginx-echo/ - + Updated the nginx-echo module with the 0.41 version. - * debian/modules/headers-more-nginx-module/ - + Updated the Headers-more module with the 0.19 version. - * debian/modules/README.Modules-versions - + Updated the current version of modules following the updates. - - [ Michael Lustfield ] - * debian/conf/sites-available/default - + Uncommented listen lines to make server block default. - - -- Kartik Mistry Tue, 18 Dec 2012 10:29:18 +0530 - -nginx (1.2.4-2) unstable; urgency=low - - * debian/conf/nginx.conf: - + Fixed pid path to /run/nginx.pid in config. - * debian/po/*.po, debian/nginx-naxsi-ui.templates, debian/po/templates.pot: - + Fixed ^M characters in template file. Thanks to Christian Perrier - for help (Closes: #692191, #692335) - - -- Kartik Mistry Mon, 05 Nov 2012 13:05:34 +0530 - -nginx (1.2.4-1) unstable; urgency=low - - [ Michael Lustfield ] - * debian/nginx-common.nginx.init - + Added --retry to start-stop-daemon. (Closes: #682360) - + Added $named to Required-Start/Stop. (Closes: #679879) - + Added some other modifications after testing. (LP: #1033856) - * debian/rules: - + Added -DFORTIFY_SOURCE=2 -fstack-protector to build flags. - (Closes: #680712) - * debian/nginx-common.install: - + Moved default docs to /usr/share/nginx/html. (Closes: #1031515) - * debian/rules: - + Set prefix to /usr/share/nginx. - * debian/po/fr.po - + Updated French translation file. (Closes: #679601) - * debian/logrotate: - + Removed semicolon after an fi statement. (Closes: #683870) - * debian/copyright: - + Removed trailing slash from File: fields. - * Changed /var/run to /run in multiple files. (LP: #1050516) - * debian/nginx-common.dirs: - + Added /run to .dirs to avoid conflicts with backports. (LP: #1072641) - * debian/nginx-*.postinst: - + Added sites-enabled/available directory checks. (Closes: #688410) - - Thanks Andreas Marschke - + Moved the symlink creation to nginx-common. - * Updated debconf templates. - * conf/sites-available/default: - + Updated root to point at /usr/share/nginx/html instead of www. - - [ Kartik Mistry ] - * Acknowledged NMUs (Closes: #681758, #681381) - * New upstream release (Closes: #683704) - * debian/po/*.po: - + Removed ^M characters from headers. - + Fixed all files with recent unneeded template change. - - -- Kartik Mistry Tue, 30 Oct 2012 10:10:34 +0530 - -nginx (1.2.1-2.2) unstable; urgency=low - - * Non-maintainer upload. - * Fix "removes files that were installed by another package": - don't remove directories that are owned by (and removed from) nginx-common - from nginx-extras.postrm. This seems to have been the idea in commit e30a854 - ("Moved configuration purging to nginx-common.") except that it was added - in nginx-common.postrm without being removed in nginx-extras.postrm. - Remove nginx-extras.postrm since it's empty after this change. - (Closes: #681758) - - -- gregor herrmann Sat, 04 Aug 2012 18:13:10 +0200 - -nginx (1.2.1-2.1) unstable; urgency=low - - * Non-maintainer upload to deal with the goal of 100% translated - debconf templates for 7 languages in wheezy. - * Drop nasty ^M characters from the templates file. They break - debconf-updatepo and therefore translations. Closes: #681381 - * As a consequence, fix translations as some of them had been - "updated" in the meantime wrt broken templates - - -- Christian Perrier Thu, 12 Jul 2012 21:23:57 +0200 - -nginx (1.2.1-2) unstable; urgency=medium - - [Cyril Lavier] - * Urgency set to medium, security bug in naxsi module, fix via upstream. - * debian/modules/naxsi: - + Updated naxsi module to version 0.46-1 fixing the following security - issue : potential file disclosure in nx_extract. - - -- Cyril Lavier Wed, 27 Jun 2012 13:52:03 +0200 - -nginx (1.2.1-1) unstable; urgency=medium - - [Kartik Mistry] - * Urgency set to medium, RC bug fix. - * New upstream release (Closes: #677396) - * debian/nginx.1: - + Updated with description taken from debian/control. - * debian/po/cs.po: - + Added Czech translation of PO debconf template. - (Closes: #673120, #678659) - * debian/po/da.po: - + Added Danish translation of PO debconf template. - (Closes: #674461, #677806) - * debian/po/it.po: - + Added Italian translation of PO debconf template. (Closes: #679185) - * debian/po/nl.po: - + Added Dutch translation of PO debconf template. (Closes: #675314) - * debian/po/pl.po: - + Added Polish translation of PO debconf template. (Closes: #678156) - * debian/po/pt.po: - + Added Portuguese translation of PO debconf template. - (Closes: #674609, #679149) - * debian/po/sk.po: - + Added Slovak translation of PO debconf template. (Closes: #677282) - * debian/po/sv.po: - + Added Swedish translation of PO debconf template. - (Closes: #675107, #677032) - * debian/copyright: - + Removed duplicate Copyright fields. - * debian/modules/nginx-lua: - + Updated to latest upstream git tag 0.5.0rc29-6446ee71b8, Fix for worker - process crashes (Closes: #674928) - * debian/nginx-naxsi-ui.templates, debian/po/templates.pot: - + Updated debconf template after review from l10n-english team. - (Closes: #675237) - + Do not add empty line. - * debian/po/*.po: - + Refreshed after template update. - - [Cyril Lavier] - * debian/rules: - + Added status module to nginx-naxsi. (Closes: #672998) - * debian/control: - + Updated nginx-naxsi module list. - + Updated nginx-full module list. (Closes: #677128) - * debian/po/de.po: - + Added German translation of PO debconf template. - (Closes: #673861, #677790) - * debian/po/ru.po: - + Added Russian translation of PO debconf template. (Closes: #674188) - * debian/po/es.po: - + Added Spanish translation of PO debconf template. (Closes: #678915) - * debian/po/gl.po: - + Added Galician translation of PO debconf template. (Closes: #678910) - * debian/nginx-naxsi-ui.postrm, debian/nginx-naxsi-ui.prerm: - + Added postrm and prerm scripts for nginx-naxsi-ui. (Closes: #673787) - - [Michael Lustfield] - * debian/nginx-common.preinst: - + Copied install stuff to upgrade in case statement. (LP: #1014506) - * debian/rules - + Added --with-pcre-jit to build. (LP: #915344) - * debian/conf/sites-available/default: - + Changed default try_files example. (LP: #969207) - * debian/nginx-*.postrm: - + Changed a few things so files are only purged on purge. (Closes: #678060) - - Thanks Jeroen Dekkers - - -- Kartik Mistry Wed, 27 Jun 2012 09:24:50 +0530 - -nginx (1.2.0-1) unstable; urgency=low - - [Cyril Lavier] - * New upstream release. (Closes: #670306) - + 1.2.x is stable release now. - * debian/modules/chunkin-nginx-module: - + Updated chunkin-nginx-module to v0.23rc2-3-g85eca98. - * debian/modules/headers-more-module: - + Updated headers-more-module to v0.17rc1-4-g33a82ed. - * debian/modules/nginx-development-kit: - + Updated nginx-development-kit to v0.2.17-7-g24202b4. - * debian/modules/nginx-echo: - + Updated nginx-echo to v0.38rc2-7-g080c0a1. - * debian/modules/nginx-lua: - + Updated nginx-lua to v0.5.0rc25-5-g8d28785. - * debian/modules/nginx-upstream-fair: - + Updated nginx-upstream-fair to a18b409. - * debian/modules/nginx-upload-progress: - + Updated nginx-upload-progress to v0.9.0-0-ga788dea. - * debian/modules/naxsi: - + Updated naxsi to 0.46 - * debian/modules/README.Modules-versions: - + Updated versions and URLs for modules. - * debian/naxsi-ui-extract, debian/naxsi-ui-intercept, - debian/nginx-naxsi-ui.*, debian/naxsi-ui-extract.1, - debian/naxsi-ui-intercept.1, debian/rules: - + Added nginx-naxsi-ui package containing the learning daemon - and the WebUI. - * debian/nginx-common.nginx.default, debian/nginx-common.nginx.init: - + Renamed files to be compliant with the nginx-naxsi-ui package. - * debian/po: - + Added needed files for using po-debconf. - + Added French translation. - * debian/control: - + Applied the modifications given after the review by Justin Rye. - - [Michael Lustfield] - * debian/conf/uwsgi_params: - + Added UWSGI_SCHEME to uwsgi_params. (Closes: #664878) - * debian/conf/sites-available/default: - + Added allow directive for ipv6 localhost. (Closes: #664271) - - [Kartik Mistry] - * debian/control: - + wrap-and-sort. - * debian/copyright: - + Added missing copyrights, minor formatting fixes. - * debian/nginx-common.nginx.init: - + Added ulimit for restarts, Thanks to Daniel Roschka - for patch. (Closes: #673580) - * debian/conf/sites-available/default: - + Added patch to fix deprecated "listen" directive, Thanks to - Guillaume Plessis for patch. (Closes: #672632) - - -- Kartik Mistry Mon, 14 May 2012 11:15:00 +0530 - -nginx (1.1.19-1) unstable; urgency=high - - [Cyril Lavier] - * New upstream release. - + Fixed a buffer overflow in the ngx_http_mp4_module. See: CVE-2012-2089 - for more details. - * debian/copyright: - + Updated licenses. - * debian/nginx-extras.postinst, debian/nginx-full.postinst, - debian/nginx-light.postinst, debian/nginx-naxsi.postinst: - + Removing the debug markers. (Closes: #667894) - * debian/control, debian/rules, debian/copyright, - debian/modules/nginx-dav-ext-module: - + Added nginx-dav-ext-module in full and extras. - * debian/modules/naxsi: - + Updated naxsi to the SVN snapshot (r280) to fix the licence issue with - OpenSSL. - - [Kartik Mistry] - * Misc cleanups in debian/control, debian/copyright. - - -- Cyril Lavier Fri, 13 Apr 2012 16:58:59 +0530 - -nginx (1.1.18-1) unstable; urgency=low - - [Cyril Lavier] - * New upstream release. - * New binaries introduced: nginx-naxsi, nginx-naxsi-dbg. - * debian/modules/nginx-cache-purge: - + Added nginx cache purge 1.5 to nginx-naxsi. - * debian/rules, debian/control, debian/nginx-naxsi.dirs, - debian/nginx-naxsi.install, debian/nginx-naxsi.postinst, - debian/nginx-naxsi.postrm, debian/nginx-naxsi.prerm, - debian/modules/naxsi, debian/conf/naxsi_core.rules, - debian/modules/README.Modules-versions, debian/conf/nginx.conf: - + Added nginx-naxsi flavour. - + Added naxsi 0.44 to nginx-naxsi. - - -- Cyril Lavier Thu, 29 Mar 2012 22:43:07 +0530 - -nginx (1.1.17-2) unstable; urgency=high - - [Cyril Lavier] - * debian/control: - + Added build dependency to dpkg-dev (>= 1.15.7). (Closes: #664212) - * debian/patches/perl-use-dpkg-buildflags.patch: - + Added patch to harden flags for perl module (Thanks to Simon Ruderich - for the patch). (Closes: #664090) - - [Kartik Mistry] - * Set urgency due to fix for security and RC bugs with 1.17.1-1 upload. - - -- Cyril Lavier Sun, 18 Mar 2012 09:31:19 +0530 - -nginx (1.1.17-1) unstable; urgency=medium - - [Kartik Mistry] - * New upstream release. (Closes: #664137) - + Fixed malformed HTTP responses. See: CVE-2012-1180 for more details. - * Set urgency to medium due to security issue. - - [Cyril Lavier] - * debian/rules: - + Set NUMJOBS to 1 if no value is given - + Added Auth PAM module to nginx-extras - + Enable hardened flags for perl module (Thanks to Simon Ruderich for - the patch) (Closes: #664090). - * debian/conf/sites-available/default: - + Added the fastcgi_pass for php5-fpm. (Closes: #662997) - * debian/nginx-common.postrm, debian/rules, debian/nginx-common.postinst, - debian/nginx-common.prerm, debian/nginx-common.service: - + Added the systemd support. Thanks to Michael Stapelberg for the patch. - (Closes: #662799) - - -- Kartik Mistry Fri, 16 Mar 2012 10:27:38 +0530 - -nginx (1.1.16-1) unstable; urgency=low - - [Cyril Lavier] - * Modified the parallel build to avoid random FTBFS in Ubuntu. - * New upstream release. - * debian/modules: - + Updated nginx-upload-progress to 0.8.3-2-g03cbf1f. - * debian/control: - + Added myself as uploader. - + Added libpam0g-dev to Build-Depends. - + Use wrap-and-sort to wrap control file fields. - - [Michael Lustfield] - * debian/nginx-common.postinst: - + Changed postinst to not change permissions on all log files. - (Closes: #658492) - * debian/rules: - + Added Auth PAM module at debian/modules/nginx-auth-pam. (Closes: #660408) - - [Kartik Mistry] - * debian/control: - + Added conflict between -dbg packages as seen by Lintian. - + Updated Standards-Version to 3.9.3 - * debian/copyright: - + Updated for copyright-format 1.0 - + Updated upstream copyright year and details. - * debian/rules: - + Moved nginx-auth-pam module to nginx-full package. - - -- Kartik Mistry Sun, 04 Mar 2012 10:31:21 +0530 - -nginx (1.1.14-1) unstable; urgency=low - - [Cyril Lavier] - * New upstream release. - * debian/rules: - + Resolved the lintian errors "unstripped-binary-or-object" with a - cleaner correction (Thanks to Steven Chamberlain for the patch). - + Added a check on the parallel building to force NUMJOBS to 1 if - the value 0 is given. - * debian/modules: - + Updated nginx-lua module to version 0.4.1. - - [Kartik Mistry] - * debian/rules, debian/control, debian/copyright, - debian/modules/nginx-upload-module: - + Added Upload module to nginx-extras, updated long description and - copyright. (Closes: #654593) - * debian/modules/README.modules: - + Added Homepage information for some modules. - * debian/rules: - + Enable hardened build flags, Thanks to Moritz Muehlenhoff for patch. - (Closes: #658186) - - -- Kartik Mistry Wed, 01 Feb 2012 17:50:05 +0530 - -nginx (1.1.12-1) unstable; urgency=low - - [Kartik Mistry] - * debian/control: - + Set myself as Maintainer, Jose Parrella as Uploaders with approval from - team. - * debian/copyright: - + Fixed DEP5 URL. - + Updated debian/* copyright. - * debian/modules: - + Updated nginx-lua module to version 0.3.1rc43 - - [Cyril Lavier] - * New upstream release. - * debian/conf/sites-available/default: - + Added a / in the alias directive. (Closes: #653160) - * debian/rules: - + Added necessary lines for parallel building. - - -- Kartik Mistry Sun, 01 Jan 2012 17:21:02 +0530 - -nginx (1.1.11-1) unstable; urgency=low - - [Kartik Mistry] - * New upstream release. - * debian/control: - + Set priority to extra for nginx-light and nginx-extras binaries - (Policy: Section 2.5) - * debian/patches/607418-ipv6-addresses.diff: - + Removed. Merged upstream with 1.1.9 release. - * debian/copyright: - + Updated upstream copyright year, updated Michael's email address, misc - changes for format. - - [Michael Lustfield] - * debian/conf/fastcgi_params: - + Changed $server_https to $https per new feature in 1.1.11. - * debian/conf/nginx.conf: - + Removed map for $server_https as it's no longer needed. - - -- Kartik Mistry Wed, 14 Dec 2011 09:45:40 +0530 - -nginx (1.1.8-2) unstable; urgency=low - - * debian/modules/chunkin-nginx-module: - + Reinclude HttpChunkin Module with new upstream version (closes: #638814) - * debian/control: - + Add myself to uploaders list. - - -- Dmitry E. Oboukhov Thu, 24 Nov 2011 14:16:50 +0530 - -nginx (1.1.8-1) unstable; urgency=low - - [Kartik Mistry] - * New upstream release. - * debian/modules/chunkin-nginx-module: - + Removed as of now, as it breaks with Perl 5.14 (Closes: #649061) - - [Michael Lustfield] - * debian/control: - + Added Map module to nginx-light modules list. - * debian/rules: - + Removed --without-http_map_module form nginx-light. - * debian/nginx-common.install: - + Changed ufw profile installation (LP: #825349). - - debian/ufw.profile -> debian/ufw/nginx. - * debian/nginx-common.preinst: - + Cleanup of moved nginx profile. - * debian/conf/nginx.conf: - + Added a default map for $server_https (on|off). - * debian/conf/fastcgi_params: - + Pass HTTPS so $_SERVER['HTTPS'] is set (LP: #857831). - * debian/conf/mime.types: - + Added json type (LP: #883440). - * debian/conf/sites-available/default: - + Added notes about PHP (Closes: #642995). - + Changed location /doc from root to alias. - + Changed location /doc to /doc/ for people that don't bother reading or - learning anything about Nginx configuration files (LP: #840358). - - -- Kartik Mistry Fri, 18 Nov 2011 23:44:00 +0530 - -nginx (1.1.4-2) unstable; urgency=low - - [Kartik Mistry] - * debian/modules: - + Updated nginx-upload-progress module, Thanks to upstream for fixing issue - that FTBFS nginx on kFreeBSD-* archs. - + Updated nginx-lua module to latest upstream. - - -- Kartik Mistry Mon, 26 Sep 2011 10:17:04 +0530 - -nginx (1.1.4-1) unstable; urgency=low - - [Kartik Mistry] - * New upstream release. - * debian/rules: - + Added 'HTTPStubStatus' module in nginx-light also (Closes: #639661). - + Added 'HTTP MP4' module in nginx-extras. (Closes: #642022). - * Add new modules, Thanks to Dmitry E. Oboukhov : - + NginxHttpHeadersMore Module (closes: #638820). - + HttpChunkin Module (closes: #638814). - * Renamed debian/modules/versions to debian/modules/README.modules-version, - added missing homepage and version information. - - -- Kartik Mistry Sun, 25 Sep 2011 13:44:48 +0530 - -nginx (1.1.2-1) unstable; urgency=low - - [ Kartik Mistry ] - * New upstream release - * debian/control: - + Added missing 'http-push' module in long description of nginx-extras. - (Closes: #638924) - + Removed 'File AIO' module from description, which we don't provide. - (Closes: #639360) - + Added 'HTTP Sub Module' in long description of nginx-extras, nginx-full. - + Updated Breaks/Replaces fields. - - [ Michael Lustfield ] - * debian/copyright: - + Updated email address for Michael Lustfield - * debian/control: - + Updated email address for Michael Lustfield - + Updated Breaks on nginx-common to address conflicting versions - - -- Kartik Mistry Wed, 07 Sep 2011 12:15:36 +0530 - -nginx (1.1.0-1) unstable; urgency=low - - [ Kartik Mistry ] - * New upstream release - * debian/control: - + Added 'Upload Progress' module in long description of nginx-extras - (Closes: #635313) - * debian/rules, debian/modules: - + Removed deprecated module: nginx-secure-download - * debian/modules: - + Updated nginx-lua module to version: v0.2.1rc2 - + Updated nginx-echo module to version: v0.37rc1 - - -- Kartik Mistry Tue, 02 Aug 2011 20:06:43 +0530 - -nginx (1.0.5-1) unstable; urgency=low - - * New upstream release - * debian/control: - + nginx Depends on either nginx-full or nginx-light, Thanks to - Hans van Kranenburg (Closes: #633879) - * debian/copyright: - + Updated to latest DEP-5 specification - + Added some missing copyrights for modules - + Updated copyright years - - -- Kartik Mistry Wed, 20 Jul 2011 10:16:45 +0530 - -nginx (1.0.4-1) unstable; urgency=low - - * New upstream release - * debian/*.lintian-overrides, debian/rules: - + Removed unused lintian for missing manpages - - -- Kartik Mistry Wed, 01 Jun 2011 19:12:25 +0530 - -nginx (1.0.1-1) unstable; urgency=low - - * New upstream release - * debian/rules: - + Removed if surrounding copy of man/ as it is required for builds. - + Added nginx-upload-progress to nginx-extras. (Closes: #618306) - + Added nginx-secure-downloads to nginx-extras. (Closes: #622268) - + Added --prefix to configure command. (Closes: #619482) - * debian/modules: - + Added nginx-upload-progress/*. - + Added nginx-secure-download/*. - + Updated nginx-lua/*. - + Updated versions. - * debian/control: - + Added libmhash-dev build dependency. - + Updated Standards-Version to 3.9.1. - - -- Michael Lustfield Mon, 09 May 2011 00:36:54 +0530 - -nginx (1.0.0-2) unstable; urgency=low - - * debian/rules: - + Removed --with-file-aio support. Fixed FTBFS on kFreeBSD-* arch - (Closes: #621882) - - -- Kartik Mistry Sat, 16 Apr 2011 13:47:58 +0530 - -nginx (1.0.0-1) unstable; urgency=low - - [Kartik Mistry] - * New upstream release: - + Removed debian/patches/609343-log-time-iso8601.diff, merged upstream. - * debian/rules: - + Fixed: FTBFS on sparc64, detects sparc64 as sparc. Thanks to - Aurelien Jarno (Closes: #617924) - * debian/watch: - + Updated for 1.x.x release - - [Michael Lustfield] - * debian/rules: - + Added Echo module back to nginx-full. (LP: #735622) - + Moved nginx-push-0.96 to nginx-http-push. - * debian/modules: - + Updated nginx-development-kit. - + Updated nginx-echo. - + Updated nginx-http-push. - + Updated nginx-lua. - + Updated nginx-upstream-fair. - + Added versions to track module versions. - * debian/conf/fastcgi_params: - + Changed $document_root$fastcgi_script_name to $request_filename. - - -- Kartik Mistry Thu, 14 Apr 2011 10:41:08 +0530 - -nginx (0.8.54-4) unstable; urgency=low - - [Micheal Lustfield] - * debian/nginx-{full,light,extras}.default: - + Added comment about alternative to ULIMIT. - * debian/nginx-{full,light,extras}.init.d: - + Added quotes around a test variable. (Closes: #610946, LP: #699736) - * debian/patches/609343-log-time-iso8601.diff: - + Added patch to add $time_iso8601 variable to logs. (Closes: #609343) - * Clean up old logrotate files. (Closes: #608983, Closes: #610289) - + Added Files: - - debian/nginx-common.preinst - + Modified Files: - - debian/rules - + Moved debian/nginx-common.logrotate to debian/logrotate. - * Added common files to nginx-common package. (Closes: #610290) - + Removed Files: - - debian/nginx-full.dirs - - debian/nginx-light.dirs - - debian/nginx-full.install - - debian/nginx-light.install - - debian/nginx-extras.install - - debian/nginx.* - + Added Files: - - debian/nginx-common.default - - debian/nginx-common.dirs - - debian/nginx-common.init.d - - debian/nginx-common.install - - debian/nginx-common.manpages - - debian/logrotate - + Modified Files: - - debian/nginx-extras.dirs - - debian/control - - debian/rules - * debian/nginx-*.install: (Closes: #609797) - + Removed NEWS.Debian from nginx-{full,light,extras}.install. - + Added NEWS.Debian to nginx-common.install. - * nginx-common.postinst: - + Enforce /var/log/nginx mode and user:group. (Closes: #610983) - + Enforce /var/log/nginx/*.log mode and user:group. (Closes: #612832) - * debian/rules: - + Added --with-file-aio to nginx-extras. (Closes: #613175) - + Removed split clients and user id modules from nginx-light. - * debian/conf/sites-available/default: - + Fixed a minor typo ( s/Quickstart/QuickStart/ ). (Closes: #613355) - * debian/conf/mime.types: - + Changed xml type to application/xhtml+xml. (Closes: #613851) - * debian/help/docs/fcgiwrap: - + Removed Ubuntu specific line in docs. (Closes: #614987) - * debian/conf/sites-available/default: - + Fixed a pointer to a file. (Closes: #614980) - - [Kartik Mistry] - * debian/*.lintian-overrides: - + Add Lintian overrides for nginx man page. We've manpage in nginx-common - binary - - -- Michael Lustfield Thu, 03 Mar 2011 23:39:07 +0530 - -nginx (0.8.54-3) unstable; urgency=low - - * debian/control: - + Added Breaks: and Replaces: to nginx packages. (Closes: #609254) - * debian/rules: - + Adding SSL support to nginx-light. (Closes: #609134) - + Adding HTTP Addition module to nginx-full and nginx-extras. (Closes: #609411) - + Added HTTP Push module to nginx-extras. (LP: #694456) - - -- Michael Lustfield Tue, 11 Jan 2011 05:27:39 -0600 - -nginx (0.8.54-2) unstable; urgency=low - - * Do not install nginx.8 man page in debug packages (Closes: #608633) - - -- Kartik Mistry Sun, 02 Jan 2011 18:46:03 +0530 - -nginx (0.8.54-1) unstable; urgency=low - - [ Michael Lustfield ] - * Added ipv6 patch. (Closes: #607418) - + Edited files: - - src/http/ngx_http_request.c - * Added ulmit patches. (Closes: #606094) - + Added files: - - debian/nginx-full.default - - debian/nginx-light.default - - debian/nginx-extras.default - + Edited files: - - debian/nginx-full.init.d - - debian/nginx-light.init.d - - debian/nginx-extras.init.d - * Added perl module to nginx-extras. (Closes: #598461) - + debian/rules: - - Added --with-http_perl_module to nginx-extras. - + debian/control: - - Added libperl-dev build dependency. - + debian/nginx-extras.install: - - Added perl install files - + debian/nginx-extras.dirs: - - Added directory to install perl files. - * debian/rules: - + Added ifeq to handle nginx.8 (man page) if it exists in the source. - * debian/control: - + Added descriptions to make clear the differences between nginx packages. - * Removed patches: - + debian/patches/nginx-echo.diff - - Put source into debian/patches/. - + debian/patches/nginx-upstream-fair.diff - - Put source into debian/patches/. - + debian/patches/dlopen.diff - - Patch no longer relevant. - * Added modules: - + debian/modules/nginx-development-kit - + debian/modules/nginx-upstream-fair - + debian/modules/nginx-echo - + debian/modules/nginx-lua - * Split Nginx into multiple variations of the package. - + Added files for nginx-full: - - debian/nginx-full.install - - debian/nginx-full.dirs - - debian/nginx-full.logrotate - - debian/nginx-full.init.d - - debian/nginx-full.postinst - - debian/nginx-full.prerm - - debian/nginx-full.postrm - + Added files for nginx-light: - - debian/nginx-light.install - - debian/nginx-light.dirs - - debian/nginx-light.logrotate - - debian/nginx-light.init.d - - debian/nginx-light.postinst - - debian/nginx-light.prerm - - debian/nginx-light.postrm - + Added files for nginx-extras: - - debian/nginx-extras.install - - debian/nginx-extras.dirs - - debian/nginx-extras.logrotate - - debian/nginx-extras.init.d - - debian/nginx-extras.postinst - - debian/nginx-extras.prerm - - debian/nginx-extras.postrm - + Removed files for nginx: - - debian/nginx.install - - debian/nginx.dirs - - debian/nginx.logrotate - - debian/init.d - - debian/postinst - - debian/prerm - - debian/postrm - + Updated debian/rules: - - Modified rules to create extra packages. - + Updated debian/control: - - Added packages for nginx-{full,light,extras}. - - Added packages for nginx-{full,light,extras}-dbg. - - Changed nginx to a dummy package selecting nginx-full. - - [Kartik Mistry] - * debian/control: - + Added doc section for nginx-doc - + Wrapped some long descriptions, updated short descriptions - + Added perl:Depends for nginx-extras - * debian/rules: - + Fixed dh_installchangelogs, dh_compress - - -- Michael Lustfield Thu, 30 Dec 2010 14:15:26 +0530 - -nginx (0.8.53-2) unstable; urgency=low - - [Kartik Mistry] - * debian/conf/mime.types: - + Added html5 codecs support (Closes: #605212) - * debian/conf/fastcgi_params: - + Fixed typo (Closes: #605582) - - [Michael Lustfield] - * debian/conf/nginx.conf: - + Reduced worker_connections to 768 (Closes: #605529) - * Add an nginx site management script to nginx-doc. (Closes: #593580) - + debian/help/examples/nginx_modsite: Added. - * debian/nginx.logrotate: - + Added prerotate chunk for awstats. (Closes: #590098) - * debian/copyright: - + Added Michael Lustfield - * Created nginx-doc: - + Added 'Package: nginx-doc' section to debian/control - + Moved debian/nginx.examples -> debian/nginx-doc.examples - + Moved debian/nginx.docs -> debian/nginx-doc.docs - - -- Kartik Mistry Mon, 06 Dec 2010 11:26:22 +0530 - -nginx (0.8.53-1) unstable; urgency=low - - [Kartik Mistry] - * debian/control: - + Added Michael Lustfield as co-maintainer - * nginx.conf: - + No need to use regex in gzip_disable for msie6, Thanks to António P. P. - Almeida (Closes: #592147) - * conf/sites-available/default: - + Fixed typo for "include fastcgi", Thanks to Mostafa Ghadamyari - (Closes: #593142, #593143) - * debian/patches/fix_reloading_ipv6.diff: - + Removed, merged upstream - * debian/init.d: - + Added fix to control nginx by user in a simple way by setting DAEMON - variable to an invalid name in /etc/default/nginx. Patch by Toni Mueller - (Closes: #594598) - * debian/NEWS.Debian: - + Updated news for 0.8.x as stable branch - - [Michael Lustfield] - * New upstream release (Closes: #602970) - + 0.8.x branch is declared stable by upstream now - * Add a UFW profile set: - + debian/nginx.ufw.profile: Added. - + debian/control: nginx: Suggests ufw. - + debian/dirs: Add 'etc/ufw/applications.d' - + debian/rules: Add install rule for the nginx UFW profile. - * Moved debian/dirs to debian/nginx.dirs - * Added types_hash_max_size to nginx.conf - * Install simple default index.html file (Closes: #581416) - + debian/dirs: Add 'usr/share/nginx/www'. - + debian/nginx.install: Add 'html/* usr/share/nginx/www'. - * debian/patches/nginx-echo.diff: - + Added Echo module - * Added files for nginx.docs - - /usr/share/doc/nginx/ - + debian/help/docs/fcgiwrap - + debian/help/docs/php - + debian/help/docs/support-irc - + debian/help/docs/upstream - * Added files for nginx.examples - - /usr/share/doc/nginx/examples/ - + debian/help/docs/drupal - + debian/help/docs/http - + debian/help/docs/mail - + debian/help/docs/mailman - + debian/help/docs/nginx.conf - + debian/help/docs/virtual_hosts - + debian/help/docs/wordpress - * debian/conf/: - + Removed excess spaces - + Added tabs where appropriate - + Added SCRIPT_FILENAME to fastcgi_params - - -- Kartik Mistry Sat, 27 Nov 2010 21:04:02 +0530 - -nginx (0.7.67-3) unstable; urgency=low - - * debian/rules: - + Readded the configure option --with-mail_ssl_module, Thanks to Roland - Rosenfeld (Closes: #590815) - * debian/control: - + Updated Standards-Version to 3.9.1 (no changes needed) - - -- Kartik Mistry Thu, 29 Jul 2010 21:41:52 +0530 - -nginx (0.7.67-2) unstable; urgency=low - - * debian/conf/sites-available/default: - + Removed reference to SSLv2 protocol (Closes: #589139) - * debian/control: - + Updated Standards-Version to 3.9.0 - * debian/copyright: - + Don't point to BSD license file, included exact upstream version of - license text - + Added missing copyright owner for contrib/ scripts - + debian/* license is same as upstream now as discussed with co-maintainers - - -- Kartik Mistry Mon, 19 Jul 2010 10:36:32 +0530 - -nginx (0.7.67-1) unstable; urgency=low - - * New upstream release - - -- Kartik Mistry Wed, 16 Jun 2010 01:26:51 +0530 - -nginx (0.7.65-7) unstable; urgency=low - - [Kartik Mistry] - * debian/rules: - + Enabled HTTPSubModule module in configure (Closes: #584828) - + Arranged configure options in better manner - - -- Kartik Mistry Mon, 07 Jun 2010 14:33:24 +0530 - -nginx (0.7.65-6) unstable; urgency=low - - [Kartik Mistry] - * debian/README.Debian: - + Fixed typo and somewhat better wordings - * debian/conf/mime.types: - + Added entry to support 7zip files (Closes: #580423) - * debian/init.d: - + Do not print config testing info until an error found, Thanks to Ubuntu - bug 568293 - * debian/copyright: - + Updated as per DEP-5 specification - - -- Kartik Mistry Sat, 22 May 2010 01:41:33 +0530 - -nginx (0.7.65-5) unstable; urgency=low - - [Kartik Mistry] - * debian/patches/fix_reloading_ipv6.diff: - + Added patch to fix reloading with IPv6 addresses, Thanks to - Matthias-Christian Ott for patch (Closes: #577456) - - -- Kartik Mistry Wed, 14 Apr 2010 11:36:48 +0530 - -nginx (0.7.65-4) unstable; urgency=low - - [Kartik Mistry] - * debian/conf/sites-available/default: - + Really listen for both IPv4 and IPv6 addresses. Thanks to Nikolaus - Schulz for notice (Closes: #574983) - * debian/control, debian/rules: - + Added GeoIP support, Thanks to Caetano Carezzato - (Closes: #575280) - * debian/conf/mime.types: - + Added svg entry to mime.types, Jeremy Lal - (Closes: #575155) - - -- Kartik Mistry Thu, 25 Mar 2010 00:21:50 +0530 - -nginx (0.7.65-3) unstable; urgency=medium - - [Kartik Mistry] - * Urgency set to medium due to Release Goal - * debian/conf/sites-available/default: - + Listen for both IPv4 and IPv6 addresses by default (Closes: #574983) - - -- Kartik Mistry Tue, 23 Mar 2010 10:30:18 +0530 - -nginx (0.7.65-2) unstable; urgency=low - - * debian/README.Debian: - + Added explanation about not installing files in /var/www/ - (Closes: #572513) - * debian/rules: - + Readded realip module support (Closes: #507419) - - -- Kartik Mistry Sat, 06 Mar 2010 13:14:48 +0530 - -nginx (0.7.65-1) unstable; urgency=low - - [Kartik Mistry] - * New upstream release - * debian/init.d: - + $local_fs $remote_fs $network $syslog is what we need in Required-Start - and Required-Stop (Closes: #568238) - * debian/copyright: - + Updated package copyright year - + Updated license text to make same as upstream license - - -- Kartik Mistry Fri, 05 Feb 2010 11:20:28 +0530 - -nginx (0.7.64-3) unstable; urgency=low - - [Kartik Mistry] - * debian/conf/sites-available/default: - + Added patch to fix default virtual host, Thanks to Thomas Venieris - (Closes: #564726) - * debian/init.d: - + Added dependency on $remote_fs in Required-Start and Required-Stop - (Closes: #566862) - * Converted package to use 3.0 (quilt) source format - * Updated to Standards-Version 3.8.4 - - -- Kartik Mistry Mon, 01 Feb 2010 23:44:21 +0530 - -nginx (0.7.64-2) unstable; urgency=low - - [Kartik Mistry] - * debian/rules: - + Used dh_prep instead of dh_clean -k - * debian/control: - + Added ${misc:Depends} in Depends - * Added patch for adding debug package, Thanks to Matthew Palmer - (Closes: #563339) - * debian/copyright: - + Added missing copyright owners for Debian package and fixed year and - licence doesn't point to versionless symlink - - [Fabio Tranchitella] - * debian/init.d: - + Added patch from Wouter de Bie to add $DAEMON_OPTS in - test_nginx_config() - - -- Kartik Mistry Sat, 09 Jan 2010 11:15:59 +0530 - -nginx (0.7.64-1) unstable; urgency=medium - - [Kartik Mistry] - * Urgency set to medium due to security issue - * New upstream release (Closes: #557602) - + fixes SSL renegotiation vuln CVE-2009-3555 (Closes: #557873) - * debian/nginx.1: - + Corrected homepage entry (Closes: #556617) - + Minor whitespace and empty line cleanups, added SEE ALSO section. Used - .TP instead of .br, Added missing options, and this should - (Closes: #556616) - * debian/copyright: - + Used © instead of deprecated (C) symbol - + Formatted some texts - * debian/control: - + Added myself as uploader - + Wrapped and rearranged Build-Depends for better readability - * debian/patches/dlopen.dpatch: - + Fixed patch name in comment - + Added missing DP comment from changelog - * debian/rules: - + Minor fixes related to formatting of file and whitespaces - * debian/watch: - + Removed comments out of it - - -- Kartik Mistry Fri, 27 Nov 2009 11:10:18 +0530 - -nginx (0.7.63-1) unstable; urgency=low - - * New upstream release. - - -- Fabio Tranchitella Sun, 08 Nov 2009 09:53:46 +0100 - -nginx (0.7.62-4) unstable; urgency=low - - * debian/conf/nginx.conf: commented out the mail proxy example. - (Closes: #551682) - * debian/init.d: do not redirect the output of nginx -t. - (Closes: #551683) - - -- Fabio Tranchitella Thu, 22 Oct 2009 19:50:05 +0200 - -nginx (0.7.62-3) unstable; urgency=low - - * debian/rules: fix the FTBFS on sparc. - - -- Fabio Tranchitella Fri, 16 Oct 2009 06:39:22 +0000 - -nginx (0.7.62-2) unstable; urgency=low - - * debian/rules: added --with-mail and --with-mail_ssl_module. - * debian/patches/nginx-upstream-fair.dpatch: added support for the - nginx-upstream-fair module. (Closes: #521447) - * debian/patches/dlopen.dpatch: applied patch to remove the unnecesssary link - to libdl. (Closes: #540599) - - -- Fabio Tranchitella Thu, 15 Oct 2009 18:32:00 +0000 - -nginx (0.7.62-1) unstable; urgency=low - - * New upstream release. - * debian/rules: added --with-ipv6. (Closes: #547249) - - -- Fabio Tranchitella Sun, 27 Sep 2009 22:25:16 +0200 - -nginx (0.7.61-2) unstable; urgency=low - - * debian/control: bumped Standards-Version to 3.8.3, no changes needed. - * debian/init.d: added status action. (Closes: #541228) - * debian/rules: - - added -with-http_gzip_static_module. (Closes: #541229) - - use the switch --with-cc-opt="-m32 -mcpu=ultrasparc" on sparc. - (Closes: #543571) - - -- Fabio Tranchitella Sat, 29 Aug 2009 17:03:44 +0200 - -nginx (0.7.61-1) unstable; urgency=low - - * New upstream version: - *) Bugfix: nginx could not be built --without-http-cache; the bug had - appeared in 0.7.60. - *) Bugfix: a segmentation fault occurred in worker process, if a - backend 401 error was intercepted and the backend did not set the - "WWW-Authenticate" response header line. - Thanks to Eugene Mychlo. - *) Feature: the "keepalive_requests" directive. - *) Bugfix: in open_file_cache and proxy/fastcgi cache interaction on - start up. - *) Bugfix: open_file_cache might cache open file descriptors too long. - *) Bugfix: XLST filter did not work in subrequests. - * Fix "gzip_disable in default conf for old IE", adding ignore rules for - certain MSIE versions in the default configuration (Closes: #540025) - * Fix "init.d: Config test before allowing a restart" adding a function - and calling it before reloading, restarting and starting (Closes: #539778) - * Drops path for pidof call in postinst script. - - -- Jose Parrella Wed, 05 Aug 2009 14:00:11 -0500 - -nginx (0.7.59-1) unstable; urgency=low - - * New upstream release, first in Debian for the 0.7 branch. Among other - issues, it also fixes the problem with wildcard dns names used with SSL. - (Closes: #515904) - * debian/watch: updated. - * debian/postinst: fixed a bashism. (Closes: #507913) - * debian/conf/nginx.conf: removed default_type. (Closes: #509390) - * debian/control: updated Standards-Version to 3.8.1, no changes needed. - * debian/NEWS.Debian: documented the issues with - server_names_hash_bucket_size. (Closes: #524785) - - -- Fabio Tranchitella Sun, 31 May 2009 18:38:56 +0200 - -nginx (0.7.14-1) experimental; urgency=low - - * New upstream release. - * Adding configtest to the init.d script (Closes: #496279) - * postinst now calls the builtin kill, so tweaks on the specific signal - calls were needed. - * Default HTML files are no longer installed. - * The default configuration file no longer requires a 50x file under - /var/www. - - -- Jose Parrella Tue, 02 Sep 2008 20:48:58 -0430 - -nginx (0.6.34-2) unstable; urgency=low - - * Added support for realip module. (Closes: #507419) - - -- Fabio Tranchitella Sat, 06 Dec 2008 10:34:01 +0100 - -nginx (0.6.34-1) unstable; urgency=low - - * New upstream release. - * debian/rules: removed the --with-debug configure switch. (Closes: #500891) - - -- Fabio Tranchitella Sun, 30 Nov 2008 11:37:13 +0100 - -nginx (0.6.32-3) unstable; urgency=low - - * debian/control: build again on all the architectures, but use the switch - --with-cc-opt="-m32 -mcpu=ultrasparc" on sparch. (Closes: #479185) - - -- Fabio Tranchitella Thu, 25 Sep 2008 17:14:27 +0200 - -nginx (0.6.32-2) unstable; urgency=low - - * debian/control: disabled support for sparc. (Closes: #479185) - - -- Fabio Tranchitella Sat, 20 Sep 2008 11:48:48 +0200 - -nginx (0.6.32-1) unstable; urgency=low - - * New upstream release. - - -- Fabio Tranchitella Fri, 18 Jul 2008 09:15:58 +0200 - -nginx (0.6.31-2) unstable; urgency=low - - * debian/control: removed httpd-cgi, nginx doesn't support executing - external programs. (Closes: #482332) - - -- Fabio Tranchitella Thu, 22 May 2008 08:18:52 +0200 - -nginx (0.6.31-1) unstable; urgency=low - - * New upstream release. - - -- Fabio Tranchitella Mon, 12 May 2008 22:34:55 +0200 - -nginx (0.6.30-2) unstable; urgency=low - - * Upload into unstable. - - -- Fabio Tranchitella Mon, 12 May 2008 14:24:53 +0200 - -nginx (0.6.30-1) experimental; urgency=low - - * New upstream release. - * Sync with the unstable packages. - * debian/conf/nginx.conf: add support for a conf.d directory. - (Closes: #476952) - - -- Fabio Tranchitella Fri, 02 May 2008 09:32:46 +0200 - -nginx (0.5.35-3) unstable; urgency=low - - * debian/conf/sites-available/default: adding support for /doc and /images - namespaces (Closes: #474519) - - -- Jose Parrella Mon, 07 Apr 2008 13:22:32 -0430 - -nginx (0.5.35-2) unstable; urgency=low - - * debian/init.d: do not break if start-stop-daemon exits with an error. - (Closes: #464453) - - -- Fabio Tranchitella Sun, 10 Feb 2008 17:57:57 +0100 - -nginx (0.5.35-1) unstable; urgency=low - - * New upstream release. - - -- Fabio Tranchitella Wed, 09 Jan 2008 07:58:56 +0100 - -nginx (0.5.34-1) unstable; urgency=low - - * New upstream release. - * debian/control: added Homepage, Vcs-Svn, Vcs-Browser fields; updated - Standard-Versions to 3.7.3. - - -- Fabio Tranchitella Mon, 24 Dec 2007 12:26:27 +0100 - -nginx (0.5.33-1) unstable; urgency=low - - * New stable upstream release (Closes: #451173) - * nginx now provides httpd, httpd-cgi virtual packages - (Closes: #439468, #452025) - * sites-enabled/default link is now provided only on fresh - installations (Closes: #432961) - * Updated code for online upgrading of nginx (Closes: #445246) - * Reviewed maintainer scripts for correct behaviour on updates - (Closes: #452787, #435965) - * Removed debian/nginx.links and debian/preinst. - * Changing Maintainer address to bureado@debian.org. - * Welcoming Fabio Tranchitella as an nginx - uploader for Debian. Thanks for your patches. - - -- Jose Parrella Sat, 08 Dec 2007 11:27:54 -0400 - -nginx (0.5.30-1) unstable; urgency=low - - * New stable upstream release. - * Adding mime.types (and other upstream conffiles) to the package - since it was lost on 0.5.26 (Closes: #435964) - - -- Jose Parrella Sat, 04 Aug 2007 10:39:40 -0400 - -nginx (0.5.26-1) unstable; urgency=low - - * New stable upstream release. - * Updating init.d usage message. - * Installing logrotate script (Closes: #397978) - - -- Jose Parrella Sun, 17 Jun 2007 20:43:35 +0100 - -nginx (0.5.18-1) unstable; urgency=low - - * New upstream version (Closes: #420063) - * Adding DAV support (Closes: #415678) - * Adding support for sites-[available|enabled]/ (Closes: #419912) - - -- Jose Parrella Thu, 19 Apr 2007 21:50:37 -0400 - -nginx (0.5.13-1) unstable; urgency=low - - * Adding FLV support. (Closes: #411105) - * Adding SSL support. - - -- Jose Parrella Mon, 19 Feb 2007 10:30:07 -0400 - -nginx (0.5.12-2) unstable; urgency=low - - * Patching src/core/ngx_shmtx.h in order to solve FTBFS problems in - non-x86 archs (Thanks to Igor Sysoev) (Closes: #410884) - - -- Jose Parrella Wed, 14 Feb 2007 13:32:01 -0400 - -nginx (0.5.12-1) unstable; urgency=low - - * New upstream version fixes FTBFS problems in non-x86 archs - (Closes: #409878) - - -- Jose Parrella Mon, 12 Feb 2007 19:37:07 -0400 - -nginx (0.5.11-1) unstable; urgency=low - - * New upstream version. (Closes: #405983) - - -- Jose Parrella Mon, 05 Feb 2007 19:35:56 -0400 - -nginx (0.4.13-2) unstable; urgency=low - - * Fixed default installation paths for www/ files, avoiding the - default installation of index.html in /var/www (Closes: #400103) - * Alexey Besciokov provided new postinst and prerm - scripts with the ability to reload the master binary (Closes: #398009) - - -- Jose Parrella Fri, 24 Nov 2006 07:12:46 -0400 - -nginx (0.4.13-1) unstable; urgency=low - - * New upstream version - * Fixed default configuration file which made nginx to fail at - installation and purge. - - -- Jose Parrella Thu, 16 Nov 2006 22:44:33 -0400 - -nginx (0.4.12-1) unstable; urgency=low - - * New upstream version (Closes: #397969) - * nginx will now compile with debugging and status support - (Closes: #397967) - * Added configuration reload support in the init.d script - (Closes: #397980) - * Added logrotate script (Closes: #397978) - * Added debian/upstream.pl as a brief helper for new - upstream version packaging. - * Thanks to Alexey Besciokov for - suggestions, bug reports and patches. - - -- Jose Parrella Sun, 12 Nov 2006 18:31:24 -0400 - -nginx (0.4.2-1) unstable; urgency=low - - * Initial release (Closes: #386151) - * Tweaked the configuration file and the path handling for Debian. - - -- Jose Parrella Thu, 14 Sep 2006 11:40:20 -0400 diff --git a/debian/conf/fastcgi.conf b/debian/conf/fastcgi.conf deleted file mode 100644 index d53a628..0000000 --- a/debian/conf/fastcgi.conf +++ /dev/null @@ -1,27 +0,0 @@ - -fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; -fastcgi_param QUERY_STRING $query_string; -fastcgi_param REQUEST_METHOD $request_method; -fastcgi_param CONTENT_TYPE $content_type; -fastcgi_param CONTENT_LENGTH $content_length; - -fastcgi_param SCRIPT_NAME $fastcgi_script_name; -fastcgi_param REQUEST_URI $request_uri; -fastcgi_param DOCUMENT_URI $document_uri; -fastcgi_param DOCUMENT_ROOT $document_root; -fastcgi_param SERVER_PROTOCOL $server_protocol; -fastcgi_param REQUEST_SCHEME $scheme; -fastcgi_param HTTPS $https if_not_empty; - -fastcgi_param GATEWAY_INTERFACE CGI/1.1; -fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; - -fastcgi_param REMOTE_ADDR $remote_addr; -fastcgi_param REMOTE_PORT $remote_port; -fastcgi_param REMOTE_USER $remote_user; -fastcgi_param SERVER_ADDR $server_addr; -fastcgi_param SERVER_PORT $server_port; -fastcgi_param SERVER_NAME $server_name; - -# PHP only, required if PHP was built with --enable-force-cgi-redirect -fastcgi_param REDIRECT_STATUS 200; diff --git a/debian/conf/fastcgi_params b/debian/conf/fastcgi_params deleted file mode 100644 index 69c4387..0000000 --- a/debian/conf/fastcgi_params +++ /dev/null @@ -1,26 +0,0 @@ - -fastcgi_param QUERY_STRING $query_string; -fastcgi_param REQUEST_METHOD $request_method; -fastcgi_param CONTENT_TYPE $content_type; -fastcgi_param CONTENT_LENGTH $content_length; - -fastcgi_param SCRIPT_NAME $fastcgi_script_name; -fastcgi_param REQUEST_URI $request_uri; -fastcgi_param DOCUMENT_URI $document_uri; -fastcgi_param DOCUMENT_ROOT $document_root; -fastcgi_param SERVER_PROTOCOL $server_protocol; -fastcgi_param REQUEST_SCHEME $scheme; -fastcgi_param HTTPS $https if_not_empty; - -fastcgi_param GATEWAY_INTERFACE CGI/1.1; -fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; - -fastcgi_param REMOTE_ADDR $remote_addr; -fastcgi_param REMOTE_PORT $remote_port; -fastcgi_param REMOTE_USER $remote_user; -fastcgi_param SERVER_ADDR $server_addr; -fastcgi_param SERVER_PORT $server_port; -fastcgi_param SERVER_NAME $server_name; - -# PHP only, required if PHP was built with --enable-force-cgi-redirect -fastcgi_param REDIRECT_STATUS 200; diff --git a/debian/conf/koi-utf b/debian/conf/koi-utf deleted file mode 100644 index e7974ff..0000000 --- a/debian/conf/koi-utf +++ /dev/null @@ -1,109 +0,0 @@ - -# This map is not a full koi8-r <> utf8 map: it does not contain -# box-drawing and some other characters. Besides this map contains -# several koi8-u and Byelorussian letters which are not in koi8-r. -# If you need a full and standard map, use contrib/unicode2nginx/koi-utf -# map instead. - -charset_map koi8-r utf-8 { - - 80 E282AC ; # euro - - 95 E280A2 ; # bullet - - 9A C2A0 ; #   - - 9E C2B7 ; # · - - A3 D191 ; # small yo - A4 D194 ; # small Ukrainian ye - - A6 D196 ; # small Ukrainian i - A7 D197 ; # small Ukrainian yi - - AD D291 ; # small Ukrainian soft g - AE D19E ; # small Byelorussian short u - - B0 C2B0 ; # ° - - B3 D081 ; # capital YO - B4 D084 ; # capital Ukrainian YE - - B6 D086 ; # capital Ukrainian I - B7 D087 ; # capital Ukrainian YI - - B9 E28496 ; # numero sign - - BD D290 ; # capital Ukrainian soft G - BE D18E ; # capital Byelorussian short U - - BF C2A9 ; # (C) - - C0 D18E ; # small yu - C1 D0B0 ; # small a - C2 D0B1 ; # small b - C3 D186 ; # small ts - C4 D0B4 ; # small d - C5 D0B5 ; # small ye - C6 D184 ; # small f - C7 D0B3 ; # small g - C8 D185 ; # small kh - C9 D0B8 ; # small i - CA D0B9 ; # small j - CB D0BA ; # small k - CC D0BB ; # small l - CD D0BC ; # small m - CE D0BD ; # small n - CF D0BE ; # small o - - D0 D0BF ; # small p - D1 D18F ; # small ya - D2 D180 ; # small r - D3 D181 ; # small s - D4 D182 ; # small t - D5 D183 ; # small u - D6 D0B6 ; # small zh - D7 D0B2 ; # small v - D8 D18C ; # small soft sign - D9 D18B ; # small y - DA D0B7 ; # small z - DB D188 ; # small sh - DC D18D ; # small e - DD D189 ; # small shch - DE D187 ; # small ch - DF D18A ; # small hard sign - - E0 D0AE ; # capital YU - E1 D090 ; # capital A - E2 D091 ; # capital B - E3 D0A6 ; # capital TS - E4 D094 ; # capital D - E5 D095 ; # capital YE - E6 D0A4 ; # capital F - E7 D093 ; # capital G - E8 D0A5 ; # capital KH - E9 D098 ; # capital I - EA D099 ; # capital J - EB D09A ; # capital K - EC D09B ; # capital L - ED D09C ; # capital M - EE D09D ; # capital N - EF D09E ; # capital O - - F0 D09F ; # capital P - F1 D0AF ; # capital YA - F2 D0A0 ; # capital R - F3 D0A1 ; # capital S - F4 D0A2 ; # capital T - F5 D0A3 ; # capital U - F6 D096 ; # capital ZH - F7 D092 ; # capital V - F8 D0AC ; # capital soft sign - F9 D0AB ; # capital Y - FA D097 ; # capital Z - FB D0A8 ; # capital SH - FC D0AD ; # capital E - FD D0A9 ; # capital SHCH - FE D0A7 ; # capital CH - FF D0AA ; # capital hard sign -} diff --git a/debian/conf/koi-win b/debian/conf/koi-win deleted file mode 100644 index 72afabe..0000000 --- a/debian/conf/koi-win +++ /dev/null @@ -1,103 +0,0 @@ - -charset_map koi8-r windows-1251 { - - 80 88 ; # euro - - 95 95 ; # bullet - - 9A A0 ; #   - - 9E B7 ; # · - - A3 B8 ; # small yo - A4 BA ; # small Ukrainian ye - - A6 B3 ; # small Ukrainian i - A7 BF ; # small Ukrainian yi - - AD B4 ; # small Ukrainian soft g - AE A2 ; # small Byelorussian short u - - B0 B0 ; # ° - - B3 A8 ; # capital YO - B4 AA ; # capital Ukrainian YE - - B6 B2 ; # capital Ukrainian I - B7 AF ; # capital Ukrainian YI - - B9 B9 ; # numero sign - - BD A5 ; # capital Ukrainian soft G - BE A1 ; # capital Byelorussian short U - - BF A9 ; # (C) - - C0 FE ; # small yu - C1 E0 ; # small a - C2 E1 ; # small b - C3 F6 ; # small ts - C4 E4 ; # small d - C5 E5 ; # small ye - C6 F4 ; # small f - C7 E3 ; # small g - C8 F5 ; # small kh - C9 E8 ; # small i - CA E9 ; # small j - CB EA ; # small k - CC EB ; # small l - CD EC ; # small m - CE ED ; # small n - CF EE ; # small o - - D0 EF ; # small p - D1 FF ; # small ya - D2 F0 ; # small r - D3 F1 ; # small s - D4 F2 ; # small t - D5 F3 ; # small u - D6 E6 ; # small zh - D7 E2 ; # small v - D8 FC ; # small soft sign - D9 FB ; # small y - DA E7 ; # small z - DB F8 ; # small sh - DC FD ; # small e - DD F9 ; # small shch - DE F7 ; # small ch - DF FA ; # small hard sign - - E0 DE ; # capital YU - E1 C0 ; # capital A - E2 C1 ; # capital B - E3 D6 ; # capital TS - E4 C4 ; # capital D - E5 C5 ; # capital YE - E6 D4 ; # capital F - E7 C3 ; # capital G - E8 D5 ; # capital KH - E9 C8 ; # capital I - EA C9 ; # capital J - EB CA ; # capital K - EC CB ; # capital L - ED CC ; # capital M - EE CD ; # capital N - EF CE ; # capital O - - F0 CF ; # capital P - F1 DF ; # capital YA - F2 D0 ; # capital R - F3 D1 ; # capital S - F4 D2 ; # capital T - F5 D3 ; # capital U - F6 C6 ; # capital ZH - F7 C2 ; # capital V - F8 DC ; # capital soft sign - F9 DB ; # capital Y - FA C7 ; # capital Z - FB D8 ; # capital SH - FC DD ; # capital E - FD D9 ; # capital SHCH - FE D7 ; # capital CH - FF DA ; # capital hard sign -} diff --git a/debian/conf/mime.types b/debian/conf/mime.types deleted file mode 100644 index cf968c0..0000000 --- a/debian/conf/mime.types +++ /dev/null @@ -1,101 +0,0 @@ -types { - text/html html htm shtml; - text/css css; - text/xml xml; - image/gif gif; - image/jpeg jpeg jpg; - application/javascript js; - application/atom+xml atom; - application/rss+xml rss; - - text/mathml mml; - text/plain txt; - text/vnd.sun.j2me.app-descriptor jad; - text/vnd.wap.wml wml; - text/x-component htc; - - image/avif avif; - image/png png; - image/svg+xml svg svgz; - image/tiff tif tiff; - image/vnd.wap.wbmp wbmp; - image/webp webp; - image/x-icon ico; - image/x-jng jng; - image/x-ms-bmp bmp; - - font/woff woff; - font/woff2 woff2; - - application/java-archive jar war ear; - application/json json; - application/mac-binhex40 hqx; - application/msword doc; - application/pdf pdf; - application/postscript ps eps ai; - application/rtf rtf; - application/vnd.apple.mpegurl m3u8; - application/vnd.google-earth.kml+xml kml; - application/vnd.google-earth.kmz kmz; - application/vnd.ms-excel xls; - application/vnd.ms-fontobject eot; - application/vnd.ms-powerpoint ppt; - application/vnd.oasis.opendocument.graphics odg; - application/vnd.oasis.opendocument.presentation odp; - application/vnd.oasis.opendocument.spreadsheet ods; - application/vnd.oasis.opendocument.text odt; - application/vnd.openxmlformats-officedocument.presentationml.presentation - pptx; - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - xlsx; - application/vnd.openxmlformats-officedocument.wordprocessingml.document - docx; - application/vnd.wap.wmlc wmlc; - application/wasm wasm; - application/x-7z-compressed 7z; - application/x-cocoa cco; - application/x-java-archive-diff jardiff; - application/x-java-jnlp-file jnlp; - application/x-makeself run; - application/x-perl pl pm; - application/x-pilot prc pdb; - application/x-rar-compressed rar; - application/x-redhat-package-manager rpm; - application/x-sea sea; - application/x-shockwave-flash swf; - application/x-stuffit sit; - application/x-tcl tcl tk; - application/x-x509-ca-cert der pem crt; - application/x-xpinstall xpi; - application/xhtml+xml xhtml; - application/xslt+xml xsl xslt; - application/xspf+xml xspf; - application/zip zip; - - application/octet-stream bin exe dll; - application/octet-stream deb; - application/octet-stream dmg; - application/octet-stream iso img; - application/octet-stream msi msp msm; - - audio/midi mid midi kar; - audio/mpeg mp3; - audio/ogg ogg; - audio/x-m4a m4a; - audio/x-realaudio ra; - - video/3gpp 3gpp 3gp; - video/mp2t ts; - video/mp4 mp4; - video/mpeg mpeg mpg; - video/ogg ogv; - video/quicktime mov; - video/webm webm; - video/x-flv flv; - video/x-m4v m4v; - video/x-matroska mkv; - video/x-mng mng; - video/x-ms-asf asx asf; - video/x-ms-wmv wmv; - video/x-msvideo avi; -} diff --git a/debian/conf/nginx.conf b/debian/conf/nginx.conf deleted file mode 100644 index 68a8fd4..0000000 --- a/debian/conf/nginx.conf +++ /dev/null @@ -1,84 +0,0 @@ -user www-data; -worker_processes auto; -worker_cpu_affinity auto; -pid /run/nginx.pid; -error_log /var/log/nginx/error.log; -include /etc/nginx/modules-enabled/*.conf; - -events { - worker_connections 768; - # multi_accept on; -} - -http { - - ## - # Basic Settings - ## - - sendfile on; - tcp_nopush on; - types_hash_max_size 2048; - server_tokens off; # Recommended practice is to turn this off - - # server_names_hash_bucket_size 64; - # server_name_in_redirect off; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - ## - # SSL Settings - ## - - ssl_protocols TLSv1.2 TLSv1.3; # Dropping SSLv3 (POODLE), TLS 1.0, 1.1 - ssl_prefer_server_ciphers off; # Don't force server cipher order. - - ## - # Logging Settings - ## - - access_log /var/log/nginx/access.log; - - ## - # Gzip Settings - ## - - gzip on; - - # gzip_vary on; - # gzip_proxied any; - # gzip_comp_level 6; - # gzip_buffers 16 8k; - # gzip_http_version 1.1; - # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - - ## - # Virtual Host Configs - ## - - include /etc/nginx/conf.d/*.conf; - include /etc/nginx/sites-enabled/*; -} - - -#mail { -# # See sample authentication script at: -# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript -# -# # auth_http localhost/auth.php; -# # pop3_capabilities "TOP" "USER"; -# # imap_capabilities "IMAP4rev1" "UIDPLUS"; -# -# server { -# listen localhost:110; -# protocol pop3; -# proxy on; -# } -# -# server { -# listen localhost:143; -# protocol imap; -# proxy on; -# } -#} diff --git a/debian/conf/proxy_params b/debian/conf/proxy_params deleted file mode 100644 index df75bc5..0000000 --- a/debian/conf/proxy_params +++ /dev/null @@ -1,4 +0,0 @@ -proxy_set_header Host $http_host; -proxy_set_header X-Real-IP $remote_addr; -proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -proxy_set_header X-Forwarded-Proto $scheme; diff --git a/debian/conf/scgi_params b/debian/conf/scgi_params deleted file mode 100644 index 6d4ce4f..0000000 --- a/debian/conf/scgi_params +++ /dev/null @@ -1,17 +0,0 @@ - -scgi_param REQUEST_METHOD $request_method; -scgi_param REQUEST_URI $request_uri; -scgi_param QUERY_STRING $query_string; -scgi_param CONTENT_TYPE $content_type; - -scgi_param DOCUMENT_URI $document_uri; -scgi_param DOCUMENT_ROOT $document_root; -scgi_param SCGI 1; -scgi_param SERVER_PROTOCOL $server_protocol; -scgi_param REQUEST_SCHEME $scheme; -scgi_param HTTPS $https if_not_empty; - -scgi_param REMOTE_ADDR $remote_addr; -scgi_param REMOTE_PORT $remote_port; -scgi_param SERVER_PORT $server_port; -scgi_param SERVER_NAME $server_name; diff --git a/debian/conf/sites-available/default b/debian/conf/sites-available/default deleted file mode 100644 index c5af914..0000000 --- a/debian/conf/sites-available/default +++ /dev/null @@ -1,91 +0,0 @@ -## -# You should look at the following URL's in order to grasp a solid understanding -# of Nginx configuration files in order to fully unleash the power of Nginx. -# https://www.nginx.com/resources/wiki/start/ -# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ -# https://wiki.debian.org/Nginx/DirectoryStructure -# -# In most cases, administrators will remove this file from sites-enabled/ and -# leave it as reference inside of sites-available where it will continue to be -# updated by the nginx packaging team. -# -# This file will automatically load configuration files provided by other -# applications, such as Drupal or Wordpress. These applications will be made -# available underneath a path with that package name, such as /drupal8. -# -# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. -## - -# Default server configuration -# -server { - listen 80 default_server; - listen [::]:80 default_server; - - # SSL configuration - # - # listen 443 ssl default_server; - # listen [::]:443 ssl default_server; - # - # Note: You should disable gzip for SSL traffic. - # See: https://bugs.debian.org/773332 - # - # Read up on ssl_ciphers to ensure a secure configuration. - # See: https://bugs.debian.org/765782 - # - # Self signed certs generated by the ssl-cert package - # Don't use them in a production server! - # - # include snippets/snakeoil.conf; - - root /var/www/html; - - # Add index.php to the list if you are using PHP - index index.html index.htm index.nginx-debian.html; - - server_name _; - - location / { - # First attempt to serve request as file, then - # as directory, then fall back to displaying a 404. - try_files $uri $uri/ =404; - } - - # pass PHP scripts to FastCGI server - # - #location ~ \.php$ { - # include snippets/fastcgi-php.conf; - # - # # With php-fpm (or other unix sockets): - # fastcgi_pass unix:/run/php/php7.4-fpm.sock; - # # With php-cgi (or other tcp sockets): - # fastcgi_pass 127.0.0.1:9000; - #} - - # deny access to .htaccess files, if Apache's document root - # concurs with nginx's one - # - #location ~ /\.ht { - # deny all; - #} -} - - -# Virtual Host configuration for example.com -# -# You can move that to a different file under sites-available/ and symlink that -# to sites-enabled/ to enable it. -# -#server { -# listen 80; -# listen [::]:80; -# -# server_name example.com; -# -# root /var/www/example.com; -# index index.html; -# -# location / { -# try_files $uri $uri/ =404; -# } -#} diff --git a/debian/conf/snippets/fastcgi-php.conf b/debian/conf/snippets/fastcgi-php.conf deleted file mode 100644 index 467a9e7..0000000 --- a/debian/conf/snippets/fastcgi-php.conf +++ /dev/null @@ -1,13 +0,0 @@ -# regex to split $uri to $fastcgi_script_name and $fastcgi_path -fastcgi_split_path_info ^(.+?\.php)(/.*)$; - -# Check that the PHP script exists before passing it -try_files $fastcgi_script_name =404; - -# Bypass the fact that try_files resets $fastcgi_path_info -# see: http://trac.nginx.org/nginx/ticket/321 -set $path_info $fastcgi_path_info; -fastcgi_param PATH_INFO $path_info; - -fastcgi_index index.php; -include fastcgi.conf; diff --git a/debian/conf/snippets/snakeoil.conf b/debian/conf/snippets/snakeoil.conf deleted file mode 100644 index ad26c3e..0000000 --- a/debian/conf/snippets/snakeoil.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Self signed certificates generated by the ssl-cert package -# Don't use them in a production server! - -ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; -ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; diff --git a/debian/conf/uwsgi_params b/debian/conf/uwsgi_params deleted file mode 100644 index 09c732c..0000000 --- a/debian/conf/uwsgi_params +++ /dev/null @@ -1,17 +0,0 @@ - -uwsgi_param QUERY_STRING $query_string; -uwsgi_param REQUEST_METHOD $request_method; -uwsgi_param CONTENT_TYPE $content_type; -uwsgi_param CONTENT_LENGTH $content_length; - -uwsgi_param REQUEST_URI $request_uri; -uwsgi_param PATH_INFO $document_uri; -uwsgi_param DOCUMENT_ROOT $document_root; -uwsgi_param SERVER_PROTOCOL $server_protocol; -uwsgi_param REQUEST_SCHEME $scheme; -uwsgi_param HTTPS $https if_not_empty; - -uwsgi_param REMOTE_ADDR $remote_addr; -uwsgi_param REMOTE_PORT $remote_port; -uwsgi_param SERVER_PORT $server_port; -uwsgi_param SERVER_NAME $server_name; diff --git a/debian/conf/win-utf b/debian/conf/win-utf deleted file mode 100644 index 774fd9f..0000000 --- a/debian/conf/win-utf +++ /dev/null @@ -1,125 +0,0 @@ -# This map is not a full windows-1251 <> utf8 map: it does not -# contain Serbian and Macedonian letters. If you need a full map, -# use contrib/unicode2nginx/win-utf map instead. - -charset_map windows-1251 utf-8 { - - 82 E2809A; # single low-9 quotation mark - - 84 E2809E; # double low-9 quotation mark - 85 E280A6; # ellipsis - 86 E280A0; # dagger - 87 E280A1; # double dagger - 88 E282AC; # euro - 89 E280B0; # per mille - - 91 E28098; # left single quotation mark - 92 E28099; # right single quotation mark - 93 E2809C; # left double quotation mark - 94 E2809D; # right double quotation mark - 95 E280A2; # bullet - 96 E28093; # en dash - 97 E28094; # em dash - - 99 E284A2; # trade mark sign - - A0 C2A0; #   - A1 D18E; # capital Byelorussian short U - A2 D19E; # small Byelorussian short u - - A4 C2A4; # currency sign - A5 D290; # capital Ukrainian soft G - A6 C2A6; # borken bar - A7 C2A7; # section sign - A8 D081; # capital YO - A9 C2A9; # (C) - AA D084; # capital Ukrainian YE - AB C2AB; # left-pointing double angle quotation mark - AC C2AC; # not sign - AD C2AD; # soft hypen - AE C2AE; # (R) - AF D087; # capital Ukrainian YI - - B0 C2B0; # ° - B1 C2B1; # plus-minus sign - B2 D086; # capital Ukrainian I - B3 D196; # small Ukrainian i - B4 D291; # small Ukrainian soft g - B5 C2B5; # micro sign - B6 C2B6; # pilcrow sign - B7 C2B7; # · - B8 D191; # small yo - B9 E28496; # numero sign - BA D194; # small Ukrainian ye - BB C2BB; # right-pointing double angle quotation mark - - BF D197; # small Ukrainian yi - - C0 D090; # capital A - C1 D091; # capital B - C2 D092; # capital V - C3 D093; # capital G - C4 D094; # capital D - C5 D095; # capital YE - C6 D096; # capital ZH - C7 D097; # capital Z - C8 D098; # capital I - C9 D099; # capital J - CA D09A; # capital K - CB D09B; # capital L - CC D09C; # capital M - CD D09D; # capital N - CE D09E; # capital O - CF D09F; # capital P - - D0 D0A0; # capital R - D1 D0A1; # capital S - D2 D0A2; # capital T - D3 D0A3; # capital U - D4 D0A4; # capital F - D5 D0A5; # capital KH - D6 D0A6; # capital TS - D7 D0A7; # capital CH - D8 D0A8; # capital SH - D9 D0A9; # capital SHCH - DA D0AA; # capital hard sign - DB D0AB; # capital Y - DC D0AC; # capital soft sign - DD D0AD; # capital E - DE D0AE; # capital YU - DF D0AF; # capital YA - - E0 D0B0; # small a - E1 D0B1; # small b - E2 D0B2; # small v - E3 D0B3; # small g - E4 D0B4; # small d - E5 D0B5; # small ye - E6 D0B6; # small zh - E7 D0B7; # small z - E8 D0B8; # small i - E9 D0B9; # small j - EA D0BA; # small k - EB D0BB; # small l - EC D0BC; # small m - ED D0BD; # small n - EE D0BE; # small o - EF D0BF; # small p - - F0 D180; # small r - F1 D181; # small s - F2 D182; # small t - F3 D183; # small u - F4 D184; # small f - F5 D185; # small kh - F6 D186; # small ts - F7 D187; # small ch - F8 D188; # small sh - F9 D189; # small shch - FA D18A; # small hard sign - FB D18B; # small y - FC D18C; # small soft sign - FD D18D; # small e - FE D18E; # small yu - FF D18F; # small ya -} diff --git a/debian/control b/debian/control deleted file mode 100644 index 47749f4..0000000 --- a/debian/control +++ /dev/null @@ -1,311 +0,0 @@ -Source: nginx -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš -Build-Depends: debhelper-compat (= 13), - libexpat-dev, - libgd-dev, - libgeoip-dev, - libpcre2-dev, - libperl-dev, - libssl-dev, - libxslt1-dev, - po-debconf, - zlib1g-dev -Standards-Version: 4.7.0 -Homepage: https://nginx.org -Vcs-Git: https://salsa.debian.org/nginx-team/nginx.git -Vcs-Browser: https://salsa.debian.org/nginx-team/nginx -Rules-Requires-Root: no - -Package: nginx -Architecture: any -Depends: ${misc:Depends}, - ${shlibs:Depends}, - iproute2, - nginx-common (= ${source:Version}), -Breaks: nginx-light (<< 1.22.1-6~), nginx-extras (<< 1.22.1-6~), nginx-core (<< 1.22.1-6~), -Replaces: nginx-light (<< 1.22.1-6~), nginx-extras (<< 1.22.1-6~), nginx-core (<< 1.22.1-6~), -Provides: httpd, httpd-cgi, ${nginx:abi} -Description: small, powerful, scalable web/proxy server - Nginx ("engine X") is a high-performance web and reverse proxy server - created by Igor Sysoev. It can be used both as a standalone web server - and as a proxy to reduce the load on back-end HTTP or mail servers. - -Package: nginx-doc -Architecture: all -Multi-Arch: foreign -Section: doc -Depends: ${misc:Depends} -Description: small, powerful, scalable web/proxy server - documentation - Nginx ("engine X") is a high-performance web and reverse proxy server - created by Igor Sysoev. It can be used both as a standalone web server - and as a proxy to reduce the load on back-end HTTP or mail servers. - . - This package provides extra documentation to help unleash the power of Nginx. - -Package: nginx-common -Breaks: nginx (<< 1.22.1-8) -Replaces: nginx (<< 1.22.1-8) -Architecture: all -Multi-Arch: foreign -Depends: ${misc:Depends} -Suggests: fcgiwrap, nginx-doc, ssl-cert -Description: small, powerful, scalable web/proxy server - common files - Nginx ("engine X") is a high-performance web and reverse proxy server - created by Igor Sysoev. It can be used both as a standalone web server - and as a proxy to reduce the load on back-end HTTP or mail servers. - . - This package contains base configuration files used by all versions of - nginx. - -Package: nginx-dev -Architecture: all -Multi-Arch: foreign -Depends: ${misc:Depends}, ${S:Build-Depends}, - ${nginx:abi}, - nginx (<< ${source:Version}.1~), - nginx (>= ${source:Version}), -Provides: dh-sequence-nginx -Description: nginx web/proxy server - development headers - Nginx ("engine X") is a high-performance web and reverse proxy server - created by Igor Sysoev. It can be used both as a standalone web server - and as a proxy to reduce the load on back-end HTTP or mail servers. - . - This package provides development headers and necessary config scripts - for the nginx web/proxy server, useful to develop and link third party - additions to the Debian nginx web/proxy server packages. - -Package: nginx-core -Architecture: all -Depends: libnginx-mod-http-geoip (>= ${source:Version}), - libnginx-mod-http-geoip (<< ${source:Version}.1~), - libnginx-mod-http-image-filter (>= ${source:Version}), - libnginx-mod-http-image-filter (<< ${source:Version}.1~), - libnginx-mod-http-xslt-filter (>= ${source:Version}), - libnginx-mod-http-xslt-filter (<< ${source:Version}.1~), - libnginx-mod-mail (>= ${source:Version}), - libnginx-mod-mail (<< ${source:Version}.1~), - libnginx-mod-stream (>= ${source:Version}), - libnginx-mod-stream (<< ${source:Version}.1~), - libnginx-mod-stream-geoip (>= ${source:Version}), - libnginx-mod-stream-geoip (<< ${source:Version}.1~), - nginx (>= ${source:Version}), - nginx (<< ${source:Version}.1~), - ${misc:Depends}, - ${shlibs:Depends} -Breaks: nginx-full (<< 1.18.0-1), -Replaces: nginx-full (<< 1.18.0-1), -Description: nginx web/proxy server (standard version) - Nginx ("engine X") is a high-performance web and reverse proxy server - created by Igor Sysoev. It can be used both as a standalone web server - and as a proxy to reduce the load on back-end HTTP or mail servers. - . - This metapackage provides a version of nginx identical to that of nginx-full, - but without any third-party modules, and only modules in the original - nginx code base. - . - STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser, Empty - GIF, FastCGI, Geo, Limit Connections, Limit Requests, Map, Memcached, Proxy, - Referer, Rewrite, SCGI, Split Clients, UWSGI. - . - OPTIONAL HTTP MODULES: Addition, Auth Request, Charset, WebDAV, GeoIP, Gunzip, - Gzip, Gzip Precompression, Headers, HTTP/2, Image Filter, Index, Log, Real IP, - Slice, SSI, SSL, SSL Preread, Stub Status, Substitution, Thread Pool, - Upstream, User ID, XSLT. - . - OPTIONAL MAIL MODULES: Mail Core, Auth HTTP, Proxy, SSL, IMAP, POP3, SMTP. - . - OPTIONAL STREAM MODULES: Stream Core, GeoIP - -Package: nginx-full -Architecture: all -Depends: libnginx-mod-http-auth-pam, - libnginx-mod-http-dav-ext, - libnginx-mod-http-echo, - libnginx-mod-http-geoip2, - libnginx-mod-http-subs-filter, - libnginx-mod-http-upstream-fair, - libnginx-mod-stream-geoip2, - nginx (>= ${source:Version}), - nginx (<< ${source:Version}.1~), - ${misc:Depends}, - ${shlibs:Depends} -Description: nginx web/proxy server (standard version with 3rd parties) - Nginx ("engine X") is a high-performance web and reverse proxy server - created by Igor Sysoev. It can be used both as a standalone web server - and as a proxy to reduce the load on back-end HTTP or mail servers. - . - This metapackage provides a version of nginx with the complete set of - standard modules included (but omitting some of those included in - nginx-extras). - . - STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser, Empty - GIF, FastCGI, Geo, Limit Connections, Limit Requests, Map, Memcached, Proxy, - Referer, Rewrite, SCGI, Split Clients, UWSGI. - . - OPTIONAL HTTP MODULES: Addition, Auth Request, Charset, WebDAV, GeoIP, Gunzip, - Gzip, Gzip Precompression, Headers, HTTP/2, Image Filter, Index, Log, Real IP, - Slice, SSI, SSL, Stream, SSL Preread, Stub Status, Substitution, Thread Pool, - Upstream, User ID, XSLT. - . - OPTIONAL MAIL MODULES: Mail Core, Auth HTTP, Proxy, SSL, IMAP, POP3, SMTP. - . - OPTIONAL STREAM MODULES: Stream Core, GeoIP, GeoIP2 - . - THIRD PARTY MODULES: Auth PAM, DAV Ext, Echo, GeoIP2, HTTP Substitutions - Upstream Fair Queue. - -Package: nginx-light -Architecture: all -Depends: libnginx-mod-http-echo, - nginx (>= ${source:Version}), - nginx (<< ${source:Version}.1~), - ${misc:Depends}, - ${shlibs:Depends} -Description: nginx web/proxy server (basic version) - Nginx ("engine X") is a high-performance web and reverse proxy server - created by Igor Sysoev. It can be used both as a standalone web server - and as a proxy to reduce the load on back-end HTTP or mail servers. - . - This metapackage provides a very light version of nginx with only the - minimal set of features and modules. - . - STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Empty GIF, - FastCGI, Map, Proxy, Rewrite, SCGI, uWSGI. - . - OPTIONAL HTTP MODULES: Auth Request, Charset, Gzip, Gzip Precompression, - Headers, HTTP/2, Index, Log, Real IP, Slice, SSI, SSL, Stub Status, Thread - Pool, WebDAV, Upstream. - . - THIRD PARTY MODULES: Echo. - -Package: nginx-extras -Architecture: any -Depends: nginx (= ${binary:Version}), - libnginx-mod-http-geoip (= ${binary:Version}), - libnginx-mod-http-image-filter (= ${binary:Version}), - libnginx-mod-http-perl (= ${binary:Version}), - libnginx-mod-http-xslt-filter (= ${binary:Version}), - libnginx-mod-mail (= ${binary:Version}), - libnginx-mod-stream (= ${binary:Version}), - libnginx-mod-stream-geoip (= ${binary:Version}), - libnginx-mod-http-auth-pam, - libnginx-mod-http-cache-purge, - libnginx-mod-http-dav-ext, - libnginx-mod-http-echo, - libnginx-mod-http-fancyindex, - libnginx-mod-http-geoip2, - libnginx-mod-http-headers-more-filter, - libnginx-mod-http-lua [amd64 arm64 armel armhf i386 mips64el mipsel s390x riscv64 powerpc], - libnginx-mod-http-subs-filter, - libnginx-mod-http-uploadprogress, - libnginx-mod-http-upstream-fair, - libnginx-mod-nchan, - libnginx-mod-stream-geoip2, - ${misc:Depends}, - ${shlibs:Depends} -Description: nginx web/proxy server (extended version) - Nginx ("engine X") is a high-performance web and reverse proxy server - created by Igor Sysoev. It can be used both as a standalone web server - and as a proxy to reduce the load on back-end HTTP or mail servers. - . - This metapackage provides a version of nginx with the standard modules, plus - extra features and modules such as the Perl module, which allows the - addition of Perl in configuration files. - . - STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser, Empty - GIF, FastCGI, Geo, Limit Connections, Limit Requests, Map, Memcached, Proxy, - Referer, Rewrite, SCGI, Split Clients, UWSGI. - . - OPTIONAL HTTP MODULES: Addition, Auth Request, Charset, WebDAV, FLV, GeoIP, - Gunzip, Gzip, Gzip Precompression, Headers, HTTP/2, Image Filter, Index, Log, - MP4, Embedded Perl, Random Index, Real IP, Slice, Secure Link, SSI, SSL, - SSL Preread, Stub Status, Substitution, Thread Pool, Upstream, User ID, XSLT. - . - OPTIONAL MAIL MODULES: Mail Core, Auth HTTP, Proxy, SSL, IMAP, POP3, SMTP. - . - OPTIONAL STREAM MODULES: Stream, GeoIP, GeoIP2 - . - THIRD PARTY MODULES: Auth PAM, Cache Purge, DAV Ext, Echo, Fancy Index, - GeoIP2, Headers More, Embedded Lua, HTTP Substitutions, Nchan, Upload Progress, - Upstream Fair Queue. - -Package: libnginx-mod-http-geoip -Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends}, -Recommends: nginx, -Description: GeoIP HTTP module for Nginx - The ngx_http_geoip module creates variables with values depending on the - client IP address, using the precompiled MaxMind databases. - . - Those variables include country, region, city, latitude, longitude, postal - code, etc. - -Package: libnginx-mod-http-image-filter -Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends}, -Recommends: nginx, -Description: HTTP image filter module for Nginx - The ngx_http_image_filter module is a filter that transforms images in JPEG, - GIF, and PNG formats. - . - The module supports filters such as rotate, resize, crop, quality, sharpening, - interlacing and more. - -Package: libnginx-mod-http-xslt-filter -Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends}, -Recommends: nginx, -Description: XSLT Transformation module for Nginx - The ngx_http_xslt_filter module is a filter that transforms XML responses - using one or more XSLT stylesheets. - . - The transformation can be adjusted by setting the relevant configuration - parameters. - -Package: libnginx-mod-mail -Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends}, -Recommends: nginx, -Description: Mail module for Nginx - The nginx_mail module adds mail proxy support to nginx. - . - The module supports proxying all the standard mail protocols such as IMAP, - POP3 & SMTP. - -Package: libnginx-mod-stream -Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends}, -Recommends: nginx, -Description: Stream module for Nginx - The nginx_stream module adds stream proxy support to nginx. - . - Stream module supports loadbalancing & proxying to TCP servers. The module - also supports ACLs/connection limiting and configuring multiple operational - parameters. - -Package: libnginx-mod-stream-geoip -Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends}, - libnginx-mod-stream (= ${binary:Version}), -Recommends: nginx, -Description: GeoIP Stream module for Nginx - The ngx_stream_geoip module creates variables with values depending on the - client IP address, using the precompiled MaxMind databases. - . - Those variables include country, region, city, latitude, longitude, postal - code, etc. - -Package: libnginx-mod-http-perl -Architecture: any -Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}, -Recommends: nginx, -Description: Perl module for Nginx - Embed Perl runtime into nginx. - . - The ngx_http_perl module is used to implement location and variable handlers - in Perl and insert Perl calls into SSI. - . - Note that this module is marked experimental. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 0536a8c..0000000 --- a/debian/copyright +++ /dev/null @@ -1,136 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: nginx -Source: https://nginx.org/en/download.html - -Files: * -Copyright: Valentin V. Bartenev - Ruslan Ermilov - Roman Arutyunyan - Maxim Dounin - 2011-2024, Nginx, Inc. - 2002-2021, Igor Sysoev -License: BSD-2-clause - -Files: contrib/geo2nginx.pl -Copyright: 2005, Andrei Nigmatulin -License: BSD-2-clause - -Files: debian/* -Copyright: 2022-2025, Jan Mojžíš - 2020-2022, Ondřej Nový - 2019-2022, Thomas Ward - 2013-2016, Christos Trochalakis - 2011-2013, Cyril Lavier - 2011, Dmitry E. Oboukhov - 2010-2014, Michael Lustfield - 2009-2014, Kartik Mistry - 2008, Jose Parrella - 2007-2009, Fabio Tranchitella -License: BSD-2-clause - -Files: debian/apport/* -Copyright: 2015, Thomas Ward -License: BSD-2-clause - -Files: debian/debhelper/* -Copyright: 2022, Miao Wang -License: Expat - -Files: debian/debhelper/dh_nginx -Copyright: 2016, Christos Trochalakis -License: GPL-2+ - -Files: debian/ngx-conf/ngx-conf -Copyright: 2015, Michael Lustfield -License: Expat - -Files: man/* -Copyright: Nginx, Inc. - 2010, 2019, Sergey A. Osokin -License: BSD-2-clause - -Files: src/core/ngx_murmurhash.c -Copyright: Austin Appleby -License: public-domain - All MurmurHash versions are public domain software, and the author - disclaims all copyright to their code. - -Files: src/http/modules/ngx_http_scgi_module.c -Copyright: Nginx, Inc. - Manlio Perillo (manlio.perillo@gmail.com) - Igor Sysoev -License: BSD-2-clause - -Files: src/http/modules/ngx_http_uwsgi_module.c -Copyright: Nginx, Inc. - Igor Sysoev - 2009, 2010, Unbit S.a.s. - 2008, Manlio Perillo (manlio.perillo@gmail.com) -License: BSD-2-clause - -Files: src/http/ngx_http_huff_encode.c -Copyright: Valentin V. Bartenev - Nginx, Inc. - 2015, Vlad Krasnov -License: BSD-2-clause - -Files: src/stream/ngx_stream_set_module.c -Copyright: Pavel Pautov - Nginx, Inc. -License: BSD-2-clause - -License: BSD-2-clause - All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - . - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -License: Expat - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - . - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - -License: GPL-2+ - This is free software, licensed under: - . - The GNU General Public License, Version 2, June 1991 - . - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 dated June, 1991, or (at - your option) any later version. - On Debian systems, the complete text of version 2 of the GNU General - Public License can be found in '/usr/share/common-licenses/GPL-2'. diff --git a/debian/debhelper/dh_nginx b/debian/debhelper/dh_nginx deleted file mode 100755 index 9100220..0000000 --- a/debian/debhelper/dh_nginx +++ /dev/null @@ -1,334 +0,0 @@ -#! /usr/bin/perl - -# dh_nginx - Nginx configuration helper -# Copyright (C) 2016 Christos Trochalakis -# -# This program is licensed under the terms of the GNU General -# Public License veserion 2+ -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -use strict; -use File::Find; -use Debian::Debhelper::Dh_Lib; -use Dpkg::Substvars; - -=head1 NAME - -dh_nginx - register configuration snippets to the nginx web server - -=cut -my $nginx_in_tree; -my $abi; -sub nginx_depends -{ - if (!$abi) { - my $sv = Dpkg::Substvars->new(); - if ($nginx_in_tree) { - $sv->load("debian/libnginx-mod.abisubstvars"); - } - else { - $sv->load("/usr/share/nginx/src/debian/libnginx-mod.abisubstvars"); - } - $abi = $sv->get("nginx:abi"); - } - return "$abi"; -} - -sub nginx_api_installdir -{ - return "/usr/lib/nginx/modules/"; -} - -sub nginx_modules_conf_installdir -{ - return "usr/share/nginx/modules-available/" -} - -=head1 SYNOPSIS - -B [S>] [B<-n>|B<--noscripts>] [B<--in-nginx-tree>] - -=head1 DESCRIPTION - -B is a debhelper program that is responsible for correctly installing -Nginx configuration snippets and setting postinst, prerm and dependencies in -Nginx web server modules and web applications. - -It supports the following configuration types - -=over 4 - -=item * -Nginx modules - -=back - -=head1 INVOCATION - - %: - dh $@ --with nginx - -=head1 FILES - -=over 4 - -=item debian/I.nginx - -=item debian/nginx - -=back - -Lists files to be registered with the Nginx HTTP server. The file is -interpreted as line separated list of installation stanzas, where each entry -consists of whitespace separated values conforming to the file semantics below. - -When this file is missing but the name of the package looks like a nginx module, -the module load file and its loading priority is automatically generated inferring -from the package name. In this case, IB<.install> or other mechanisms -should be used for copying the B<.so> library into the correct place. - -=head2 FILE SEMANTICS - -Each line consists of a triple - -I I [I] - -where the values are interpreted as follows: - - -=head3 I - -Denotes the type of file to be installed. Recognized values are B for -Nginx modules. - -=head3 I - -Is interpreted as existing file name within the source package. No path -expansion is effectuated. Just like L, B can not -rename files. - -=head3 I - -Is inrerpreted as optional arguments if any, currently not used. - -=head2 MODULES - -Modules are handled specially and are determined by the B type. Modules must -have a I<.conf> suffix. In that case the file is interpreted as module load -file and is installed to I. If the file is ending -with a I<.so> suffix it is interpreted as actual module shared object and is -installed to the Nginx module directory, an optional numeric priority can be -set as the last argument to handle module dependencies. - -=head1 OPTIONS - -=over 4 - -=item B<-e>, B<--noenable> - -Install maintainer scripts accordingly, but do not enable the scripts or -configuration by default. - -=item B<-n>, B<--noscripts> - -Do not modify F/F/F maintainer scripts. - -=item B<--in-nginx-tree> - -Specify this option when building in-tree modules along with nginx. When -specified, nginx abi version is not required in package name. - -=back - -=head1 NOTES - -Note that this command is not idempotent. L should be called -between invocations of this command. Otherwise, it may cause multiple -instances of the same text to be added to maintainer scripts. - -=head1 AUTHOR - -This manual and L was written by Christos Trochalakis. -dh_nginx is heavily influnced by dh_apache2 written by Arno Toell -. - -=cut - - -## -## main code starts here -## - -init(options => { - "e|noenable" => \$dh{NOENABLE}, - "in-nginx-tree" => \$nginx_in_tree, -}); - -foreach my $package ((@{$dh{DOPACKAGES}})) -{ - my %PACKAGE_TYPE = ( - has_a_module => [], - ); - - my $file = pkgfile($package, "nginx"); - my $tmp = tmpdir($package); - my $installdir = $tmp . "/" . nginx_modules_conf_installdir(); - my $modinstalldir = $tmp . "/" . nginx_api_installdir(); - - if ($file){ - my @files_to_register = filedoublearray($file, ".") if $file; - foreach my $line (@files_to_register) - { - my $type = lc(shift @{$line}) if $line->[0]; - my $source = shift @{$line} if $line->[0]; - my @arguments = @{$line}; - my $destination; - - $type = "modules" if $type eq "mod"; - - verbose_print("$type -- $source -- @arguments\n\n"); - - if ($type eq "modules") - { - my $basesource = basename($source); - - if ($type eq "modules") - { - if ($basesource =~ m/\.conf$/) - { - my $enablename = $basesource; - my $prio = $#arguments >= 0 ? $arguments[0] : 50; - $destination = "$prio-$basesource"; - push @{$PACKAGE_TYPE{'has_a_module'}}, "$enablename:$destination"; - verbose_print("Installing module configuration $enablename into $installdir prio:$prio\n"); - } - elsif ($basesource =~ m/\.so$/) - { - verbose_print("Installing module binary $source into $modinstalldir\n"); - if (! -d $modinstalldir) - { - complex_doit("mkdir","-p", $modinstalldir); - complex_doit("chmod","755","$modinstalldir"); - } - complex_doit("cp", $source, $modinstalldir); - next; - } - - # TODO - error("module: \"$basesource\" needs .conf, .so or suffix") if $basesource !~ m/\.(conf|so)/; - } - - if (! -d $installdir) - { - complex_doit("mkdir","-p",$installdir); - complex_doit("chmod","755","$installdir"); - } - complex_doit("cp",$source,$installdir); - complex_doit("chmod","644","$installdir/$basesource"); - - } - else - { - error("Unknown parameter: $type\n"); - } - - } - } elsif ($package =~ /^libnginx-mod-/){ - verbose_print("$package might be a nginx module\n"); - - my $module = $package; - $module =~ s/^libnginx-mod-//; - verbose_print("Guessed module name: $module\n"); - - my $modulepath = $module; - $modulepath =~ s/-/_/g; - - if (-e "$modinstalldir/ngx_${modulepath}_module.so"){ - my $prio = 50; - if ($module =~ /^\w+-/ && !($module =~ /^http-/) ){ - $prio = 70; - } - verbose_print("Guessed load priority: $prio\n"); - - my $conf_name = "mod-$module.conf"; - install_dir($installdir); - verbose_print("Installing module configuration $conf_name into $installdir prio:$prio\n"); - open(MOD_CONF, $dh{NO_ACT} ? ">&STDERR" : ">$installdir/$conf_name") or error("open($installdir/$conf_name): $!"); - print(MOD_CONF "load_module modules/ngx_${modulepath}_module.so;\n"); - close(MOD_CONF); - chmod(0644, "$installdir/$conf_name") or error("chmod(0644, $installdir/$conf_name): $!"); - push @{$PACKAGE_TYPE{'has_a_module'}}, "$conf_name:$prio-$conf_name"; - } else { - verbose_print("$package is not a nginx module because $modinstalldir/ngx_${modulepath}_module.so not found"); - verbose_print("If it is not correct, check if the module is installed before invoking this script"); - } - } - - my @postinst_autoscripts; - - if ($#{$PACKAGE_TYPE{'has_a_module'}} >= 0) - { - if ($package !~ m/libnginx-mod-\w+?/) - { - warning("Package $package appears to be an Nginx module. It should comply to the package naming scheme libnginx-mod-\n"); - } - addsubstvar($package, "misc:Depends", nginx_depends()); - - my $modules = ""; - foreach my $module (@{$PACKAGE_TYPE{'has_a_module'}}) - { - $modules .= "$module "; - } - - push @postinst_autoscripts, ["module", $modules]; - } - - if (! $dh{NOSCRIPTS}) - { - foreach my $ref (@postinst_autoscripts) - { - for my $script_type (qw/postinst prerm postrm/) - { - if ($script_type eq "postinst" && $dh{NOENABLE}) - { - next - } - - my %replacements = ( - NAMES => $ref->[1], - ); - - my $sed_command = ""; - foreach my $key (sort keys %replacements) - { - my $val = $replacements{$key}; - # Use a control char as separator for sed, to - # reduce escaping issues. Everything else is - # passed verbatim, i.e. it must not contain any - # shell or sed special characters. - my $sep = "\x17"; - $sed_command .= "s" . $sep . "#$key#" . - $sep . $val . - $sep . "g; "; - } - - autoscript($package, "$script_type", "$script_type-nginx", $sed_command); - } - } - } -} - -# vim: syntax=perl sw=8 sts=8 sr noet diff --git a/debian/debhelper/nginx.pm b/debian/debhelper/nginx.pm deleted file mode 100644 index 0e41120..0000000 --- a/debian/debhelper/nginx.pm +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use Debian::Debhelper::Dh_Lib; - -add_command_options( "dh_auto_test", "--buildsystem=nginx_mod" ); -add_command_options( "dh_auto_configure", "--buildsystem=nginx_mod" ); -add_command_options( "dh_auto_build", "--buildsystem=nginx_mod" ); -add_command_options( "dh_auto_install", "--buildsystem=nginx_mod" ); -add_command_options( "dh_auto_clean", "--buildsystem=nginx_mod" ); - -insert_after("dh_install", "dh_nginx"); - -1; diff --git a/debian/debhelper/nginx_mod.pm b/debian/debhelper/nginx_mod.pm deleted file mode 100644 index 1b1ecaf..0000000 --- a/debian/debhelper/nginx_mod.pm +++ /dev/null @@ -1,138 +0,0 @@ -# A build system class for handling nginx modules. -# -# Copyright: © 2022 Miao Wang -# License: MIT - -package Debian::Debhelper::Buildsystem::nginx_mod; - -use strict; -use warnings; -use Dpkg::Deps qw(deps_parse); -use Dpkg::Control::Info; -use Debian::Debhelper::Dh_Lib qw(error doit getpackages addsubstvar); -use File::Spec; -use parent qw(Debian::Debhelper::Buildsystem::makefile); -use Config; - -sub DESCRIPTION { - "Nginx Module (config)" -} - -sub check_auto_buildable { - my ($this, $step) = @_; - - return 1 if -e $this->get_sourcepath("config"); -} - -sub _NGINX_SRC_DIR { - "/usr/share/nginx/src" -} - -sub _NDK_SRC_DIR { - "/usr/share/nginx-ndk/src" -} - -sub new { - my $class=shift; - my $this= $class->SUPER::new(@_); - my $ngx_ver = `grep 'define NGINX_VERSION' /usr/share/nginx/src/src/core/nginx.h | sed -e 's/^.*"\\(.*\\)".*/\\1/'`; - chomp($ngx_ver); - $this->prefer_out_of_source_building(@_); - $this->{has_ndk} = $this->has_build_dep("libnginx-mod-http-ndk-dev"); - $this->{has_stream} = $this->has_build_dep("libnginx-mod-stream"); - foreach my $cur (getpackages('arch')) { - if ($this->{has_ndk} == 1) { - addsubstvar($cur, "misc:Depends", "libnginx-mod-http-ndk"); - } - if ($this->{has_stream} == 1) { - addsubstvar($cur, "misc:Depends", "libnginx-mod-stream (>= $ngx_ver), libnginx-mod-stream (<< $ngx_ver.1~)"); - } - } - return $this; -} - -sub configure { - my $this=shift; - - doit({ - "chdir" => $this->_NGINX_SRC_DIR, - "update_env" => { - "src_dir" => $this->get_sourcedir, - "bld_dir" => $this->get_builddir, - "pwd_dir" => $this->{cwd}, - }, - }, "bash", "-c", '. ./conf_flags - ./configure \\ - --with-cc-opt="$(cd "$pwd_dir/$src_dir"; dpkg-buildflags --get CFLAGS) -fPIC $(cd "$pwd_dir/$src_dir"; dpkg-buildflags --get CPPFLAGS)" \\ - --with-ld-opt="$(cd "$pwd_dir/$src_dir"; dpkg-buildflags --get LDFLAGS) -fPIC" \\ - "${NGX_CONF_FLAGS[@]}" \\ - --add-dynamic-module="$pwd_dir/$src_dir" \\ - --builddir="$pwd_dir/$bld_dir" \\ - ' . ($this->{has_ndk} ? '--add-module=' . $this->_NDK_SRC_DIR : '') . ' \\ - ' . ($this->{has_stream} ? '--with-stream' : '') . ' \\ - "$@"', "dummy", @_); -} - -sub build { - my $this=shift; - - $this->do_make("-f", File::Spec->catfile($this->{cwd}, $this->get_buildpath("Makefile")), "-C", $this->_NGINX_SRC_DIR, "modules"); -} - -sub test { - my $this=shift; - - if ( $this->{has_ndk} and !grep( /^ndk_http_module.so$/, @_ ) ) { - unshift @_, "ndk_http_module.so"; - } - - if ( $this->{has_stream} and !grep( /^ngx_stream_module.so$/, @_ ) ) { - unshift @_, "ngx_stream_module.so"; - } - - $this->doit_in_builddir("bash", "-e", "-o", "pipefail", "-c", ' - tmp_conf=$(mktemp -p .) - for pre_dep in "$@"; do - echo "load_module modules/$pre_dep;" >> "$tmp_conf" - done - for i in *.so; do - echo "load_module $PWD/$i;" >> "$tmp_conf" - done - echo "events{}" >> "$tmp_conf" - /usr/sbin/nginx -g "error_log /dev/null; pid /dev/null;" -t -q -c "$PWD/$tmp_conf" - rm -f "$tmp_conf" - ', "dummy", @_); -} - -sub install { - my $this=shift; - my $destdir=shift; - - $this->doit_in_builddir("bash", "-e", "-o", "pipefail", "-c", ' - destdir=$1 - mkdir -p "$destdir/usr/lib/nginx/modules" - for i in *.so; do - cp "$i" "$destdir/usr/lib/nginx/modules/" - done - ', "dummy", $destdir); -} - -sub clean { - my $this=shift; - $this->rmdir_builddir(); -} - -sub has_build_dep { - my $this=shift; - my $bd=shift; - my $control = Dpkg::Control::Info->new()->get_source(); - my $depends = deps_parse($control->{'Build-Depends'}); - foreach (split /,\s+/,$depends) { - if ($_ =~ /$bd/) { - return 1; - } - } - return 0; -} - -1 diff --git a/debian/gbp.conf b/debian/gbp.conf deleted file mode 100644 index 44bfd7d..0000000 --- a/debian/gbp.conf +++ /dev/null @@ -1,13 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True -upstream-signatures = on - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/debian/help/docs/fcgiwrap b/debian/help/docs/fcgiwrap deleted file mode 100644 index 454d2be..0000000 --- a/debian/help/docs/fcgiwrap +++ /dev/null @@ -1,14 +0,0 @@ -## -# File: -# fcgiwrap -# Description: -# The fcgiwrap tool allows a user to quickly and painlessly setup a socket -# to handle CGI requests. This is useful for Python, Perl, etc. -## - -The easy way: -apt-get install fcgiwrap - -The less-easy way: -If your distribution does not provide it, the Nginx wiki describes the steps. -http://wiki.nginx.org/Fcgiwrap diff --git a/debian/help/docs/php b/debian/help/docs/php deleted file mode 100644 index 821dbcb..0000000 --- a/debian/help/docs/php +++ /dev/null @@ -1,119 +0,0 @@ -## -# File: -# php -# Description: -# This file is meant to help users get a basic understanding of a PHP stack -# with Nginx as the web server. -## - -# Note: This is not a configuration sample and comment lines will be userd differently. - - -== PHP Options == - -There are a number of options that can be used to provide PHP. The two most -common methods are php-cgi and php-fpm. The php-fpm option is relatively new -and is not yet a standard option. This package is stable however and is moving -toward being a standard option in distribution repositories. - -== PHP-FPM == - -The php-fpm option is considerably harder to debug. However, the hardest issues -to debug should be solved by including that fastcgi_params file provided by -this package. It should at a minimum remove all silent errors. - -# sudo apt-get install php5-fpm - -If you do not have php5-fpm available, you will want to add the repository for -the package. https://launchpad.net/~nginx/+archive/php5 - -In php5-fpm, you will want to edit the php pool. -Edit /etc/php5/fpm/pool.d/www.conf - -The listen directive is the most important piece in this file. It is suggested -to listen to a local unix socket. This listen directive will be used in your -nginx configuration. -Example: listen = /tmp/phpfpm.socket - -The rest of this file can be tweaked to your liking. - -== PHP-CGI == - -The simplest and easiest method to run PHP is to use php-cgi. It does not offer -the ability to monitor and restart processes that hang or die however. - -# sudo apt-get install php5-cgi - -To make php5-cgio work, you will need to create an init script. - -===== FILE: /etc/init.d/phpcgi ===== -#!/bin/bash -# -### BEGIN INIT INFO -# Provides: php-fcgi -# Required-Start: $local_fs $remote_fs $network $syslog -# Required-Stop: $local_fs $remote_fs $network $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: starts php-cgi processes -# Description: starts php-cgi using start-stop-daemon for each user -### END INIT INFO - -# Number of PHP processes to be able to handle connections. -CHILD=10 -# Maximum number of requests each child should handle before being regenerated -MAX_REQS=750 - -start() { - start-stop-daemon --quiet --start --background --chuid "www-data" \ - --exec /usr/bin/env \ - -- - USER="www-data" \ - PATH=/usr/bin PHP_FCGI_CHILDREN=$CHILD PHP_FCGI_MAX_REQUESTS=$MAX_REQS \ - php-cgi -b /tmp/phpcgi.socket & -} - -stop() { - killall -w php-cgi - rm /tmp/phpcgi.socket - sync - sleep 1 -} - -case "$1" in - start) start;; - stop) stop;; - restart) stop; start;; - *) echo "Usage: php-fastcgi {start|stop|restart} [user]"; exit 1;; -esac -===== END FILE ===== - -# Make file executable -chmod +x /etc/init.d/phpcgi - -# Add file to startup -update-rc.d phpcgi defaults - -== Using PHP in Nginx == - -In order to use the sockets you created (/tmp/phpfpm.socket or /tmp/phpcgi.socket) -you will need to add a php block to your Nignx configuration. - -# This block adds a little security. -# See /usr/share/doc/nginx/examples/drupal for context -location ~ \..*/.*\.php$ { - return 403; -} - -# This is basic PHP block that can be used to handle all PHP requests. -# See /usr/share/doc/nginx/examples/drupal for context -location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - include fastcgi_params; - # Intercepting errors will cause PHP errors to appear in Nginx logs - fastcgi_intercept_errors on; - fastcgi_pass unix:/tmp/phpcgi.socket; -} - -# The above example will use php5-cgi which is bound to /tmp/phpcgi.socket. -# If you choose to use php5-fpm the example above will bind to /tmp/phpcgi.socket -# instead and this should be used for fastcgi_pass instead. diff --git a/debian/help/docs/support-irc b/debian/help/docs/support-irc deleted file mode 100644 index c930b76..0000000 --- a/debian/help/docs/support-irc +++ /dev/null @@ -1,28 +0,0 @@ -## -# File: -# support-irc -# Description: -# This file explains how to get support on IRC. -## - -Nginx has a moderately active IRC channel on Freenode. - -You can get there by: - * Client - Using an IRC Client and pointing it to: - #nginx on irc.freenode.net - * Browser - Opening a web browser and pointing it to: - http://webchat.freenode.net?channels=nginx - -Common sense is expected to be followed: - * Code of Conduct - http://www.ubuntu.com/community/conduct - * IRC Etiquette - http://www.ircbeginner.com/ircinfo/etiquette.html - * Patience - If somebody doesn't answer you right away, then wait. - Even active IRC users have to run off sometimes. - -If you need more help with IRC The Linux Documentation Project has more information: - http://tldp.org/HOWTO/IRC/beginners.html diff --git a/debian/help/docs/upstream b/debian/help/docs/upstream deleted file mode 100644 index 4c2cf3e..0000000 --- a/debian/help/docs/upstream +++ /dev/null @@ -1,51 +0,0 @@ -## -# File: -# upstream -# Description: -# This file describes how to use upstream blocks. -## - -An upstream block allows you to set a list of upstream locations for both -proxy_pass and fastcgi_pass directives. - -Examples of upstream blocks: - -# PHP listening on the same server -upstream php { - # ip_hash ensures the same backend is used for client reconnects. - ip_hash; - # This assumes we have multiple PHP listeners on different known ports. - server 127.0.0.1:9000; - server 127.0.0.1:9001; - server 127.0.0.1:9002; - server 127.0.0.1:9003; - # In addition to listening on ports, we can listen to unix sockets. - server unix:/tmp/php-cgi.socket; -} - -# Multiple backend Apache instances on separate servers -upstream apache { - # Adding a weight alters the chance the upstream server will be used. - server apache1.domain.com weight 5; - server apache2.domain.com; - server apache3.domain.com; - # Adding 'down' keeps the upstream from being used. Useful for downtime management. - server apache4.domain.com down; - server apache5.domain.com; -} - -Using an upstream location: - -# Passing PHP to upstream -location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - include fastcgi_params; - fastcgi_pass php; -} - -# Passing all requests for /cgi-bin/* to Apache upstreams. -location /cgi-bin { - proxy_pass apache; -} - -For more information see http://wiki.nginx.org/HttpUpstreamModule diff --git a/debian/help/examples/drupal b/debian/help/examples/drupal deleted file mode 100644 index 7dca9e1..0000000 --- a/debian/help/examples/drupal +++ /dev/null @@ -1,114 +0,0 @@ -## -# File: -# drupal -# Description: -# This file is meant to offer a very detailed set of instructions and best -# practices for deploying a Drupal website with Nginx. This file should be -# almost drop-in if the user is able to understand the three lines that -# need to be changed. -## - -server { - - # This is the URI of your website. You can specify multiple sites to be - # served by the same Drupal installation. - server_name domain.com www.domain.com .example.net; - - # This is the root of the Drupal directory. - # Note that Drupal 6, Drupal 7, and Pressflow are interchangeable - root /var/www/drupal6; - - # In some cases a favicon does not exist but this is not something you - # normally need to worry about. It's also a microscopic image and will - # just clutter the logs. - location = /favicon.ico { - log_not_found off; - access_log off; - } - - # This is for the robots.txt file used by search engines. - location = /robots.txt { - # If you have one, you want to allow them access to it. - allow all; - # If you don't have one, you don't want to fill your logs with - # not found errors. - log_not_found off; - access_log off; - } - - # This matters if you use drush because drush copies backups of modules - # to this directory. In the event personal information wound up in the - # module, you want to know outside users can't access it. - location = /backup { - deny all; - } - - # Very rarely should these ever be accessed outside of your lan - # The above location for robots.txt is an exact match and will override - # this location block. - location ~* \.(txt|log)$ { - allow 192.168.0.0/16; - deny all; - } - - # This location block protects against a known attack. It happens if - # the attacker uploads a non-php file and attempts to run it as a - # php file on the server. - location ~ \..*/.*\.php$ { - return 403; - } - - # This is our primary location block. The try_files directive will - # attempt to serve the data in the order listed. First try the exact - # request (such as an image or text file). If it doesn't exist, see if - # the directory exists. If not, then we move to the rewrite which is - # used for the front-end controller pattern. - location / { - try_files $uri $uri/ @rewrite; - } - - # This will rewrite our request from domain.com/node/1/ to domain.com/index.php?q=node/1 - # This could be done in try_files without a rewrite however, the GlobalRedirect - # module enforces no slash (/) at the end of URL's. This rewrite removes that - # so no infinite redirect loop is reached. - location @rewrite { - rewrite ^/(.*)$ /index.php?q=$1; - } - - # If a PHP file is served, this block will handle the request. This block - # works on the assumption you are using php-cgi listening on /tmp/phpcgi.socket. - # Please see the php example (usr/share/doc/nginx/exmaples/php) for more - # information about setting up PHP. - # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - include fastcgi_params; - # Intercepting errors will cause PHP errors to appear in Nginx logs - fastcgi_intercept_errors on; - fastcgi_pass unix:/tmp/phpcgi.socket; - } - - # The ImageCache module builds an image 'on the fly' which means that - # if it doesn't exist, it needs to be created. Nginx is king of static - # so there's no point in letting PHP decide if it needs to be servered - # from an existing file. - # If the image can't be served directly, it's assumed that it doesn't - # exist and is passed off to PHP via our previous rewrite to let PHP - # create and serve the image. - # Notice that try_files does not have $uri/ in it. This is because an - # image should never be a directory. So there's no point in wasting a - # stat to serve it that way. - location ~ ^/sites/.*/files/imagecache/ { - try_files $uri @rewrite; - } - - # As mentioned above, Nignx is king of static. If we're serving a static - # file that ends with one of the following extensions, it is best to set - # a very high expires time. This will generate fewer requests for the - # file. These requests will be logged if found, but not if they don't - # exist. - location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { - expires max; - log_not_found off; - } -} diff --git a/debian/help/examples/http b/debian/help/examples/http deleted file mode 100644 index bac9f90..0000000 --- a/debian/help/examples/http +++ /dev/null @@ -1,58 +0,0 @@ -## -# File: -# http -# Description: -# This file is meant to deliver a basic understanding of the http block. -## - -# All web configuration should be inside of the http block. -# Most settings here are pretty self explanatory. -# See http://wiki.nginx.org/HttpCoreModule for details. -http { - - ## - # Basic Settings - ## - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - # server_tokens off; - - # server_names_hash_bucket_size 64; - # server_name_in_redirect off; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - ## - # Logging Settings - ## - - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - ## - # Gzip Settings - ## - - gzip on; - - # gzip_vary on; - # gzip_proxied any; - # gzip_comp_level 6; - # gzip_buffers 16 8k; - # gzip_http_version 1.1; - # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - - ## - # Virtual Host Configs - # These lines will include: - # any files in /etc/nginx/sites-enabled/ - # and any in /etc/nginx/conf.d/ ending with .conf - ## - - include /etc/nginx/conf.d/*.conf; - include /etc/nginx/sites-enabled/*; -} diff --git a/debian/help/examples/mail b/debian/help/examples/mail deleted file mode 100644 index f958fd7..0000000 --- a/debian/help/examples/mail +++ /dev/null @@ -1,30 +0,0 @@ -## -# File: -# mail -# Description: -# Provides a basic example of a mail proxy. -## - -# All mail proxy configuration should be inside of the mail block. -# Most settings here are pretty self explanatory. -# See http://wiki.nginx.org/MailCoreModule -mail { - # See sample authentication script at: - # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript - - # auth_http localhost/auth.php; - # pop3_capabilities "TOP" "USER"; - # imap_capabilities "IMAP4rev1" "UIDPLUS"; - - server { - listen localhost:110; - protocol pop3; - proxy on; - } - - server { - listen localhost:143; - protocol imap; - proxy on; - } -} diff --git a/debian/help/examples/mailman b/debian/help/examples/mailman deleted file mode 100644 index 77293f9..0000000 --- a/debian/help/examples/mailman +++ /dev/null @@ -1,59 +0,0 @@ -## -# File: -# mailman -# Description: -# This file explains how to install MailMan and offers a nearly drop-in -# model if MailMan was installed from Debian/Ubuntu repositories. -## - -server { - - # This is the URI of your website. You can specify multiple sites to be - # served by the same Drupal installation. - server_name lists.DOMAIN.TLD; - - # This is the default MailMan root directory. - root /usr/lib/cgi-bin; - - # If the request is exactly the server_name, then we need to redirect - # the browser to the listinfo page. Notice the = for an exact match. - location = / { - rewrite ^ /mailman/listinfo permanent; - } - - # Any requests need to be rewritten to /mailman/. - # This happens only if no other location block matches. - location / { - rewrite ^ /mailman$uri; - } - - # If /mailmain/ was part of the request, then we need to let python - # handle the request. - location /mailman/ { - fastcgi_split_path_info (^/mailman/[^/]*)(.*)$; - include fastcgi_params; - fastcgi_param GATEWAY_INTERFACE CGI/1.1; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; - # fcgiwrap was used to create this socket. - # See /usr/share/doc/nginx-doc/fcgiwrap - fastcgi_pass unix:/tmp/cgi.socket; - } - - # If a request was made for an image, we need to change the directory - # that is beeing looked at. Nothing else is needed because the images - # are static content. - location /images/mailman { - alias /var/lib/mailman/icons; - } - - # If a request for /pipermail was made, we are still only dealing with - # static content. The archives are at a different location and we need - # to point at it. Because these are public, there's no issue in letting - # them be browsed; autoindex is turned on to allow browsing. - location /pipermail { - alias /var/lib/mailman/archives/public; - autoindex on; - } -} diff --git a/debian/help/examples/nginx.conf b/debian/help/examples/nginx.conf deleted file mode 100644 index 1d494e4..0000000 --- a/debian/help/examples/nginx.conf +++ /dev/null @@ -1,34 +0,0 @@ -## -# File: -# nginx.conf -# Description: -# Provides a very basic description of the use of nginx.conf. -## - -# For more options with more detailed descriptions: -# See http://wiki.nginx.org/CoreModule - -# Sets user/group of worker processes. If group is not specified, group is assumed -# to be the same as user. Syntax: user user [group] -user www-data; - -# nginx has the ability to use more than one worker process -worker_processes 4; - -# The pid-file. It can be used for the kill-command to send signals to nginx. -# Example: To reload the config: kill -HUP `cat /var/log/nginx.pid` -pid /var/run/nginx.pid; - -# See http://wiki.nginx.org/HttpEventsModule -events { - worker_connections 1024; - # multi_accept on; -} - -# See /usr/share/doc/nginx/examples/http -http { -} - -# See /usr/share/doc/nginx/examples/mail -mail { -} diff --git a/debian/help/examples/nginx_modsite b/debian/help/examples/nginx_modsite deleted file mode 100755 index 5aad517..0000000 --- a/debian/help/examples/nginx_modsite +++ /dev/null @@ -1,162 +0,0 @@ -#!/bin/bash - -## -# File: -# nginx_modsite -# Description: -# Provides a basic script to automate enabling and disabling websites found -# in the default configuration directories: -# /etc/nginx/sites-available and /etc/nginx/sites-enabled -# For easy access to this script, copy it into the directory: -# /usr/local/sbin -# Run this script without any arguments or with -h or --help to see a basic -# help dialog displaying all options. -## - -# Copyright (C) 2010 Michael Lustfield - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -## -# Default Settings -## - -NGINX_CONF_FILE="$(awk -F= -v RS=' ' '/conf-path/ {print $2}' <<< $(nginx -V 2>&1))" -NGINX_CONF_DIR="${NGINX_CONF_FILE%/*}" -NGINX_SITES_AVAILABLE="$NGINX_CONF_DIR/sites-available" -NGINX_SITES_ENABLED="$NGINX_CONF_DIR/sites-enabled" -SELECTED_SITE="$2" - -## -# Script Functions -## - -ngx_enable_site() { - [[ ! "$SELECTED_SITE" ]] && - ngx_select_site "not_enabled" - - [[ ! -e "$NGINX_SITES_AVAILABLE/$SELECTED_SITE" ]] && - ngx_error "Site does not appear to exist." - [[ -e "$NGINX_SITES_ENABLED/$SELECTED_SITE" ]] && - ngx_error "Site appears to already be enabled" - - ln -sf "$NGINX_SITES_AVAILABLE/$SELECTED_SITE" -T "$NGINX_SITES_ENABLED/$SELECTED_SITE" - ngx_reload -} - -ngx_disable_site() { - [[ ! "$SELECTED_SITE" ]] && - ngx_select_site "is_enabled" - - [[ ! -e "$NGINX_SITES_AVAILABLE/$SELECTED_SITE" ]] && - ngx_error "Site does not appear to be \'available\'. - Not Removing" - [[ ! -e "$NGINX_SITES_ENABLED/$SELECTED_SITE" ]] && - ngx_error "Site does not appear to be enabled." - - rm -f "$NGINX_SITES_ENABLED/$SELECTED_SITE" - ngx_reload -} - -ngx_list_site() { - echo "Available sites:" - ngx_sites "available" - echo "Enabled Sites" - ngx_sites "enabled" -} - -## -# Helper Functions -## - -ngx_select_site() { - sites_avail=($NGINX_SITES_AVAILABLE/*) - sa="${sites_avail[@]##*/}" - sites_en=($NGINX_SITES_ENABLED/*) - se="${sites_en[@]##*/}" - - case "$1" in - not_enabled) sites=$(comm -13 <(printf "%s\n" $se) <(printf "%s\n" $sa));; - is_enabled) sites=$(comm -12 <(printf "%s\n" $se) <(printf "%s\n" $sa));; - esac - - ngx_prompt "$sites" -} - -ngx_prompt() { - sites=($1) - i=0 - - echo "SELECT A WEBSITE:" - for site in ${sites[@]}; do - echo -e "$i:\t${sites[$i]}" - ((i++)) - done - - read -p "Enter number for website: " i - SELECTED_SITE="${sites[$i]}" -} - -ngx_sites() { - case "$1" in - available) dir="$NGINX_SITES_AVAILABLE";; - enabled) dir="$NGINX_SITES_ENABLED";; - esac - - for file in $dir/*; do - echo -e "\t${file#*$dir/}" - done -} - -ngx_reload() { - read -p "Would you like to reload the Nginx configuration now? (Y/n) " reload - [[ "$reload" != "n" && "$reload" != "N" ]] && invoke-rc.d nginx reload -} - -ngx_error() { - echo -e "${0##*/}: ERROR: $1" - [[ "$2" ]] && ngx_help - exit 1 -} - -ngx_help() { - echo "Usage: ${0##*/} [options]" - echo "Options:" - echo -e "\t<-e|--enable> \tEnable site" - echo -e "\t<-d|--disable> \tDisable site" - echo -e "\t<-l|--list>\t\tList sites" - echo -e "\t<-h|--help>\t\tDisplay help" - echo -e "\n\tIf is left out a selection of options will be presented." - echo -e "\tIt is assumed you are using the default sites-enabled and" - echo -e "\tsites-disabled located at $NGINX_CONF_DIR." -} - -## -# Core Piece -## - -case "$1" in - -e|--enable) ngx_enable_site;; - -d|--disable) ngx_disable_site;; - -l|--list) ngx_list_site;; - -h|--help) ngx_help;; - *) ngx_error "No Options Selected" 1; ngx_help;; -esac diff --git a/debian/help/examples/virtual_hosts b/debian/help/examples/virtual_hosts deleted file mode 100644 index ee33a82..0000000 --- a/debian/help/examples/virtual_hosts +++ /dev/null @@ -1,155 +0,0 @@ -## -# File: -# virtual_hosts -# Description: -# This file is meant to deliver a basic understanding of server blocks. -## - -## -# You should look at the following URL's in order to grasp a solid understanding -# of Nginx configuration files in order to fully unleash the power of Nginx. -# http://wiki.nginx.org/Pitfalls -# http://wiki.nginx.org/Configuration -## - -## -# Every "virtual host" that you serve will need to be in its own server block. -# -# server { -# ... -# } -# -# After reading this file, you should understand the structure of server blocks -# and be able to understand how to modify them to your needs. -## - -server { - - # The listen directive is only needed if this server block: - # needs to listen for IPv6 - # needs to listen on another port - # If you need to listen for IPv6 then both of the following lines can - # be included. - # DO NOT listen for both SSL and non-SSL in the same server block. - #listen 80; ## listen for ipv4; this line is default and implied - #listen [::]:80 default ipv6only=on; ## listen for ipv6 - - # root specifies the document root for the requests - root /usr/share/nginx/www; - - # index specifies the list of files (in order) to be tried in the event - # no file is requested in the URI. - index index.html index.htm; - - # Make site accessible from http://localhost/ - server_name localhost; - - # Unless you run everything as a proxy, you will want to have a root - # location block. This example controls how files are requested. - location / { - # First attempt to serve request as file, then as directory, - # then fall back to index.html. /index.html would normally be - # front end controller pattern for handling "clean url's" in - # a CMS such as Drupal or Wordpress. - try_files $uri $uri/ /index.html; - } - - # This location block would server any requests for /doc as well - # as anything below it. - location /doc { - # root changes the root directory for these requests - root /usr/share; - # autoindex on allows these request to display directory listings - # if a directory was requested - autoindex on; - # We'll allow these requests for localhost - allow 127.0.0.1; - # Anyone outside is forbidden - deny all; - } - - # This location block would serve any requests for /images as well - # as anything below it. - location /images { - # This is the same as /doc except we don't allow indexes - root /usr/share; - autoindex off; - allow 127.0.0.1; - deny all; - } - - # This will serve the file 404.html in the event the request is not found. - error_page 404 /404.html; - - # redirect server error pages to the static page /50x.html - # This will hit if the server generates a 500, 502, 503, or 504 status code - error_page 500 502 503 504 /50x.html; - - # This location block isn't actually needed because our root for the - # server block is the same directory. However, this could be used to - # have a central directory for all error html files. - location = /50x.html { - root /usr/share/nginx/www; - } - - # proxy the PHP scripts to Apache listening on 127.0.0.1:80 - # If you're going to proxy to Apache, then just push the whole - # request to it. You'll generally have better performance with - # a dedicated php listener (fastcgi: php-cgi, php-fpm). - #location ~ \.php$ { - # proxy_pass http://127.0.0.1; - #} - - # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 - # This is used for passing to php-cgi and php-fpm. - # For more information see /usr/share/doc/nginx/examples/php - location ~ \.php$ { - # This is where the php socket is listening. - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi_params; - } - - # deny access to .htaccess, .htpasswd, and .htgroup files - location ~ /\.ht { - deny all; - } -} - - -# another virtual host using mix of IP-, name-, and port-based configuration -server { - listen 8000; - listen somename:8080; - server_name somename alias another.alias; - root html; - index index.html index.htm; - - location / { - try_files $uri $uri/ /index.html; - } -} - - -# HTTPS server -server { - listen 443; - server_name localhost; - - root html; - index index.html index.htm; - - ssl on; - ssl_certificate cert.pem; - ssl_certificate_key cert.key; - - ssl_session_timeout 5m; - - ssl_protocols SSLv3 TLSv1; - ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; - ssl_prefer_server_ciphers on; - - location / { - try_files $uri $uri/ /index.html; - } -} diff --git a/debian/help/examples/wordpress b/debian/help/examples/wordpress deleted file mode 100644 index 2d4c0ab..0000000 --- a/debian/help/examples/wordpress +++ /dev/null @@ -1,73 +0,0 @@ -## -# File: -# wordpress -# Description: -# This file is meant to offer a basic guide to get a Wordpress site up and -# running on Nginx. This file should be almost drop-in if the user is able -# to understand the three lines that need to be changed. -## - -server { - - # This is the URI of your website. - server_name domain.com; - - # This is the root of the Wordpress directory. - root /var/www/wordpress; - - # In some cases a favicon does not exist but this is not something you - # normally need to worry about. It's also a microscopic image and will - # just clutter the logs. - location = /favicon.ico { - log_not_found off; - access_log off; - } - - # This is for the robots.txt file used by search engines. - location = /robots.txt { - # If you have one, you want to allow them access to it. - allow all; - # If you don't have one, you don't want to fill your logs with - # not found errors. - log_not_found off; - access_log off; - } - - # This location block protects against a known attack. It happens if - # the attacker uploads a non-PHP file and attempts to run it as a - # PHP file on the server. - location ~ \..*/.*\.php$ { - return 403; - } - - # This is our primary location block. The try_files directive will - # attempt to serve the data in the order listed. First try the exact - # request (such as an image or text file). If it doesn't exist, see if - # the directory exists. If not, then we move to the last option which - # passes the request to /index.php with the requested query. - location / { - try_files $uri $uri/ /index.php?q=$uri&$args; - } - - # If a PHP file is served, this block will handle the request. This block - # works on the assumption you are using php-cgi listening on /tmp/phpcgi.socket. - # Please see the PHP example (/usr/share/doc/nginx-doc/php) for more - # information about setting up PHP. - # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - include fastcgi_params; - # Intercepting errors will cause PHP errors to appear in Nginx logs - fastcgi_intercept_errors on; - fastcgi_pass unix:/tmp/phpcgi.socket; - } - - # If we're serving a static file that ends with one of the following - # extensions, it is best to set a very high expires time. This will - # generate fewer requests for the file. These requests will be logged if - # found, but not if they don't exist. - location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { - expires max; - log_not_found off; - } -} diff --git a/debian/libnginx-mod-http-geoip.nginx b/debian/libnginx-mod-http-geoip.nginx deleted file mode 100755 index 0ca730a..0000000 --- a/debian/libnginx-mod-http-geoip.nginx +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -# Guess module name -$module = basename($0, '.nginx'); -$module =~ s/^libnginx-mod-//; - -$modulepath = $module; -$modulepath =~ s/-/_/g; - -print "mod debian/build-bin/objs/ngx_${modulepath}_module.so\n"; -print "mod debian/libnginx-mod.conf/mod-${module}.conf\n"; diff --git a/debian/libnginx-mod-http-image-filter.nginx b/debian/libnginx-mod-http-image-filter.nginx deleted file mode 100755 index 0ca730a..0000000 --- a/debian/libnginx-mod-http-image-filter.nginx +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -# Guess module name -$module = basename($0, '.nginx'); -$module =~ s/^libnginx-mod-//; - -$modulepath = $module; -$modulepath =~ s/-/_/g; - -print "mod debian/build-bin/objs/ngx_${modulepath}_module.so\n"; -print "mod debian/libnginx-mod.conf/mod-${module}.conf\n"; diff --git a/debian/libnginx-mod-http-perl.install b/debian/libnginx-mod-http-perl.install deleted file mode 100755 index 7382eca..0000000 --- a/debian/libnginx-mod-http-perl.install +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/perl -w - -use Config; - -my $vendorarch = substr($Config{vendorarch}, 1); -print "debian/build-bin/objs/src/http/modules/perl/blib/arch/auto/nginx/* $vendorarch/auto/nginx\n"; -print "debian/build-bin/objs/src/http/modules/perl/blib/lib/nginx.pm $vendorarch\n"; diff --git a/debian/libnginx-mod-http-perl.nginx b/debian/libnginx-mod-http-perl.nginx deleted file mode 100755 index 0ca730a..0000000 --- a/debian/libnginx-mod-http-perl.nginx +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -# Guess module name -$module = basename($0, '.nginx'); -$module =~ s/^libnginx-mod-//; - -$modulepath = $module; -$modulepath =~ s/-/_/g; - -print "mod debian/build-bin/objs/ngx_${modulepath}_module.so\n"; -print "mod debian/libnginx-mod.conf/mod-${module}.conf\n"; diff --git a/debian/libnginx-mod-http-xslt-filter.nginx b/debian/libnginx-mod-http-xslt-filter.nginx deleted file mode 100755 index 0ca730a..0000000 --- a/debian/libnginx-mod-http-xslt-filter.nginx +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -# Guess module name -$module = basename($0, '.nginx'); -$module =~ s/^libnginx-mod-//; - -$modulepath = $module; -$modulepath =~ s/-/_/g; - -print "mod debian/build-bin/objs/ngx_${modulepath}_module.so\n"; -print "mod debian/libnginx-mod.conf/mod-${module}.conf\n"; diff --git a/debian/libnginx-mod-mail.nginx b/debian/libnginx-mod-mail.nginx deleted file mode 100755 index 0ca730a..0000000 --- a/debian/libnginx-mod-mail.nginx +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -# Guess module name -$module = basename($0, '.nginx'); -$module =~ s/^libnginx-mod-//; - -$modulepath = $module; -$modulepath =~ s/-/_/g; - -print "mod debian/build-bin/objs/ngx_${modulepath}_module.so\n"; -print "mod debian/libnginx-mod.conf/mod-${module}.conf\n"; diff --git a/debian/libnginx-mod-stream-geoip.nginx b/debian/libnginx-mod-stream-geoip.nginx deleted file mode 100755 index 438ee46..0000000 --- a/debian/libnginx-mod-stream-geoip.nginx +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -# Guess module name -$module = basename($0, '.nginx'); -$module =~ s/^libnginx-mod-//; - -$modulepath = $module; -$modulepath =~ s/-/_/g; - -print "mod debian/build-bin/objs/ngx_${modulepath}_module.so\n"; -print "mod debian/libnginx-mod.conf/mod-${module}.conf 70\n"; diff --git a/debian/libnginx-mod-stream.nginx b/debian/libnginx-mod-stream.nginx deleted file mode 100755 index 0ca730a..0000000 --- a/debian/libnginx-mod-stream.nginx +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -# Guess module name -$module = basename($0, '.nginx'); -$module =~ s/^libnginx-mod-//; - -$modulepath = $module; -$modulepath =~ s/-/_/g; - -print "mod debian/build-bin/objs/ngx_${modulepath}_module.so\n"; -print "mod debian/libnginx-mod.conf/mod-${module}.conf\n"; diff --git a/debian/libnginx-mod.abisubstvars b/debian/libnginx-mod.abisubstvars deleted file mode 100644 index 57261d4..0000000 --- a/debian/libnginx-mod.abisubstvars +++ /dev/null @@ -1,11 +0,0 @@ -# ABI must be changed: -# - when upstream nginx version is changed -# - when module signature is changed (e.g. time_t change from 32bit integer to 64bit integer https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069997) -# - when symbols/structures/... (exported from header files) are changed -# -# ABI format: nginx-abi-{UPSTREAM_VERSION}-{SUFFIX} -# the {SUFFIX} provides a mechanism on rare cases when there have to be ABI -# changes without upgrading the upstream nginx version, e.g. security updates -# in oldstable - -nginx:abi=nginx-abi-1.26.3-1 diff --git a/debian/libnginx-mod.conf/mod-http-geoip.conf b/debian/libnginx-mod.conf/mod-http-geoip.conf deleted file mode 100644 index 9721986..0000000 --- a/debian/libnginx-mod.conf/mod-http-geoip.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ngx_http_geoip_module.so; diff --git a/debian/libnginx-mod.conf/mod-http-image-filter.conf b/debian/libnginx-mod.conf/mod-http-image-filter.conf deleted file mode 100644 index dfa2939..0000000 --- a/debian/libnginx-mod.conf/mod-http-image-filter.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ngx_http_image_filter_module.so; diff --git a/debian/libnginx-mod.conf/mod-http-perl.conf b/debian/libnginx-mod.conf/mod-http-perl.conf deleted file mode 100644 index ab3d02a..0000000 --- a/debian/libnginx-mod.conf/mod-http-perl.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ngx_http_perl_module.so; diff --git a/debian/libnginx-mod.conf/mod-http-xslt-filter.conf b/debian/libnginx-mod.conf/mod-http-xslt-filter.conf deleted file mode 100644 index a4f87ac..0000000 --- a/debian/libnginx-mod.conf/mod-http-xslt-filter.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ngx_http_xslt_filter_module.so; diff --git a/debian/libnginx-mod.conf/mod-mail.conf b/debian/libnginx-mod.conf/mod-mail.conf deleted file mode 100644 index cfd4a4d..0000000 --- a/debian/libnginx-mod.conf/mod-mail.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ngx_mail_module.so; diff --git a/debian/libnginx-mod.conf/mod-stream-geoip.conf b/debian/libnginx-mod.conf/mod-stream-geoip.conf deleted file mode 100644 index 7195856..0000000 --- a/debian/libnginx-mod.conf/mod-stream-geoip.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ngx_stream_geoip_module.so; diff --git a/debian/libnginx-mod.conf/mod-stream.conf b/debian/libnginx-mod.conf/mod-stream.conf deleted file mode 100644 index f2b2657..0000000 --- a/debian/libnginx-mod.conf/mod-stream.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ngx_stream_module.so; diff --git a/debian/libnginx-mod.nginx.skeleton b/debian/libnginx-mod.nginx.skeleton deleted file mode 100755 index 78c206f..0000000 --- a/debian/libnginx-mod.nginx.skeleton +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -# Guess module name -$module = basename($0, '.nginx'); -$module =~ s/^libnginx-mod-//; - -$modulepath = $module; -$modulepath =~ s/-/_/g; - -print "mod debian/build-extras/objs/ngx_${modulepath}_module.so\n"; -print "mod debian/libnginx-mod.conf/mod-${module}.conf\n"; diff --git a/debian/nginx-common.NEWS b/debian/nginx-common.NEWS deleted file mode 100644 index d361983..0000000 --- a/debian/nginx-common.NEWS +++ /dev/null @@ -1,188 +0,0 @@ -nginx-common (1.10.2-4) unstable; urgency=medium - - Since nginx 1.9.14 Debian has gradually switched to dynamic loadable modules - for all third party modules and core modules that support it. For each - module a new binary package is introduced under the libnginx-mod-* namespace. - - The modules are loadable from all nginx flavors (light,full,extras) and are - automatically registered by installing a symlink under - /etc/nginx/modules-enabled/. If you use a modified /etc/nginx/nginx.conf make - sure to include that directory. - - -- Christos Trochalakis Sun, 22 Jan 2017 12:19:30 +0200 - -nginx-common (1.10.2-1) unstable; urgency=high - - In order to secure nginx against privilege escalation attacks, we are - changing the way log file owners & permissions are handled so that www-data - is not allowed to symlink a logfile. /var/log/nginx is now owned by root:adm - and its permissions are changed to 0755. The package checks for such symlinks - on existing installations and informs the admin using debconf. - - That unfortunately may come at a cost in terms of privacy. /var/log/nginx is - now world-readable, and nginx hardcodes permissions of non-existing logs to - 0644. On systems running logrotate log files are private after the first - logrotate run, since the new log files are created with 0640 permissions. - - -- Christos Trochalakis Tue, 04 Oct 2016 15:20:33 +0300 - -nginx-common (1.9.9-1) unstable; urgency=medium - - Starting with this release we are changing the default logrotate rule to keep - daily logs for 14 days, this aligns our policy with apache2 (Bug #805322). - - -- Christos Trochalakis Thu, 14 Jan 2016 10:17:33 +0200 - -nginx-common (1.9.6-1) unstable; urgency=medium - - As of nginx 1.9.5 spdy has been replaced by the http2 module. Make sure to - replace "spdy" with "http2" in your config files. - - -- Christos Trochalakis Fri, 25 Sep 2015 14:06:28 +0300 - -nginx-common (1.9.1-1) unstable; urgency=medium - - Starting with this release, we have enabled PIE build features which allows - Address Space Layout Randomization. This is a hardening feature that - prevents some potential security issues. - - While this will significantly help increase security, it can potentially cause - significant performance issues on i386 systems. - - -- Michael Lustfield Tue, 07 Apr 2015 18:57:45 -0500 - -nginx-common (1.6.2-5) unstable; urgency=medium - - We have disabled SSLv3 in nginx.conf for security reasons (ref: POODLE), - don't forget to re-enable it if your site depends on it. - - In this release we also include a summary of important changes since wheezy - at /usr/share/doc/nginx-common/README.Debian. - - -- Christos Trochalakis Sun, 02 Nov 2014 09:10:09 +0200 - -nginx-common (1.6.2-3) unstable; urgency=medium - - Starting with this release, we changed the default document root from - /var/www to /var/www/html, so that sensitive files from other virtual hosts - wich are typically put into some directory below /var/www are not exposed by - the default virtual host. - - -- Christos Trochalakis Tue, 30 Sep 2014 17:34:58 +0300 - -nginx-common (1.6.1-2) unstable; urgency=medium - - As of nginx-1.6.1-2 we have synced all configuration files with upstream and - we plan to keep them in sync from now on. - - Unfortunately that might break existing configuration for some users. Please - check the matrix below for more information: - - File Changes - ----------------------- - koi-win whitespace - koi-utf whitespace - mime-types whitespace, changed js/rss mime type, - minor other changes & additions - scgi_params whitespace, added HTTPS - uwsgi_params whitespace, added HTTPS, removed UWSGI_SCHEME - fastcgi_params whitespace, removed SCRIPT_FILENAME - fastcgi.conf new upstream configuration file - - Fastcgi configuration issues - ============================ - - nginx shipped a modified `fastcgi_params`, which declared `SCRIPT_FILENAME` - fastcgi_param. This line has now been removed. From now on we are also - shipping fastcgi.conf from the upstream repository, which includes a sane - `SCRIPT_FILENAME` parameter value. - - So, if you are using fastcgi_params, you can try switching to fastcgi.conf - or manually set the relevant params. - - You might also want to read the documentation section before proceeding. - - http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html - section: $fastcgi_script_name variable. - - -- Christos Trochalakis Thu, 28 Aug 2014 14:23:42 +0300 - -nginx-common (1.4.4-2) unstable; urgency=low - - Per CVE-2013-0337 (bug #701112), we are changing /var/log/nginx permissions - to root:adm 750. If you have manipulated these permissions in any way, you - can add a dpkg-statoverride entry and the directory will not be touched. - You also have to manually set the permissions once, as dpkg doesn't do that - automatically for directories. - - e.g. - chown root:adm /var/log/nginx - chmod 0755 /var/log/nginx - dpkg-statoverride --add root adm 0755 /var/log/nginx - - -- Michael Lustfield Sun, 24 Nov 2013 15:59:52 -0600 - -nginx (1.4.1-2) unstable; urgency=medium - - Started with nginx 1.4.1-2 upload, nginx-naxsi-ui switched backend from - MySQL to SQLite. - - This was mostly caused by the future removal of MySQL support in naxsi-ui. - Thus, the nginx maintainers decided to switch from MySQL to SQLite. - - All data contained in the MySQL database is not affected by this switch but - you need to start with a clean SQLite database to ensure nginx-naxsi-ui - reliability. - - -- Cyril Lavier Wed, 5 Jun 2013 09:45:03 +0200 - -nginx (0.8.53-1) unstable; urgency=low - - As stated by upstream, the 0.7.x branch is consedered legacy and 0.8.x will - be the new stable branch. For this reason, the nginx maintainers decided to - upload 0.8.53 to unstable. - - -- Kartik Mistry Fri, 26 Nov 2010 19:42:09 +0530 - -nginx (0.7.59-1) unstable; urgency=low - - As stated by upstream, the 0.6.x branch is consedered legacy and 0.7.x will - be the new stable branch. For this reason, the nginx maintainers decided to - upload 0.7.59 to unstable. - - Should you get the following error while starting nginx: - - could not build the server_names_hash, you should increase - server_names_hash_bucket_size: 32 - - Please add the following parameter to your nginx.conf: - - server_names_hash_bucket_size 100; - - Where 100 is the size of your server names hash bucket. For more information - about this option, please read the following resources: - - http://wiki.nginx.org/NginxHttpCoreModule#server_names_hash_bucket_size - http://thread.gmane.org/gmane.comp.web.nginx.english/820/focus=821 - http://thread.gmane.org/gmane.comp.web.nginx.english/985/focus=989 - - -- Fabio Tranchitella Sun, 31 May 2009 18:30:10 +0200 - -nginx (0.6.30-2) unstable; urgency=low - - As of May 4th., nginx 0.5.x branch is considered legacy and 0.6.x will - be the new stable branch. The announcement was made by Igor Sysoev when - releasing the last 0.5.x version, nginx 0.5.36. - - Debian, the universal operating system, has provided binary packages for - both 0.5 and 0.6 branches in unstable and experimental, and will now offer - only 0.6 packages in the unstable distribution, starting with the - 0.6.30-1 package. - - In the future, Debian will also provide experimental packages for the - next testing branch of nginx, at the moment upstream announces it. - - Should you have any problem with nginx in Debian, please file a bug in - the Debian Bug Tracking System. - - -- Fabio Tranchitella Mon, 12 May 2008 14:24:53 +0200 diff --git a/debian/nginx-common.config b/debian/nginx-common.config deleted file mode 100755 index 27cb92f..0000000 --- a/debian/nginx-common.config +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -set -e - -. /usr/share/debconf/confmodule - -logdir="/var/log/nginx" - -log_symlinks_check() { - # Skip new installations - [ -z "$1" ] && return - - # Skip unaffected installations - dpkg --compare-versions "$1" lt-nl "1.10.2-1~" || return 0 - - # Check for unsecure symlinks - linked_logfiles="` find "$logdir" -type l -user www-data -name '*.log' `" - - # Skip if nothing is found - [ -z "$linked_logfiles" ] && return - - db_subst nginx/log-symlinks logfiles $linked_logfiles - db_input high nginx/log-symlinks || true - db_go || true -} - -case "$1" in - configure|reconfigure) - log_symlinks_check "$2" - ;; - *) - ;; -esac - -# vim: set ts=4 sts=4 sw=4 et sta ai : - diff --git a/debian/nginx-common.dirs b/debian/nginx-common.dirs deleted file mode 100644 index 8e5d7bf..0000000 --- a/debian/nginx-common.dirs +++ /dev/null @@ -1,12 +0,0 @@ -etc/nginx -etc/nginx/conf.d -etc/nginx/modules-available -etc/nginx/modules-enabled -etc/nginx/sites-available -etc/nginx/sites-enabled -etc/ufw/applications.d -usr/share/nginx -usr/share/vim/addons -usr/share/vim/registry -var/lib/nginx -var/log/nginx diff --git a/debian/nginx-common.install b/debian/nginx-common.install deleted file mode 100644 index 20109fa..0000000 --- a/debian/nginx-common.install +++ /dev/null @@ -1,6 +0,0 @@ -contrib/vim/* usr/share/vim/addons -debian/conf/* etc/nginx -debian/apport/source_nginx.py usr/share/apport/package-hooks -debian/ufw/nginx etc/ufw/applications.d -debian/vim/nginx.yaml usr/share/vim/registry -html/index.html usr/share/nginx/html/ diff --git a/debian/nginx-common.links b/debian/nginx-common.links deleted file mode 100644 index ca651a5..0000000 --- a/debian/nginx-common.links +++ /dev/null @@ -1 +0,0 @@ -usr/lib/nginx/modules usr/share/nginx/modules diff --git a/debian/nginx-common.nginx.default b/debian/nginx-common.nginx.default deleted file mode 100644 index 09b8fd0..0000000 --- a/debian/nginx-common.nginx.default +++ /dev/null @@ -1,10 +0,0 @@ -# Note: You may want to look at the following page before setting the ULIMIT. -# http://wiki.nginx.org/CoreModule#worker_rlimit_nofile -# Set the ulimit variable if you need defaults to change. -# Example: ULIMIT="-n 4096" -#ULIMIT="-n 4096" - -# Define the stop schedule for nginx -# see the start-stop-daemon --retry documentation for more information -# -#STOP_SCHEDULE="QUIT/5/TERM/5/KILL/5" diff --git a/debian/nginx-common.nginx.init b/debian/nginx-common.nginx.init deleted file mode 100644 index db10b7d..0000000 --- a/debian/nginx-common.nginx.init +++ /dev/null @@ -1,196 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: nginx -# Required-Start: $local_fs $remote_fs $network $syslog $named -# Required-Stop: $local_fs $remote_fs $network $syslog $named -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: starts the nginx web server -# Description: starts nginx using start-stop-daemon -### END INIT INFO - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/nginx -NAME=nginx -DESC=nginx - -# Include nginx defaults if available -if [ -r /etc/default/nginx ]; then - . /etc/default/nginx -fi - -STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/5/KILL/5}" - -test -x $DAEMON || exit 0 - -. /lib/init/vars.sh -. /lib/lsb/init-functions - -# Try to extract nginx pidfile -PID=$(cat /etc/nginx/nginx.conf | grep -Ev '^\s*#' | awk 'BEGIN { RS="[;{}]" } { if ($1 == "pid") print $2 }' | head -n1) -if [ -z "$PID" ]; then - PID=/run/nginx.pid -fi - -if [ -n "$ULIMIT" ]; then - # Set ulimit if it is set in /etc/default/nginx - ulimit $ULIMIT -fi - -start_nginx() { - # Start the daemon/service - # - # Returns: - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --pidfile $PID --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --pidfile $PID --exec $DAEMON -- \ - $DAEMON_OPTS 2>/dev/null \ - || return 2 -} - -test_config() { - # Test the nginx configuration - $DAEMON -t $DAEMON_OPTS >/dev/null 2>&1 -} - -stop_nginx() { - # Stops the daemon/service - # - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=$STOP_SCHEDULE --pidfile $PID --name $NAME - RETVAL="$?" - sleep 1 - return "$RETVAL" -} - -reload_nginx() { - # Function that sends a SIGHUP to the daemon/service - start-stop-daemon --stop --signal HUP --quiet --pidfile $PID --name $NAME - return 0 -} - -rotate_logs() { - # Rotate log files - start-stop-daemon --stop --signal USR1 --quiet --pidfile $PID --name $NAME - return 0 -} - -upgrade_nginx() { - # Online upgrade nginx executable - # http://nginx.org/en/docs/control.html - # - # Return - # 0 if nginx has been successfully upgraded - # 1 if nginx is not running - # 2 if the pid files were not created on time - # 3 if the old master could not be killed - if start-stop-daemon --stop --signal USR2 --quiet --pidfile $PID --name $NAME; then - # Wait for both old and new master to write their pid file - while [ ! -s "${PID}.oldbin" ] || [ ! -s "${PID}" ]; do - cnt=`expr $cnt + 1` - if [ $cnt -gt 10 ]; then - return 2 - fi - sleep 1 - done - # Everything is ready, gracefully stop the old master - if start-stop-daemon --stop --signal QUIT --quiet --pidfile "${PID}.oldbin" --name $NAME; then - return 0 - else - return 3 - fi - else - return 1 - fi -} - -case "$1" in - start) - log_daemon_msg "Starting $DESC" "$NAME" - start_nginx - case "$?" in - 0|1) log_end_msg 0 ;; - 2) log_end_msg 1 ;; - esac - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - stop_nginx - case "$?" in - 0|1) log_end_msg 0 ;; - 2) log_end_msg 1 ;; - esac - ;; - restart) - log_daemon_msg "Restarting $DESC" "$NAME" - - # Check configuration before stopping nginx - if ! test_config; then - log_end_msg 1 # Configuration error - exit $? - fi - - stop_nginx - case "$?" in - 0|1) - start_nginx - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - reload|force-reload) - log_daemon_msg "Reloading $DESC configuration" "$NAME" - - # Check configuration before stopping nginx - # - # This is not entirely correct since the on-disk nginx binary - # may differ from the in-memory one, but that's not common. - # We prefer to check the configuration and return an error - # to the administrator. - if ! test_config; then - log_end_msg 1 # Configuration error - exit $? - fi - - reload_nginx - log_end_msg $? - ;; - configtest|testconfig) - log_daemon_msg "Testing $DESC configuration" - test_config - log_end_msg $? - ;; - status) - status_of_proc -p $PID "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - upgrade) - log_daemon_msg "Upgrading binary" "$NAME" - upgrade_nginx - log_end_msg $? - ;; - rotate) - log_daemon_msg "Re-opening $DESC log files" "$NAME" - rotate_logs - log_end_msg $? - ;; - *) - echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest|rotate|upgrade}" >&2 - exit 3 - ;; -esac diff --git a/debian/nginx-common.nginx.logrotate b/debian/nginx-common.nginx.logrotate deleted file mode 100644 index 423c6ad..0000000 --- a/debian/nginx-common.nginx.logrotate +++ /dev/null @@ -1,18 +0,0 @@ -/var/log/nginx/*.log { - daily - missingok - rotate 14 - compress - delaycompress - notifempty - create 0640 www-data adm - sharedscripts - prerotate - if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ - run-parts /etc/logrotate.d/httpd-prerotate; \ - fi \ - endscript - postrotate - invoke-rc.d nginx rotate >/dev/null 2>&1 - endscript -} diff --git a/debian/nginx-common.nginx.service b/debian/nginx-common.nginx.service deleted file mode 100644 index cb759f6..0000000 --- a/debian/nginx-common.nginx.service +++ /dev/null @@ -1,31 +0,0 @@ -# Stop dance for nginx -# ======================= -# -# ExecStop sends SIGQUIT (graceful stop) to the nginx process. -# If, after 5s (--retry QUIT/5) nginx is still running, systemd takes control -# and sends SIGTERM (fast shutdown) to the main process. -# After another 5s (TimeoutStopSec=5), and if nginx is alive, systemd sends -# SIGKILL to all the remaining processes in the process group (KillMode=mixed). -# -# nginx signals reference doc: -# http://nginx.org/en/docs/control.html -# -[Unit] -Description=A high performance web server and a reverse proxy server -Documentation=man:nginx(8) -After=network-online.target remote-fs.target nss-lookup.target -Wants=network-online.target -ConditionFileIsExecutable=/usr/sbin/nginx - -[Service] -Type=forking -PIDFile=/run/nginx.pid -ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;' -ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;' -ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload -ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid -TimeoutStopSec=5 -KillMode=mixed - -[Install] -WantedBy=multi-user.target diff --git a/debian/nginx-common.postinst b/debian/nginx-common.postinst deleted file mode 100644 index 0d44608..0000000 --- a/debian/nginx-common.postinst +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -set -e - -. /usr/share/debconf/confmodule - -case "$1" in - configure) - logdir="/var/log/nginx" - - # Allow local admin to override - if ! dpkg-statoverride --list "$logdir" >/dev/null; then - chown root:adm $logdir - chmod 0755 $logdir - fi - - # Secure default logfiles on fresh installations - if [ -z "$2" ]; then - access_log="$logdir/access.log" - error_log="$logdir/error.log" - - if [ ! -e "$access_log" ]; then - touch "$access_log" - chmod 640 "$access_log" - chown www-data:adm "$access_log" - fi - - if [ ! -e "$error_log" ]; then - touch "$error_log" - chmod 640 "$error_log" - chown www-data:adm "$error_log" - fi - fi - - # If a symlink doesn't exist and can be created, then create it. - if [ -z $2 ] && [ ! -e /etc/nginx/sites-enabled/default ] && - [ -d /etc/nginx/sites-enabled ] && [ -d /etc/nginx/sites-available ]; then - ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default - fi - - # Create a default index page when not already present. - if [ ! -e /var/www/html/index.nginx-debian.html ]; then - mkdir -p /var/www/html - cp /usr/share/nginx/html/index.html /var/www/html/index.nginx-debian.html - fi - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/nginx-common.postrm b/debian/nginx-common.postrm deleted file mode 100644 index f5124c8..0000000 --- a/debian/nginx-common.postrm +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -set -e - -case "$1" in - purge) - rm -rf /var/lib/nginx /var/log/nginx /etc/nginx - ;; - - upgrade|remove|failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/nginx-common.preinst b/debian/nginx-common.preinst deleted file mode 100644 index ead53f7..0000000 --- a/debian/nginx-common.preinst +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -set -e - -case "$1" in - install) - # If we are doing a fresh install, then these files are no longer needed. - # They were around for a very short time and are best simply removed. - rm -f /etc/logrotate.d/nginx-full - rm -f /etc/logrotate.d/nginx-light - rm -f /etc/logrotate.d/nginx-extras - rm -f /etc/logrotate.d/nginx-common - ;; - - upgrade) - # If this is an upgrade, then they might have the UFW profile in the wrong spot. - if [ -d /etc/ufw/applications.d/nginx ]; then - rm -f /etc/ufw/applications.d/nginx/ufw.profile - rmdir /etc/ufw/applications.d/nginx - fi - rm -f /etc/logrotate.d/nginx-full - rm -f /etc/logrotate.d/nginx-light - rm -f /etc/logrotate.d/nginx-extras - rm -f /etc/logrotate.d/nginx-common - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/nginx-common.templates b/debian/nginx-common.templates deleted file mode 100644 index 225762c..0000000 --- a/debian/nginx-common.templates +++ /dev/null @@ -1,13 +0,0 @@ -Template: nginx/log-symlinks -Type: note -_Description: Possible insecure nginx log files - The following log files under /var/log/nginx directory are symlinks - owned by www-data: - . - ${logfiles} - . - Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result - www-data could symlink log files to sensitive locations, which in turn - could lead to privilege escalation attacks. Although /var/log/nginx - permissions are now fixed it is possible that such insecure links - already exist. So, please make sure to check the above locations. diff --git a/debian/nginx-core.NEWS b/debian/nginx-core.NEWS deleted file mode 100644 index 0c7f7de..0000000 --- a/debian/nginx-core.NEWS +++ /dev/null @@ -1,9 +0,0 @@ -nginx-core (1.22.1-6) unstable; urgency=medium - - The packages nginx-core, nginx-full, nginx-light, nginx-extras are deprecated. - Packages no longer distribute the nginx binary and are replaced - by a metapackage to keep upgrades smooth. - Please simply install 'nginx' and 'libnginx-mod-...' modules You need - instead of these packages. - - -- Jan Mojžíš Wed, 11 Jan 2023 20:23:22 +0100 diff --git a/debian/nginx-dev.install b/debian/nginx-dev.install deleted file mode 100644 index d8ae406..0000000 --- a/debian/nginx-dev.install +++ /dev/null @@ -1,9 +0,0 @@ -debian/build-src/auto usr/share/nginx/src/ -debian/build-src/src usr/share/nginx/src/ -debian/build-src/conf_flags usr/share/nginx/src/ -debian/build-src/configure usr/share/nginx/src/ -debian/libnginx-mod.abisubstvars usr/share/nginx/src/debian/ -debian/debhelper/nginx.pm usr/share/perl5/Debian/Debhelper/Sequence/ -debian/debhelper/dh_nginx usr/bin/ -debian/debhelper/nginx_mod.pm usr/share/perl5/Debian/Debhelper/Buildsystem/ -debian/autoscripts/* usr/share/debhelper/autoscripts/ diff --git a/debian/nginx-dev.manpages b/debian/nginx-dev.manpages deleted file mode 100644 index 0ece920..0000000 --- a/debian/nginx-dev.manpages +++ /dev/null @@ -1 +0,0 @@ -debian/build-src/dh_nginx.1 diff --git a/debian/nginx-doc.docs b/debian/nginx-doc.docs deleted file mode 100644 index 8570ff0..0000000 --- a/debian/nginx-doc.docs +++ /dev/null @@ -1,2 +0,0 @@ -README -debian/help/docs/* diff --git a/debian/nginx-doc.examples b/debian/nginx-doc.examples deleted file mode 100644 index 0f7a9f0..0000000 --- a/debian/nginx-doc.examples +++ /dev/null @@ -1 +0,0 @@ -debian/help/examples/* diff --git a/debian/nginx-extras.NEWS b/debian/nginx-extras.NEWS deleted file mode 100644 index d5919af..0000000 --- a/debian/nginx-extras.NEWS +++ /dev/null @@ -1,9 +0,0 @@ -nginx-extras (1.22.1-6) unstable; urgency=medium - - The packages nginx-core, nginx-full, nginx-light, nginx-extras are deprecated. - Packages no longer distribute the nginx binary and are replaced - by a metapackage to keep upgrades smooth. - Please simply install 'nginx' and 'libnginx-mod-...' modules You need - instead of these packages. - - -- Jan Mojžíš Wed, 11 Jan 2023 20:23:22 +0100 diff --git a/debian/nginx-full.NEWS b/debian/nginx-full.NEWS deleted file mode 100644 index 10e4bff..0000000 --- a/debian/nginx-full.NEWS +++ /dev/null @@ -1,9 +0,0 @@ -nginx-full (1.22.1-6) unstable; urgency=medium - - The packages nginx-core, nginx-full, nginx-light, nginx-extras are deprecated. - Packages no longer distribute the nginx binary and are replaced - by a metapackage to keep upgrades smooth. - Please simply install 'nginx' and 'libnginx-mod-...' modules You need - instead of these packages. - - -- Jan Mojžíš Wed, 11 Jan 2023 20:23:22 +0100 diff --git a/debian/nginx-light.NEWS b/debian/nginx-light.NEWS deleted file mode 100644 index e5c1da8..0000000 --- a/debian/nginx-light.NEWS +++ /dev/null @@ -1,9 +0,0 @@ -nginx-light (1.22.1-6) unstable; urgency=medium - - The packages nginx-core, nginx-full, nginx-light, nginx-extras are deprecated. - Packages no longer distribute the nginx binary and are replaced - by a metapackage to keep upgrades smooth. - Please simply install 'nginx' and 'libnginx-mod-...' modules You need - instead of these packages. - - -- Jan Mojžíš Wed, 11 Jan 2023 20:23:22 +0100 diff --git a/debian/nginx.dirs b/debian/nginx.dirs deleted file mode 100644 index 236670a..0000000 --- a/debian/nginx.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/sbin diff --git a/debian/nginx.install b/debian/nginx.install deleted file mode 100644 index f268f7f..0000000 --- a/debian/nginx.install +++ /dev/null @@ -1 +0,0 @@ -debian/build-bin/objs/nginx usr/sbin diff --git a/debian/nginx.manpages b/debian/nginx.manpages deleted file mode 100644 index b62c815..0000000 --- a/debian/nginx.manpages +++ /dev/null @@ -1 +0,0 @@ -debian/build-bin/objs/nginx.8 diff --git a/debian/nginx.postinst b/debian/nginx.postinst deleted file mode 100644 index 888d952..0000000 --- a/debian/nginx.postinst +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -case "$1" in - abort-upgrade|abort-remove|abort-deconfigure|configure) - ;; - triggered) - if invoke-rc.d --quiet nginx status >/dev/null; then - echo "Triggering nginx reload ..." - invoke-rc.d nginx reload || true - fi - exit 0 - ;; - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -if invoke-rc.d --quiet nginx status >/dev/null; then - invoke-rc.d nginx upgrade || invoke-rc.d nginx restart - exit $? -else - if [ -z "$(ss -nlt 'sport = 80' | grep -v ^State)" ]; then - invoke-rc.d nginx start || exit $? - else - echo "Not attempting to start NGINX, port 80 is already in use." - exit 0 - fi -fi - -#DEBHELPER# - -exit 0 diff --git a/debian/nginx.prerm b/debian/nginx.prerm deleted file mode 100644 index a2e3838..0000000 --- a/debian/nginx.prerm +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -set -e - -case "$1" in - remove|remove-in-favour|deconfigure|deconfigure-in-favour) - if [ -x /etc/init.d/nginx ]; then - invoke-rc.d nginx stop || exit $? - fi - ;; - - upgrade|failed-upgrade) - ;; - - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/nginx.triggers b/debian/nginx.triggers deleted file mode 100644 index efb0515..0000000 --- a/debian/nginx.triggers +++ /dev/null @@ -1 +0,0 @@ -interest-noawait nginx-reload diff --git a/debian/ngx-conf/README.rst b/debian/ngx-conf/README.rst deleted file mode 100644 index e78caf0..0000000 --- a/debian/ngx-conf/README.rst +++ /dev/null @@ -1,104 +0,0 @@ -Nginx Configuration Tool (ngx-conf) -=================================== - -A tool to help manage nginx confuration files. - -Synopsis --------- - -ngx-conf [-h] (-e | -d | -x | -l) [-f] [-r] [-v] FILE [FILES] - -Description ------------ - -Ngx-conf is a relatively simple tool to help manage Nginx configuration files. -It can be used to enable, disable, remove, and list configuration files. In the -case of configuration files in conf.d/\*.conf, it will handle renaming files to -an enabled/disabled state. In sites-{enabled,available}/\*, it will handle the -creation and removal of symbolic links. - -**-h, --help** - show a help message and exit -**-e, --enable** - enable a configuration files -**-d, --disable** - disable a configuration files -**-x, --remove** - remove a configuration files; will prompt without -f -**-l, --list** - list configuration files -**-f, --force** - force change, even if doing so will destroy data -**-r, --reload** - reload configuration after change -**-v, --verbose** - show verbose output; default is quiet unless errors -**FILES** - a list of configuration files to update - -Using --force: - -* In --remove will not prompt you to delete the file(s). -* In --enable will ignore conflicts. -* In --disable will ignore conflicts. -* In --disable will also delete files from sites-enabled. - -Only one action (enable|disable|remove|list) can be performed at one time. - -Examples --------- - -ngx-conf -e site1 site2 site3 - enable "site{1,2,3}" configurations -ngx-conf -r -d site - disable "site" configuration and reload nginx -ngx-conf -f -r -x site1 site2 - remove "site{1,2}" configurations without prompting and reload nginx - -Configuration Files -------------------- - -Three configuration files, if present, will be read. They will be read in the -following order; the next read file will always override the previous. - -1. /etc/nginx/ngx.cfg -#. /etc/ngx.cfg -#. ngx.cfg - -A sample configuration file with all options set to default:: - - [DEFAULT] - base_dir = /etc/nginx/ - conf_dir = conf.d/ - sites_en = sites-enabled/ - sites_dis = sites-available/ - conf_ext = .conf - verbose = no - reload = no - force = no - -Make sure that base_dir always has a trailing slash. - -Any arguments given to the command will override configuration options. - -Aliases -------- - -If you're interested in any sort of a2{dis,en}{conf,mod,site}, you can create -some nice aliases. Examples: - -* a2ensite -- alias ngxensite='ngx-conf -e' -* a2enconf -- alias ngxenconf='ngx-conf -e' -* a2dissite -- alias ngxdissite='ngx-conf -d' -* a2disconf -- alias ngxdisconf='ngx-conf -d' - -Bugs ----- - -If you experience bugs, the best way to report them is to the upstream bug -tracker. This can be found at https://github.com/ngx/ngx-conf. - -Authors -------- - -The ngx-conf tool and manual page were written by Michael Lustfield . diff --git a/debian/ngx-conf/ngx-conf b/debian/ngx-conf/ngx-conf deleted file mode 100755 index 658766a..0000000 --- a/debian/ngx-conf/ngx-conf +++ /dev/null @@ -1,278 +0,0 @@ -#!/usr/bin/env python3 - -## -# copyright (c) 2015 Michael Lustfield -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written authorization. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -## - -import argparse -try: - import configparser as ConfigParser -except: - import ConfigParser -import glob -import os -import subprocess - - -# Read configuration values -config_opts = ConfigParser.ConfigParser({ - 'base_dir': '/etc/nginx/', - 'conf_dir': 'conf.d/', - 'sites_en': 'sites-enabled/', - 'sites_dis': 'sites-available/', - 'conf_ext': '.conf', - 'verbose': 'no', - 'reload': 'no', - 'force': 'no'}) -config_opts.read('/etc/nginx/ngx.cfg') -config_opts.read('/etc/ngx.cfg') -config_opts.read('ngx.cfg') - -# Variable that we'll use a lot. -sites_en = config_opts.get('DEFAULT', 'base_dir') + config_opts.get('DEFAULT', 'sites_en') -sites_dis = config_opts.get('DEFAULT', 'base_dir') + config_opts.get('DEFAULT', 'sites_dis') -conf_dir = config_opts.get('DEFAULT', 'base_dir') + config_opts.get('DEFAULT', 'conf_dir') -conf_ext = config_opts.get('DEFAULT', 'conf_ext') - - -def parse_arguments(): - '''Parse arguments supplied by the user.''' - parser = argparse.ArgumentParser(description='nginx configuration helper', - epilog='Only one in group (enable|disable|remove|list) is allowed.', - usage='ngx-conf [-h] (-e | -d | -x | -l) [-f] [-r] [-v] FILE [FILES]') - group = parser.add_mutually_exclusive_group(required=True) - group.add_argument('-e', '--enable', action='store_true', - help='enable a configuration files') - group.add_argument('-d', '--disable', action='store_true', - help='disable a configuration files') - group.add_argument('-x', '--remove', action='store_true', - help='remove a configuration files; will prompt without -f') - group.add_argument('-l', '--list', action='store_true', - help='list configuration files') - parser.add_argument('-f', '--force', action='store_true', - default=config_opts.getboolean('DEFAULT', 'force'), - help='force change, even if doing so will destroy data') - parser.add_argument('-r', '--reload', action='store_true', - default=config_opts.getboolean('DEFAULT', 'reload'), - help='reload configuration after change') - parser.add_argument('-v', '--verbose', action='store_true', - default=config_opts.getboolean('DEFAULT', 'verbose'), - help='show verbose output; default is quite unless errors') - parser.add_argument('FILES', nargs=argparse.REMAINDER, - help='a list of configuration files to update') - return parser.parse_args() - - -def main(): - '''Main execution; read arguments and act accordingly.''' - args = parse_arguments() - if args.FILES == [] and not args.list: - print('No files specified. These are required.') - return False - if args.enable: - enable_configs(args.FILES, args.verbose, args.force) - elif args.disable: - disable_configs(args.FILES, args.verbose, args.force) - elif args.remove: - remove_configs(args.FILES, args.verbose, args.force) - elif args.list: - list_configs() - if args.reload and not args.list: - reload_nginx() - - -def enable_configs(configs, verbose, force): - '''Enable configurtion files specified.''' - if type(configs) != list: - print('Configuration list is in an incorrect format.') - return 1 - - for conf in configs: - if os.path.isfile(conf_dir + conf + conf_ext) or os.path.islink(sites_en + conf) or os.path.isfile(sites_en + conf): - if verbose: - print('Configuration file "{}" is already enabled.'.format(conf)) - elif os.path.isfile(conf_dir + conf + conf_ext + '_disabled'): - if not force and os.path.isfile(sites_dis + conf): - print('Configuration file "{}" has conflicts.'.format(conf)) - else: - try: - os.rename(conf_dir + conf + conf_ext + '_disabled', conf_dir + conf + conf_ext) - if verbose: - print('Configuration file "{}" has been enabled.'.format(conf)) - except: - print('Error occured when trying to enable "{}". Permissions?'.format(conf)) - elif os.path.isfile(sites_dis + conf): - try: - os.symlink(sites_dis + conf, sites_en + conf) - if verbose: - print('Configuration file "{}" has been enabled.'.format(conf)) - except: - print('Error occured when trying to enable "{}". Permissions?'.format(conf)) - else: - print('Configuration file for "{}" was not found.'.format(conf)) - - -def disable_configs(configs, verbose, force): - '''Disable configurtion files specified.''' - if type(configs) != list: - print('Configuration list is in an incorrect format.') - return 1 - - for conf in configs: - if not force and os.path.isfile(conf_dir + conf + conf_ext) and os.path.islink(sites_en + conf): - print('Configuration file "{}" has conflicts.'.format(conf)) - elif not force and os.path.isfile(conf_dir + conf + conf_ext) and os.path.isfile(sites_en + conf): - print('Configuration file "{}" has conflicts.'.format(conf)) - elif os.path.isfile(conf_dir + conf + conf_ext): - if not force and os.path.isfile(conf_dir + conf + conf_ext + '_disabled'): - print('Unable to disable "{}". It appears to have a disabled version.'.format(conf)) - break - elif os.path.isfile(conf_dir + conf + conf_ext + '_disabled'): - if verbose: - print('Attempting to remove disabled config for {}.'.format(conf)) - try: - os.remove(conf_dir + conf + conf_ext + '_disabled') - except: - print('Error trying to remove configuration for disabled "{}".'.format(conf)) - break - try: - os.rename(conf_dir + conf + conf_ext, conf_dir + conf + conf_ext + '_disabled') - if verbose: - print('Configuration file "{}" has been disabled.'.format(conf)) - except: - print('Error occured when trying to disable "{}". Permissions?'.format(conf)) - elif os.path.islink(sites_en + conf): - try: - os.remove(sites_en + conf) - if verbose: - print('Configuration file "{}" has been disabled.'.format(conf)) - except: - print('Error occured when trying to disable "{}". Permissions?'.format(conf)) - elif os.path.isfile(sites_en + conf): - if not force and os.path.isfile(sites_dis + conf): - print('Unable to disable "{}". It appears to have a disabled version.'.format(conf)) - break - elif os.path.isfile(sites_dis + conf): - if verbose: - print('Attempting to remove disabled config for {}.'.format(conf)) - try: - os.remove(sites_dis + conf) - except: - print('Error trying to remove configuration for disabled "{}".'.format(conf)) - break - try: - os.rename(sites_en + conf, sites_dis + conf) - if verbose: - print('Configuration file "{}" has been disabled.'.format(conf)) - except: - print('Error occured when trying to disable "{}". Permissions?'.format(conf)) - else: - print('Configuration file for "{}" was not found.'.format(conf)) - - -def remove_configs(configs, verbose, force): - '''Remove configurtion files specified.''' - if type(configs) != list: - print('Configuration list is in an incorrect format.') - return 1 - - for conf in configs: - if os.path.islink(sites_en + conf): - try: - os.remove(sites_en + conf) - if verbose: - print('Symlink for "{}" removed.'.format(conf)) - except: - print('Error occured when trying to remove symlink for "{}". Permissions?'.format(conf)) - files = [sites_en + conf, sites_dis + conf, conf_dir + conf + conf_ext, - conf_dir + conf + conf_ext + '_disabled'] - for f in files: - if os.path.isfile(f): - if not force: - answer = str(input('Are you sure you want to delete {}? (y/N) '.format(f))) - if answer.lower() != 'y' and answer.lower() != 'yes': - break - try: - os.remove(f) - if verbose: - print('Configuration file for "{}" was removed.'.format(f)) - except: - print('Error occured when trying to remove file for "{}". Permissions?'.format(f)) - - -def list_configs(): - '''List configuration files.''' - configs = get_configs() - for key, verb in [ - ('conf_en', 'Configs enabled in {}:'.format(config_opts.get('DEFAULT', 'conf_dir'))), - ('conf_dis', 'Configs disabled in {}:'.format(config_opts.get('DEFAULT', 'conf_dir'))), - ('sites_en', 'Configs enabled in {}:'.format(config_opts.get('DEFAULT', 'sites_en'))), - ('sites_dis', 'Configs disabled in {}:'.format(config_opts.get('DEFAULT', 'sites_dis'))), - ('sites_avail', 'All confis available in {}:'.format(config_opts.get('DEFAULT', 'sites_dis')))]: - if configs[key] == []: - print(verb + '\n\t') - else: - print(verb) - for conf in configs[key]: - print('\t' + conf) - - -def get_configs(): - '''Returns a list of configuration files.''' - cd = [os.path.basename(f).replace(conf_ext + '_disabled', '') - for f in glob.glob(conf_dir + '*' + conf_ext + '_disabled') - if os.path.isfile(f)] - ce = [os.path.basename(f).replace(conf_ext, '') - for f in glob.glob(conf_dir + '*' + conf_ext) - if os.path.isfile(f)] - se = [os.path.basename(f) - for f in glob.glob(sites_en + '*') - if os.path.isfile(f) or os.path.islink(f)] - sd = [os.path.basename(f) - for f in glob.glob(sites_dis + '*') - if os.path.isfile(f) and os.path.basename(f) not in se] - sa = [os.path.basename(f) - for f in glob.glob(sites_dis + '*') - if os.path.isfile(f)] - return {'conf_dis': cd, 'conf_en': ce, 'sites_en': se, 'sites_dis': sd, 'sites_avail': sa} - - -def reload_nginx(): - '''Reload Nginx after configuration changes.''' - child = subprocess.Popen( - ['service', 'nginx', 'reload'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, stderr = child.communicate() - if int(child.returncode) != 0: - print('Error reloading nginx configs.') - return False - elif verbose: - print('Nginx config reloaded successfully.') - return True - - -if __name__ == '__main__': - main() diff --git a/debian/ngx-conf/ngx-conf.1 b/debian/ngx-conf/ngx-conf.1 deleted file mode 100644 index 3228f59..0000000 --- a/debian/ngx-conf/ngx-conf.1 +++ /dev/null @@ -1,135 +0,0 @@ -.\" Title: ngx-conf -.\" Author: Michael Lustfield -.\" Date: 01/14/2015 -.\" Manual: User Commands -.\" -.TH "NGX-CONF" "1" "01/14/2015" "ngx-conf" "User Commands" -.\" disable hyphenation -.NH -.\" disable justification (adjust text to left margin only) -.AD l -.SH "NAME" -ngx - a tool to help manage nginx confuration files -.SH "SYNOPSIS" -.B ngx-conf -[-h] (-e | -d | -x | -l) [-f] [-r] [-v] FILE [FILES] -.br -.SH "DESCRIPTION" -.PP -Ngx-conf is a relatively simple tool to help manage Nginx configuration files. -It can be used to enable, disable, remove, and list configuration files. In the -case of configuration files in conf.d/*.conf, it will handle renaming files to -an enabled/disabled state. In sites-{enabled,available}/*, it will handle the -creation and removal of symbolic links. -.SH "OPTIONS" -.PP -This program follows the usual command line syntax, with long options starting -with two dashes (`\-'). A summary of options is included below. -.TP -.B \-h, \-\-help -show a help message and exit -.TP -.B \-e, \-\-enable -enable a configuration files -.TP -.B \-d, \-\-disable -disable a configuration files -.TP -.B \-x, \-\-remove -remove a configuration files; will prompt without -f -.TP -.B \-l, \-\-list -list configuration files -.TP -.B \-f, \-\-force -force change, even if doing so will destroy data -.TP -.B \-r, \-\-reload -reload configuration after change -.TP -.B \-v, \-\-verbose -show verbose output; default is quiet unless errors -.B FILES -a list of configuration files to update -.PP -Using --force: -.IP -In --remove will not prompt you to delete the file(s). -.br -In --enable will ignore conflicts. -.br -In --disable will ignore conflicts. -.br -In --disable will also delete files from sites-enabled. -.PP -Only one action (enable|disable|remove|list) can be performed at one time. -.SH "EXAMPLES" -.PP -ngx-conf -e site1 site2 site3 - enable "site{1,2,3}" configurations -.br -ngx-conf -r -d site - disable "site" configuration and reload nginx -.br -ngx-conf -f -r -x site1 site2 - remove "site{1,2}" configurations without prompting and reload nginx -.SH "CONFIGURATION FILES" -.PP -Three configuration files, if present, will be read. They will be read in the -following order; the next read file will always override the previous. -.IP -1. /etc/nginx/ngx.cfg -.br -2. /etc/ngx.cfg -.br -3. ngx.cfg -.PP -A sample configuration file with all options set to default: -.IP -[DEFAULT] -.br -base_dir = /etc/nginx/ -.br -conf_dir = conf.d/ -.br -sites_en = sites-enabled/ -.br -sites_dis = sites-available/ -.br -conf_ext = .conf -.br -verbose = no -.br -reload = no -.br -force = no -.PP -Make sure that base_dir always has a trailing slash. -.br -Any arguments given to the command will override configuration options. -.SH "ALIASES" -.PP -If you're interested in any sort of a2{dis,en}{conf,mod,site}, you can create -some nice aliases. Examples: -.TP -.B a2ensite -alias ngxensite='ngx-conf -e' -.br -.TP -.B a2enconf -alias ngxenconf='ngx-conf -e' -.br -.TP -.B a2dissite -alias ngxdissite='ngx-conf -d' -.br -.TP -.B a2disconf -alias ngxdisconf='ngx-conf -d' -.SH "BUGS" -.PP -If you experience bugs, the best way to report them is to the upstream bug -tracker. This can be found at https://github.com/ngx/ngx-conf. -.SH "AUTHORS" -.PP -The ngx-conf tool and manual page were written by Michael Lustfield . diff --git a/debian/patches/0003-define_gnu_source-on-other-glibc-based-platforms.patch b/debian/patches/0003-define_gnu_source-on-other-glibc-based-platforms.patch deleted file mode 100644 index caf155f..0000000 --- a/debian/patches/0003-define_gnu_source-on-other-glibc-based-platforms.patch +++ /dev/null @@ -1,28 +0,0 @@ -Date: Sat, 16 Jul 2016 23:52:50 +0100 -From: Steven Chamberlain -Subject: Use _GNU_SOURCE on GNU/kFreeBSD -Forwarded: https://trac.nginx.org/nginx/ticket/2366 - -Define _GNU_SOURCE not only on GNU/Hurd, but also other glibc-based -platforms including GNU/kFreeBSD. - -modified by jan.mojzis@gmail.com -Index: nginx/src/os/unix/ngx_posix_config.h -=================================================================== ---- nginx.orig/src/os/unix/ngx_posix_config.h -+++ nginx/src/os/unix/ngx_posix_config.h -@@ -21,10 +21,13 @@ - #endif - - --#if (NGX_GNU_HURD) -+#if defined(NGX_GNU_HURD) || defined(__GLIBC__) - #ifndef _GNU_SOURCE - #define _GNU_SOURCE /* accept4() */ - #endif -+#endif -+ -+#if (NGX_GNU_HURD) - #define _FILE_OFFSET_BITS 64 - #endif - diff --git a/debian/patches/nginx-fix-pidfile.patch b/debian/patches/nginx-fix-pidfile.patch deleted file mode 100644 index 83f7cf9..0000000 --- a/debian/patches/nginx-fix-pidfile.patch +++ /dev/null @@ -1,85 +0,0 @@ -Description: Fix NGINX pidfile handling -Author: Tj -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864 -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876365 -Last-Update: 2020-06-24 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/src/core/nginx.c -+++ b/src/core/nginx.c -@@ -340,14 +340,21 @@ - ngx_process = NGX_PROCESS_MASTER; - } - -+ /* tell-tale to detect if this is parent or child process */ -+ ngx_int_t child_pid = NGX_BUSY; -+ - #if !(NGX_WIN32) - - if (ngx_init_signals(cycle->log) != NGX_OK) { - return 1; - } - -+ /* tell-tale that this code has been executed */ -+ child_pid--; -+ - if (!ngx_inherited && ccf->daemon) { -- if (ngx_daemon(cycle->log) != NGX_OK) { -+ child_pid = ngx_daemon(cycle->log); -+ if (child_pid == NGX_ERROR) { - return 1; - } - -@@ -360,8 +367,19 @@ - - #endif - -- if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) { -- return 1; -+ /* If ngx_daemon() returned the child's PID in the parent process -+ * after the fork() set ngx_pid to the child_pid, which gets -+ * written to the PID file, then exit. -+ * For NGX_WIN32 always write the PID file -+ * For others, only write it from the parent process */ -+ if (child_pid < NGX_OK || child_pid > NGX_OK) { -+ ngx_pid = child_pid > NGX_OK ? child_pid : ngx_pid; -+ if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) { -+ return 1; -+ } -+ } -+ if (child_pid > NGX_OK) { -+ exit(0); - } - - if (ngx_log_redirect_stderr(cycle) != NGX_OK) { ---- a/src/os/unix/ngx_daemon.c -+++ b/src/os/unix/ngx_daemon.c -@@ -7,14 +7,17 @@ - - #include - #include -+#include - - - ngx_int_t - ngx_daemon(ngx_log_t *log) - { - int fd; -+ /* retain the return value for passing back to caller */ -+ pid_t pid_child = fork(); - -- switch (fork()) { -+ switch (pid_child) { - case -1: - ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "fork() failed"); - return NGX_ERROR; -@@ -23,7 +26,8 @@ - break; - - default: -- exit(0); -+ /* let caller do the exit() */ -+ return pid_child; - } - - ngx_parent = ngx_pid; diff --git a/debian/patches/nginx-ssl_cert_cb_yield.patch b/debian/patches/nginx-ssl_cert_cb_yield.patch deleted file mode 100644 index dfcf55c..0000000 --- a/debian/patches/nginx-ssl_cert_cb_yield.patch +++ /dev/null @@ -1,64 +0,0 @@ -Origin: https://github.com/openresty/openresty/blob/master/patches/nginx-1.21.4-ssl_cert_cb_yield.patch -# HG changeset patch -# User Yichun Zhang -# Date 1451762084 28800 -# Sat Jan 02 11:14:44 2016 -0800 -# Node ID 449f0461859c16e95bdb18e8be6b94401545d3dd -# Parent 78b4e10b4367b31367aad3c83c9c3acdd42397c4 -SSL: handled SSL_CTX_set_cert_cb() callback yielding. - -OpenSSL 1.0.2+ introduces SSL_CTX_set_cert_cb() to allow custom -callbacks to serve the SSL certificiates and private keys dynamically -and lazily. The callbacks may yield for nonblocking I/O or sleeping. -Here we added support for such usage in NGINX 3rd-party modules -(like ngx_lua) in NGINX's event handlers for downstream SSL -connections. - ---- a/src/event/ngx_event_openssl.c -+++ b/src/event/ngx_event_openssl.c -@@ -1914,6 +1914,23 @@ - return NGX_AGAIN; - } - -+#if OPENSSL_VERSION_NUMBER >= 0x10002000L -+ if (sslerr == SSL_ERROR_WANT_X509_LOOKUP) { -+ c->read->handler = ngx_ssl_handshake_handler; -+ c->write->handler = ngx_ssl_handshake_handler; -+ -+ if (ngx_handle_read_event(c->read, 0) != NGX_OK) { -+ return NGX_ERROR; -+ } -+ -+ if (ngx_handle_write_event(c->write, 0) != NGX_OK) { -+ return NGX_ERROR; -+ } -+ -+ return NGX_AGAIN; -+ } -+#endif -+ - err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0; - - c->ssl->no_wait_shutdown = 1; -@@ -2050,6 +2067,21 @@ - c->read->handler = ngx_ssl_handshake_handler; - c->write->handler = ngx_ssl_handshake_handler; - -+ if (ngx_handle_read_event(c->read, 0) != NGX_OK) { -+ return NGX_ERROR; -+ } -+ -+ if (ngx_handle_write_event(c->write, 0) != NGX_OK) { -+ return NGX_ERROR; -+ } -+ -+ return NGX_AGAIN; -+ } -+ -+ if (sslerr == SSL_ERROR_WANT_X509_LOOKUP) { -+ c->read->handler = ngx_ssl_handshake_handler; -+ c->write->handler = ngx_ssl_handshake_handler; -+ - if (ngx_handle_read_event(c->read, 0) != NGX_OK) { - return NGX_ERROR; - } diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 52e1dc4..0000000 --- a/debian/patches/series +++ /dev/null @@ -1,3 +0,0 @@ -0003-define_gnu_source-on-other-glibc-based-platforms.patch -nginx-fix-pidfile.patch -nginx-ssl_cert_cb_yield.patch diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in deleted file mode 100644 index dcbe15b..0000000 --- a/debian/po/POTFILES.in +++ /dev/null @@ -1 +0,0 @@ -[type: gettext/rfc822deb] nginx-common.templates diff --git a/debian/po/ca.po b/debian/po/ca.po deleted file mode 100644 index d9ce72d..0000000 --- a/debian/po/ca.po +++ /dev/null @@ -1,56 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Christos Trochalakis , 2016. -# Alytidae , 2017 -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2017-06-19 20:26+0100\n" -"Last-Translator: Alytidae \n" -"Language-Team: catalan \n" -"Language: ca\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "És possible que els fitxers de registre nginx siguin insegurs" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Els següents fitxers de registre, sota el directori /var/log/nginx, són " -"enllaços simbòlics propietat de www-data:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Des de la versió 1.4.4-4 de nginx, /var/log/nginx ha estat propietat de " -"www-data. A causa d'això, www-data podria tenir enllaços simbòlics d'arxius " -"de registre a ubicacions sensibles que, al seu torn, podrien donar lloc a " -"atacs d'escalada de privilegis. Encara que els permisos de /var/log/nginx " -"estan arreglats és possible que encara existeixin alguns enllaços simbòlics " -"insegurs. Per tant, assegura't de comprovar les ubicacions esmentades." diff --git a/debian/po/da.po b/debian/po/da.po deleted file mode 100644 index fcc5115..0000000 --- a/debian/po/da.po +++ /dev/null @@ -1,56 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2017 nginx og nedenstående oversættere. -# This file is distributed under the same license as the nginx package. -# Joe Hansen , 2017. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2017-01-10 17:30+01:00\n" -"Last-Translator: Joe Hansen \n" -"Language-Team: Danish \n" -"Language: da\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Nginx-logfilerne er muligvis usikre" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"De følgende logfiler under mappen /var/log/nginx er symbolske henvisninger " -"ejet af www-data:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Siden nginx 1.4.4-4 var /var/log/nginx ejet af www-data. Www-data kunne " -"derfor oprette logfiler med symbolske henvisninger til sensitive placeringer, " -"som igen kunne føre til privilegerede optrapningsangreb. Selvom " -"/var/log/nginx-rettigheder nu er rettet, så er det muligt at sådanne " -"usikre henvisninger stadig findes. Så, husk at kontrollere ovenstående " -"placeringer." diff --git a/debian/po/de.po b/debian/po/de.po deleted file mode 100644 index d33bf66..0000000 --- a/debian/po/de.po +++ /dev/null @@ -1,57 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Chrirtos Trochalakis , 2016. -# Copyright (C) of this file Chris Leick 2016. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx 1.10.2-1\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2016-11-01 10:36+0100\n" -"Last-Translator: Chris Leick \n" -"Language-Team: de \n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Möglicherweise unsichere Nginx-Protokolldateien" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Die folgenden Protokolldateien unterhalb des Verzeichnisses /var/log/nginx " -"sind symbolische Verweise, die »www-data« gehören:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Seit Nginx 1.4.4-4 gehörte /var/log/nginx »www-data«. Dies führte unter " -"anderem dazu, dass »www-data« auf Protokolldateien an vertraulichen Stellen " -"symbolisch verweisen konnte, was im Folgenden zu Rechteerweiterungsangriffen " -"führen konnte. Obwohl die Rechte an /var/log/nginx nun korrigiert sind, ist " -"es möglich, dass derartige unsichere Verweise bereits existieren. Prüfen Sie " -"daher bitte die oben genannten Orte." diff --git a/debian/po/es.po b/debian/po/es.po deleted file mode 100644 index 552ab2f..0000000 --- a/debian/po/es.po +++ /dev/null @@ -1,78 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Christos Trochalakis , 2016. -# Changes: -# - Initial translation -# Jonathan Bustillos , 2017. -# -# Traductores, si no conocen el formato PO, merece la pena leer la -# documentación de gettext, especialmente las secciones dedicadas a este -# formato, por ejemplo ejecutando: -# info -n '(gettext)PO Files' -# info -n '(gettext)Header Entry' -# -# Equipo de traducción al español, por favor lean antes de traducir -# los siguientes documentos: -# -# - El proyecto de traducción de Debian al español -# http://www.debian.org/intl/spanish/ -# especialmente las notas y normas de traducción en -# http://www.debian.org/intl/spanish/notas -# -# - La guía de traducción de po's de debconf: -# /usr/share/doc/po-debconf/README-trans -# o http://www.debian.org/intl/l10n/po-debconf/README-trans -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2017-02-07 11:07-0600\n" -"Last-Translator: Jonathan Bustillos \n" -"Language-Team: Debian Spanish \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Gtranslator 2.91.6\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Posibles archivos de registro inseguros de nginx" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Los siguientes archivos de registro en el directorio /var/log/nginx son " -"enlaces simbólicos propiedad de www-data:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Dado nginx 1.4.4-4 /var/log/nginx era propiedad de www-data. Como resultado, " -"www-data podría enlazar archivos de registro a ubicaciones sensibles, lo que " -"a su vez podría dar lugar a ataques de escalamiento de privilegios. Aunque " -"los permisos de /var/log/nginx están ahora arreglados, es posible que dichos " -"enlaces inseguros ya existan. Por lo tanto, asegúrese de comprobar las " -"ubicaciones anteriores." diff --git a/debian/po/fr.po b/debian/po/fr.po deleted file mode 100644 index 0a937cf..0000000 --- a/debian/po/fr.po +++ /dev/null @@ -1,58 +0,0 @@ -# Translation of nginx debconf templates to French -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Chrirtos Trochalakis , 2016. -# Julien Patriarca , 2016. -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2016-11-02 09:52+0100\n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Last-Translator: Julien Patriarca \n" -"Language-Team: French \n" -"X-Generator: Poedit 1.8.11\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Certains fichiers de journaux semblent non sécurisés" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Les fichiers de journaux suivants se trouvant dans le dossier /var/log/nginx " -"sont des liens symboliques qui appartiennent à www-data :" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Depuis la version 1.4.4-4 de nginx, /var/log/nginx appartient à www-data. " -"Par conséquent www-data peut faire des liens symboliques des fichiers de " -"journaux vers des emplacements sensibles, ce qui pourrait amener à des " -"attaques par augmentation de droits. Même si désormais les droits de /var/" -"log/nginx ont été sécurisés, il est possible que de tels liens existent " -"déjà. Aussi, veuillez vous assurer d'avoir contrôlé les emplacements ci-" -"dessus." diff --git a/debian/po/it.po b/debian/po/it.po deleted file mode 100644 index 245dc1b..0000000 --- a/debian/po/it.po +++ /dev/null @@ -1,56 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Christos Trochalakis , 2016. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2022-08-25 00:00+0000\n" -"Last-Translator: Ceppo \n" -"Language-Team: Italian \n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Documenti di log di nginx potenzialmente non sicuri" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"I seguenti documenti di log nel percorso /var/log/nginx sono collegamenti " -"simbolici (symlink) posseduti da www-data:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Da nginx 1.4.4-4 /var/log/nginx era posseduto da www-data. Di conseguenza " -"www-data poteva creare collegamenti simbolici (symlink) a documenti di log " -"in percorsi sensibili, il che a sua volta poteva portare ad attacchi di " -"usurpazione di privilegi. Sebbene i permessi di /var/log/nginx siano adesso " -"corretti è possibile che questi link non sicuri esistano già. Quindi, " -"controllare i percorsi indicati sopra." diff --git a/debian/po/nl.po b/debian/po/nl.po deleted file mode 100644 index 0fd1c5a..0000000 --- a/debian/po/nl.po +++ /dev/null @@ -1,60 +0,0 @@ -# Nginx debconf translation to Dutch -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Chrirtos Trochalakis , 2016. -# Frans Spiesschaert , 2016. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2016-11-08 16:30+0100\n" -"Last-Translator: Frans Spiesschaert \n" -"Language-Team: Debian Dutch l10n Team \n" -"Language: nl\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Gtranslator 2.91.6\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Wellicht onveilige nginx logbestanden" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"De volgende logbestanden in de map /var/log/nginx zijn symbolische " -"koppelingen met www-data als eigenaar:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Sinds nginx 1.4.4-4 was www-data eigenaar van /var/log/nginx. Als gevolg " -"daarvan kon www-data een symbolische koppeling maken tussen logbestanden en " -"gevoelige plaatsen, hetgeen op zijn beurt kon leiden tot aanvallen van het " -"type rechtenuitbreiding (privilege escalation). De toegangsrechten voor /var/" -"log/nginx zijn nu gerepareerd, maar het is mogelijk dat er reeds dergelijke " -"onveilige koppelingen bestaan. U moet dus zeker bovenstaande locaties " -"controleren." diff --git a/debian/po/pt.po b/debian/po/pt.po deleted file mode 100644 index c552ab3..0000000 --- a/debian/po/pt.po +++ /dev/null @@ -1,59 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Christos Trochalakis , 2016. -# Rui Branco , initial translation 2017, 2017. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx 1.10.3-1\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2017-03-14 13:59+0000\n" -"Last-Translator: Rui Branco \n" -"Language-Team: Portuguese \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Gtranslator 2.91.7\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Ficheiros de eventos (log) do nginx possivelmente inseguros" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Os seguintes ficheiros de eventos da pasta /var/log/nginx são ligações " -"simbólicas (symlinks) detidos por www-data:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Desde a versão 1.4.4-4 do nginx, o ficheiro /var/log/nginx é detido pelo www-" -"data. Como resultado o www-data pode criar ligações simbólicas de ficheiros " -"de eventos para locais sensíveis, o que poderá levar a uma escalada de " -"ataques de privilégios. Apesar das permissões de /var/log/nginx estarem " -"agora seguras, é possível que tais ligações inseguras já existam. Verifique " -"por favor os locais acima mencionados." diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po deleted file mode 100644 index 92d3a6a..0000000 --- a/debian/po/pt_BR.po +++ /dev/null @@ -1,58 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Chrirtos Trochalakis , 2016. -# Adriano Rafael Gomes , 2016. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2016-11-18 22:02-0200\n" -"Last-Translator: Adriano Rafael Gomes \n" -"Language-Team: Brazilian Portuguese \n" -"Language: pt_BR\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Possíveis arquivos de log do nginx inseguros" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Os seguintes arquivos de log sob o diretório /var/log/nginx são links " -"simbólicos de propriedade de www-data:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Desde a versão 1.4.4-4 do nginx, /var/log/nginx é de propriedade de www-" -"data. Como resultado, www-data pode criar links simbólicos dos arquivos de " -"log em locais sensíveis, o que, por sua vez, pode levar a ataques de " -"elevação de privilégio. Embora as permissões de /var/log/nginx estejam agora " -"corrigidas, é possível que tais links inseguros ainda existam. Portanto, por " -"favor, certifique-se de verificar os locais acima." diff --git a/debian/po/ro.po b/debian/po/ro.po deleted file mode 100644 index 9877cb1..0000000 --- a/debian/po/ro.po +++ /dev/null @@ -1,81 +0,0 @@ -# Mesajele în limba română pentru pachetul nginx. -# Romanian translation of nginx. -# Copyright © 2023 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Christos Trochalakis , 2016. -# -# Remus-Gabriel Chelu , 2023. -# -# Cronologia traducerii fișierului „nginx”: -# Traducerea inițială, făcută de R-GC, pentru versiunea nginx 1.22.1-7(2016-10-04). -# Actualizare a traducerii pentru versiunea Y, făcută de X, Y(anul). -# -msgid "" -msgstr "" -"Project-Id-Version: nginx 1.22.1-7\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2023-03-13 12:29+0100\n" -"Last-Translator: Remus-Gabriel Chelu \n" -"Language-Team: Romanian \n" -"Language: ro\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n==0 || (n!=1 && n%100>=1 && " -"n%100<=19) ? 1 : 2);\n" -"X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Poedit 3.2.2\n" - -# R-GC, scrie: -# după revzarea fișierului, RA spune: -# „Unele fișiere jurnal de «nginx» parsă fie nesecurizate” → „... par să ...” -# **** -# Corecție aplicată! -#. Type: note -#. Description -#: ../nginx.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Unele fișiere jurnal de «nginx» par să fie nesecurizate" - -#. Type: note -#. Description -#: ../nginx.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Următoarele fișiere jurnal din directorul „/var/log/nginx” sunt legături " -"simbolice deținute de „www-data”:" - -#. Type: note -#. Description -#: ../nginx.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -# R-GC, scrie: -# după revzarea fișierului, RA spune: -# „Deoarece până la nginx 1.4.4-4 directorul „/var/log/nginx” a fost deținut de „www-data”. Ca rezultat, „www-data” ar putea crea legături simbolice ...” -# → aici avem o fraza incompleta. Acel "deoarece" are nevoie de un efect, de exemplu: -# „Deoarece până la nginx 1.4.4-4 directorul ... a fost deținut de „www-data”, ca rezultat, ...” -# ***** -# Corecție aplicată, cu o corecție ;) → -# „... deținut de „www-data”; ca rezultat, ...” -# adică: , → ; -#. Type: note -#. Description -#: ../nginx.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-data " -"could symlink log files to sensitive locations, which in turn could lead to " -"privilege escalation attacks. Although /var/log/nginx permissions are now fixed " -"it is possible that such insecure links already exist. So, please make sure to " -"check the above locations." -msgstr "" -"Deoarece până la nginx 1.4.4-4 directorul „/var/log/nginx” a fost deținut de " -"„www-data”; ca rezultat, „www-data” ar putea crea legături simbolice a " -"fișierelor jurnal către locații sensibile, ceea ce, la rândul său, ar putea " -"duce la atacuri de escaladare a privilegiilor. Deși permisiunile directorului „/" -"var/log/nginx” sunt acum remediate, este posibil ca astfel de legături nesigure " -"să existe deja. Prin urmare, asigurați-vă că verificați locațiile de mai sus." diff --git a/debian/po/ru.po b/debian/po/ru.po deleted file mode 100644 index fdaa738..0000000 --- a/debian/po/ru.po +++ /dev/null @@ -1,59 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Christos Trochalakis , 2016. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2017-11-29 23:17+0500\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.4\n" -"Last-Translator: Lev Lamberov \n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"Language: ru\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Возможно небезопасные файлы журналов nginx" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Следующие файлы журналов в каталоге /var/log/nginx представляют собой " -"символьные ссылки, владельцем которых является www-data:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Начиная с версии 1.4.4-4 владельцем /var/log/nginx является www-data. В " -"результате www-data может создавать символьные ссылки, указывающие на " -"чувствительные файлы, что, в свою очередь, может приводить к повышению " -"привилегий. Хотя права доступа к /var/log/nginx в настоящее время " -"исправлены, вполне вероятно, что такие небезопасные ссылки уже существуют. " -"Поэтому обязательно проверьте приведённый выше каталог." diff --git a/debian/po/sv.po b/debian/po/sv.po deleted file mode 100644 index 152e111..0000000 --- a/debian/po/sv.po +++ /dev/null @@ -1,58 +0,0 @@ -# Swedish translation of nginx debconf messages -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Christos Trochalakis , 2016. -# Peter Kvillegård , 2023. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx 1.24.0-1\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: 2023-08-21 19:01+0200\n" -"Last-Translator: Peter Kvillegård \n" -"Language-Team: Swedish \n" -"Language: sv\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 3.2.2\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Möjligen osäkra loggfiler för nginx" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"Följande loggfiler i katalogen /var/log/nginx är symboliska länkar som ägs " -"av www-data:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"Före nginx 1.4.4-4 ägdes /var/log/nginx av www-data, vilket innebar att www-" -"data kunde skapa loggfiler som var symboliska länkar till känsliga platser, " -"vilket i sin tur kunde leda till behörighetsintrång. Även om rättigheterna " -"för /var/log/nginx är fixade nu så är det möjligt att sådana osäkra länkar " -"finns kvar. Se till att kontrollera ovan nämnda platser." diff --git a/debian/po/templates.pot b/debian/po/templates.pot deleted file mode 100644 index 9260ff1..0000000 --- a/debian/po/templates.pot +++ /dev/null @@ -1,49 +0,0 @@ -# Nginx debconf translations -# Copyright (C) 2016 Christos Trochalakis -# This file is distributed under the same license as the nginx package. -# Christos Trochalakis , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2016-10-04 20:03+0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" diff --git a/debian/po/tr.po b/debian/po/tr.po deleted file mode 100644 index 3e9d40b..0000000 --- a/debian/po/tr.po +++ /dev/null @@ -1,57 +0,0 @@ -# nginx turkish debconf translations -# This file is distributed under the same license as the nginx package. -# Atila KOÇ , 2018. -# -msgid "" -msgstr "" -"Project-Id-Version: nginx\n" -"Report-Msgid-Bugs-To: nginx@packages.debian.org\n" -"POT-Creation-Date: 2018-11-08 18:08+0300\n" -"PO-Revision-Date: 2018-11-28 14:50+0300\n" -"Last-Translator: Atila KOÇ \n" -"Language-Team: none\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.11\n" -"Language: tr\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "Possible insecure nginx log files" -msgstr "Güvenliği sağlanmamış nginx günlük dosyaları olabilir" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"The following log files under /var/log/nginx directory are symlinks owned by " -"www-data:" -msgstr "" -"/var/log/nginx dizini altında bulunan aşağıdaki günlük dosyaları sahibi www-" -"data olan sembolik bağlantılardır:" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "${logfiles}" -msgstr "${logfiles}" - -#. Type: note -#. Description -#: ../nginx-common.templates:1001 -msgid "" -"Since nginx 1.4.4-4 /var/log/nginx was owned by www-data. As a result www-" -"data could symlink log files to sensitive locations, which in turn could " -"lead to privilege escalation attacks. Although /var/log/nginx permissions " -"are now fixed it is possible that such insecure links already exist. So, " -"please make sure to check the above locations." -msgstr "" -"nginx'in 1.4.4-4 ve sonraki sürümlerinde /var/log/nginx dizininin sahibi www-" -"data idi. Bu nedenle www-data hassas konumlardaki sistem günlüklerine erişen " -"sembolik bağlantılara sahip olabiliyor ve bu durum ayrıcalık kazanma yolu " -"ile yapılabilecek saldırılara olanak sağlayabiliyordu. Artık /var/log/nginx " -"dizininin erişim hakları düzeltilmiş olsa da güvenliği sağlanmamış " -"bağlantılar kalmış olabilir. Lütfen yukarıdaki konumları gözden geçiriniz." diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 7b56607..0000000 --- a/debian/rules +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/make -f -export DH_VERBOSE=1 - -export DEB_BUILD_MAINT_OPTIONS=hardening=+all -debian_cflags:=$(shell dpkg-buildflags --get CFLAGS) -fPIC $(shell dpkg-buildflags --get CPPFLAGS) -debian_ldflags:=$(shell dpkg-buildflags --get LDFLAGS) -fPIC - -FLAVOURS := bin - -BASEDIR = $(CURDIR) -$(foreach flavour,$(FLAVOURS) src ,$(eval BUILDDIR_$(flavour) = $(CURDIR)/debian/build-$(flavour))) - -DEB_BUILD_ARCH ?=$(shell dpkg-architecture -qDEB_BUILD_ARCH) -ifeq ($(DEB_BUILD_ARCH),sparc) - debian_cflags += -m32 -mcpu=ultrasparc -endif - -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - MAKEFLAGS += -j$(NUMJOBS) -endif - -# configure flags -basic_configure_flags := \ - --prefix=/usr/share/nginx \ - --conf-path=/etc/nginx/nginx.conf \ - --http-log-path=/var/log/nginx/access.log \ - --error-log-path=stderr \ - --lock-path=/var/lock/nginx.lock \ - --pid-path=/run/nginx.pid \ - --modules-path=/usr/lib/nginx/modules \ - --http-client-body-temp-path=/var/lib/nginx/body \ - --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ - --http-proxy-temp-path=/var/lib/nginx/proxy \ - --http-scgi-temp-path=/var/lib/nginx/scgi \ - --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ - --with-compat \ - --with-debug \ - --with-pcre-jit \ - --with-http_ssl_module \ - --with-http_stub_status_module \ - --with-http_realip_module \ - --with-http_auth_request_module \ - --with-http_v2_module \ - --with-http_v3_module \ - --with-http_dav_module \ - --with-http_slice_module \ - --with-threads - -common_configure_flags := \ - --with-cc-opt="$(debian_cflags)" \ - --with-ld-opt="$(debian_ldflags)" \ - $(basic_configure_flags) - -bin_configure_flags := \ - $(common_configure_flags) \ - --with-http_addition_module \ - --with-http_flv_module \ - --with-http_gunzip_module \ - --with-http_gzip_static_module \ - --with-http_mp4_module \ - --with-http_random_index_module \ - --with-http_secure_link_module \ - --with-http_sub_module \ - --with-mail_ssl_module \ - --with-stream_ssl_module \ - --with-stream_ssl_preread_module \ - --with-stream_realip_module \ - --with-http_geoip_module=dynamic \ - --with-http_image_filter_module=dynamic \ - --with-http_perl_module=dynamic \ - --with-http_xslt_module=dynamic \ - --with-mail=dynamic \ - --with-stream=dynamic \ - --with-stream_geoip_module=dynamic - -%: - dh $@ --without autoreconf - -override_dh_auto_configure: $(foreach flavour,$(FLAVOURS),config.arch.$(flavour)) config.src -override_dh_auto_build: $(foreach flavour,$(FLAVOURS),build.arch.$(flavour)) build.src -override_dh_clean: $(foreach flavour,$(FLAVOURS),clean.$(flavour)) clean.src - dh_clean - -override_dh_install: - dh_install - DH_AUTOSCRIPTDIR=$(CURDIR)/debian/autoscripts debian/debhelper/dh_nginx --in-nginx-tree - -override_dh_installinit: - dh_installinit --no-stop-on-upgrade --no-start --name=nginx - -override_dh_installsystemd: - dh_installsystemd --name=nginx - -override_dh_installlogrotate: - dh_installlogrotate --package nginx-common --name=nginx - -override_dh_gencontrol: - dh_gencontrol -- -Tdebian/substvars -Tdebian/libnginx-mod.abisubstvars - -build.arch.%: - $(MAKE) -C $(BUILDDIR_$*) build - -build.src: - cp -Pa $(CURDIR)/auto $(BUILDDIR_src)/ - sed -i '/^# create Makefile/,/^END$$/d' $(BUILDDIR_src)/auto/make $(BUILDDIR_src)/auto/init $(BUILDDIR_src)/auto/install - find $(CURDIR)/src -type f -name '*.h' -printf 'src/%P\0' | tar -C $(CURDIR) --null --files-from - -c | tar -C $(BUILDDIR_src)/ -x - if [ -e $(CURDIR)/configure ]; then cp $(CURDIR)/configure $(BUILDDIR_src)/; fi - echo "NGX_CONF_FLAGS=(" $(basic_configure_flags) ")" > $(BUILDDIR_src)/conf_flags - pod2man debian/debhelper/dh_nginx > $(BUILDDIR_src)/dh_nginx.1 - -config.arch.%: - dh_testdir - mkdir -p $(BUILDDIR_$*) - cp -Pa $(CURDIR)/auto $(BUILDDIR_$*)/ - cp -Pa $(CURDIR)/conf $(BUILDDIR_$*)/ - cp -Pa $(CURDIR)/configure $(BUILDDIR_$*)/ - cp -Pa $(CURDIR)/contrib $(BUILDDIR_$*)/ - cp -Pa $(CURDIR)/src $(BUILDDIR_$*)/ - cp -Pa $(CURDIR)/man $(BUILDDIR_$*)/ - cd $(BUILDDIR_$*) && ./configure $($*_configure_flags) - -config.src: - dh_testdir - mkdir -p $(BUILDDIR_src) - -clean.%: - rm -rf $(BUILDDIR_$*) diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/debian/tests/control b/debian/tests/control deleted file mode 100644 index b8c6569..0000000 --- a/debian/tests/control +++ /dev/null @@ -1,151 +0,0 @@ -Tests: light-simple -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-light, curl - -Tests: ec-x25519 -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-light, ssl-cert, curl - -Tests: core-simple -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-core, curl - -Tests: full-simple -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-full, curl - -Tests: extras-simple -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-extras, curl - -Tests: core-module-deps -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-core, - curl, - libnginx-mod-http-auth-pam, - libnginx-mod-http-cache-purge, - libnginx-mod-http-dav-ext, - libnginx-mod-http-echo, - libnginx-mod-http-fancyindex, - libnginx-mod-http-geoip, - libnginx-mod-http-geoip2, - libnginx-mod-http-headers-more-filter, - libnginx-mod-http-image-filter, - libnginx-mod-http-lua [amd64 arm64 armel armhf i386 mips64el mipsel s390x riscv64 powerpc], - libnginx-mod-http-perl, - libnginx-mod-http-subs-filter, - libnginx-mod-http-uploadprogress, - libnginx-mod-http-upstream-fair, - libnginx-mod-http-xslt-filter, - libnginx-mod-mail, - libnginx-mod-nchan, - libnginx-mod-rtmp, - libnginx-mod-stream-geoip, - libnginx-mod-stream-geoip2, - libnginx-mod-stream, - libnginx-mod-http-set-misc, - libnginx-mod-http-brotli-filter, - libnginx-mod-http-brotli-static, - libnginx-mod-http-memc, - libnginx-mod-http-srcache-filter, - -Tests: full-module-deps -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-full, - curl, - libnginx-mod-http-auth-pam, - libnginx-mod-http-cache-purge, - libnginx-mod-http-dav-ext, - libnginx-mod-http-echo, - libnginx-mod-http-fancyindex, - libnginx-mod-http-geoip, - libnginx-mod-http-geoip2, - libnginx-mod-http-headers-more-filter, - libnginx-mod-http-image-filter, - libnginx-mod-http-lua [amd64 arm64 armel armhf i386 mips64el mipsel s390x riscv64 powerpc], - libnginx-mod-http-perl, - libnginx-mod-http-subs-filter, - libnginx-mod-http-uploadprogress, - libnginx-mod-http-upstream-fair, - libnginx-mod-http-xslt-filter, - libnginx-mod-mail, - libnginx-mod-nchan, - libnginx-mod-rtmp, - libnginx-mod-stream-geoip, - libnginx-mod-stream-geoip2, - libnginx-mod-stream, - libnginx-mod-http-set-misc, - libnginx-mod-http-brotli-filter, - libnginx-mod-http-brotli-static, - libnginx-mod-http-memc, - libnginx-mod-http-srcache-filter, - -Tests: light-module-deps -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-light, - curl, - libnginx-mod-http-auth-pam, - libnginx-mod-http-cache-purge, - libnginx-mod-http-dav-ext, - libnginx-mod-http-echo, - libnginx-mod-http-fancyindex, - libnginx-mod-http-geoip, - libnginx-mod-http-geoip2, - libnginx-mod-http-headers-more-filter, - libnginx-mod-http-image-filter, - libnginx-mod-http-lua [amd64 arm64 armel armhf i386 mips64el mipsel s390x riscv64 powerpc], - libnginx-mod-http-perl, - libnginx-mod-http-subs-filter, - libnginx-mod-http-uploadprogress, - libnginx-mod-http-upstream-fair, - libnginx-mod-http-xslt-filter, - libnginx-mod-mail, - libnginx-mod-nchan, - libnginx-mod-rtmp, - libnginx-mod-stream-geoip, - libnginx-mod-stream-geoip2, - libnginx-mod-stream, - libnginx-mod-http-set-misc, - libnginx-mod-http-brotli-filter, - libnginx-mod-http-brotli-static, - libnginx-mod-http-memc, - libnginx-mod-http-srcache-filter, - -Tests: extras-module-deps -Restrictions: allow-stderr isolation-container needs-root -Depends: nginx-extras, - curl, - libnginx-mod-http-auth-pam, - libnginx-mod-http-cache-purge, - libnginx-mod-http-dav-ext, - libnginx-mod-http-echo, - libnginx-mod-http-fancyindex, - libnginx-mod-http-geoip, - libnginx-mod-http-geoip2, - libnginx-mod-http-headers-more-filter, - libnginx-mod-http-image-filter, - libnginx-mod-http-lua [amd64 arm64 armel armhf i386 mips64el mipsel s390x riscv64 powerpc], - libnginx-mod-http-perl, - libnginx-mod-http-subs-filter, - libnginx-mod-http-uploadprogress, - libnginx-mod-http-upstream-fair, - libnginx-mod-http-xslt-filter, - libnginx-mod-mail, - libnginx-mod-nchan, - libnginx-mod-rtmp, - libnginx-mod-stream-geoip, - libnginx-mod-stream-geoip2, - libnginx-mod-stream, - libnginx-mod-http-set-misc, - libnginx-mod-http-brotli-filter, - libnginx-mod-http-brotli-static, - libnginx-mod-http-memc, - libnginx-mod-http-srcache-filter, - -Tests: reboot -Restrictions: isolation-container, needs-root, needs-reboot -Depends: nginx-light, curl - -Tests: ssi-module-test -Restrictions: allow-stderr, isolation-container, needs-root, -Depends: nginx, nginx-core, curl diff --git a/debian/tests/core-module-deps b/debian/tests/core-module-deps deleted file mode 120000 index df999dd..0000000 --- a/debian/tests/core-module-deps +++ /dev/null @@ -1 +0,0 @@ -generic \ No newline at end of file diff --git a/debian/tests/core-simple b/debian/tests/core-simple deleted file mode 120000 index df999dd..0000000 --- a/debian/tests/core-simple +++ /dev/null @@ -1 +0,0 @@ -generic \ No newline at end of file diff --git a/debian/tests/ec-x25519 b/debian/tests/ec-x25519 deleted file mode 100644 index edd4e2f..0000000 --- a/debian/tests/ec-x25519 +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -e - - -rm /etc/nginx/sites-enabled/default -cat < "/etc/nginx/sites-enabled/ssl" -server { - listen 443 default_server ssl; - include snippets/snakeoil.conf; - - ssl_ecdh_curve X25519; - location / { - return 200; - } -} -EOF - -nginx -t -invoke-rc.d nginx restart -curl --insecure --silent --fail -o /dev/null -w "response_code: %{http_code}\n" https://127.0.0.1/ diff --git a/debian/tests/extras-module-deps b/debian/tests/extras-module-deps deleted file mode 120000 index df999dd..0000000 --- a/debian/tests/extras-module-deps +++ /dev/null @@ -1 +0,0 @@ -generic \ No newline at end of file diff --git a/debian/tests/extras-simple b/debian/tests/extras-simple deleted file mode 120000 index df999dd..0000000 --- a/debian/tests/extras-simple +++ /dev/null @@ -1 +0,0 @@ -generic \ No newline at end of file diff --git a/debian/tests/full-module-deps b/debian/tests/full-module-deps deleted file mode 120000 index df999dd..0000000 --- a/debian/tests/full-module-deps +++ /dev/null @@ -1 +0,0 @@ -generic \ No newline at end of file diff --git a/debian/tests/full-simple b/debian/tests/full-simple deleted file mode 120000 index df999dd..0000000 --- a/debian/tests/full-simple +++ /dev/null @@ -1 +0,0 @@ -generic \ No newline at end of file diff --git a/debian/tests/generic b/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/debian/tests/light-module-deps b/debian/tests/light-module-deps deleted file mode 120000 index df999dd..0000000 --- a/debian/tests/light-module-deps +++ /dev/null @@ -1 +0,0 @@ -generic \ No newline at end of file diff --git a/debian/tests/light-simple b/debian/tests/light-simple deleted file mode 120000 index df999dd..0000000 --- a/debian/tests/light-simple +++ /dev/null @@ -1 +0,0 @@ -generic \ No newline at end of file diff --git a/debian/tests/reboot b/debian/tests/reboot deleted file mode 100644 index a90a6c9..0000000 --- a/debian/tests/reboot +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# 20220710 -# Jan Mojzis -# Public domain - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -# do simple curl -curl --silent --fail -o /dev/null -w "response_code: %{http_code}\n" http://127.0.0.1/ - -# test if nginx runs after reboot -if [ x"${AUTOPKGTEST_REBOOT_MARK}" = x ]; then - /tmp/autopkgtest-reboot rebootmark -fi diff --git a/debian/tests/ssi-module-test b/debian/tests/ssi-module-test deleted file mode 100644 index 6ebd090..0000000 --- a/debian/tests/ssi-module-test +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - root /var/www/html; - - location /loc1.html { - add_after_body /loc2.html; - } - - location /loc2.html { - ssi on; - } -} -EOF -mkdir -p /var/www/html -echo '

Hi from location 1 !

' > /var/www/html/loc1.html -echo '

Hi from location 2 on !

' > /var/www/html/loc2.html - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/loc1.html diff --git a/debian/ufw/nginx b/debian/ufw/nginx deleted file mode 100644 index ad886ba..0000000 --- a/debian/ufw/nginx +++ /dev/null @@ -1,19 +0,0 @@ -[Nginx HTTP] -title=Web Server (Nginx, HTTP) -description=Small, but very powerful and efficient web server -ports=80/tcp - -[Nginx HTTPS] -title=Web Server (Nginx, HTTPS) -description=Small, but very powerful and efficient web server -ports=443/tcp - -[Nginx Full] -title=Web Server (Nginx, HTTP + HTTPS) -description=Small, but very powerful and efficient web server -ports=80,443/tcp - -[Nginx QUIC] -title=Web Server (Nginx, HTTP + HTTPS + QUIC) -description=Small, but very powerful and efficient web server -ports=80,443/tcp|443/udp diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc deleted file mode 100644 index 52abfd2..0000000 --- a/debian/upstream/signing-key.asc +++ /dev/null @@ -1,257 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBGZXLBYBEACxv3nUIdUtFCpH1G4hBB+eVSsWwnHVTDtSYfINHmN8dQfyGy22 -XcX2DR6ZW9/I5e06McAz4e3hTuhD5+sF7zv4Dd/xEqxpra08liVvB3QlJ6kawBJa -Bn29s/N/A06yUrOVC1ZjhpDLshaHeyHjWDVLUX9ibLx1N3BQoeoH/5lgTmfF4JPk -LfnTMwHWQ5phT52MVE+B/XExldIPAn27m2ZfXHXnSUMKCRybQNypBiIp6OBfirwa -pyjaRO1AajwalSkbSV9o/fL3liluv1HimQ11/5y0rxMdi+aaeca9oA4Gvfdh/biO -MYcTeiZx72BKqDwMfJVXSjQ8XOYbfCjWp8dNkS5Yd4bmX+ITXRkZHqQxgmoKWr7B -9/i+asColt/qqsQ6PROa2y86TbQSfn/HM8L6c85BkJrI41abJ2QHShVzpk0e/464 -hqxvnAZCrmdM+GBSuYfDDqHHHgxhIzHnKnyRX/MtfhZA/CUFUOe+m6j214KKtkMQ -6EpZzgH52FFD6Vi1NkQvfYx5pqEdmJfRKR9ABf8fYI8U8ryNgIq7f13bwoX4haZy -ql/fC4lTG6OEppgdQe7afyAmdi7G/w1pMcbz5Wwp91R+1372XifynBdeTrUsbK25 -P42TH3OADC2Id+MaaGh1AjY1bFifOGRf48rnrcMn0Q4Lw3l56wgjou4MUQARAQAB -tCtuZ2lueCBzaWduaW5nIGtleSA8c2lnbmluZy1rZXktMkBuZ2lueC5jb20+iQIi -BBMBCgAWBQJmVywWCRAv0hMQtJ9rRgIbAwIZAQAAq08P/jeIVEj9/cJFzdOeBqjg -F9DNZljkR+2z5UAkQSHfkzWgHRbdAnjT1bc/ltLi6w/z/97kOZhaiSx6TLRg2mX/ -5nuC4KijhT9rNc/d5j/BHS4U7lFK8c5ED5wxGvJZcF0VCSfeaiuxoO3QiNYX1iiD -qEyJ1XL/XHd7LjJ4gKxsohKL1rRLSuvtOkK799YArNit5ueATDWW6EUSZaxOiMNz -MaQFMEkjoiPVlj7jNwZN7KHNXkaJjiER0kmJ9XWDtkgSHOZrUNX2PHJpxxCtQj7d -YpOFM/DHvNUZ9dHXm3Ioo3R/MUcC4mbZpAvs4YwZ/yRqov/MX4WEUtvcCY36EL5t -hUDK09huMMBLBdM0jgVLsJnXn5ksMdVkpgFyeR/SKEaUTmQrgkCIwqvRxDegAkNN -lmAiNhxdKD+CrWws+EzQYOeWVRUO9aHKC5ttwhhQuxyvmNgoAMhd8x8Tcm7grC/m -ZOqYWzpEWd1DEyi9jaTkhrSWMd5jc5lvCwOHDRzVi1HmIJy+cybPbQpkbFY6vj/7 -shx2Aa+QKRJs+33Ztg0drc3j+mDk9NJQy0KPIbqee0gy0pmaKNiJOxdIWI6ra3cM -3lh5OG+CGakga1X9YiCWv4/OgDYY/6cFTqEN0wXruFLNZ7P4iowJgPU1KZauvDZl -gfsgBoKJ35Nf6p9PdjcjcyW5iQEzBBABCAAdFiEEcziXMGntP0Q/TTffpk/VsXrb -OagFAmZXLlcACgkQpk/VsXrbOaiWowgAvU9HwLkK74VGjosmPpcjurRowUp+/KOA -HmIro2wQ6JVlUrSL2Rz+RIBJ1BKTgGnVZznkXywXHWK2LI4nL3aDoAuyyrzQk1pj -hO1ZJGJBvh9Zq/kGRgEdlTe2sXVX2G7fr4fhd6BcYYvUBQ5OWR6Hh6uS+G1QVw0y -Lu5Gp+7kyolyH6iYlgvxseche+EIqBPyHe5fyb1t8Zcu1uHoQHj9O90FvJSbq4dR -d0tTlqK1tDklT+Aod2UobBCurn45udjiAKtzH6Bg2dvF/oY4udSC9/HgNPbm7JuY -clEaLukWMdFOCEj9Xr6krHtUh7zTiU6pHvUL2SYMPhsJj6AKZRg52IkBMwQQAQgA -HRYhBFc7/Ws9j7xkEHmmq6v1vYJ72b9iBQJmVz0rAAoJEKv1vYJ72b9iVTwH/Awq -vgnXbJ5mCGbLdQgrDoUYe+1nw/qWbl7Hpn/px55BEIW5S0itI50c9sOS2QFQMdRh -YVqZ+YH4aH5pDNW2kFik4Y+CFoJI9QkrEUx66PYIMu3RVBEE7/HQEwND/IbEAeMg -PpGQdEfEDD8kevlinJTyDXJ3dfBa6HEDpK0wDYrBx3mbHP7ouACsZcxqSdx4kOyv -U2Xvlc5pVRsdvJ7AsVRhRaRdSO8YlqU1Ue/OM/Ejj+GZ1Qo8EDge5887HiY8gcjy -J4FS1n2+3839n990s5xDCFSB1G8KmwgkfbkS6gEpA5wf9nk3tiSPS+HMfjMb50GJ -SayUVrAyUupv/Sxvyo+JAjMEEAEIAB0WIQTWeGzjA9mpAimY3GzIRk1UmvdcCgUC -ZldKbQAKCRDIRk1UmvdcCn6EEACUhtMnJGtrunotTwywt/jfkqexA+lhQ+S9V5eF -IIK6Tlq1asFy0s+twYJBQzTXt+hmL8GrBgeQp26CA8wrbxmnUOrXO1K9ksaXXjj0 -SRo9Xr/flCmeFKFRSSVy18UZVwf1vftFwF2lQspU+xZmj7vgr+2vKa3Z+81J8tHw -3/Sc5pt3EGB8GeCiEThe3zr49KpANejy/7feASSS+BBBUbNqnCFImfwLJ2V99mGx -GdejudbTYEXsn6jyVWTeKBcaLM4ArS20O0DJkqBcVC1Ymq+K3AGmKnrLJXDSwaV/ -+yv5pyqApf6Lu9tx7wy6upBop8KroB9xiTN5UIiYhwtHBlpOLkmXB7K549CYX34y -aOHJjez8Txn1bDhbCOe8WOnPEDI8V4RQBr0/xePru6lfwSmSriquVuBGZSir6qxA -1folqrEuoF5aEuxFper6yC/zfVP85znqBOh8OaYTGBeb622UswzLTbW4y2M3E9Ws -KhaXzTqXgIn3INCJLCv4CHiGQQB6zN6meGdOkEV0IaZvq3O4iZOAVFmKbN3GZcKT -Kjxq295LNO15c0WCauik3FRjSppyvcAqoCEbr+LVAX3/ZV3oELhQPnkZCuAFQUB+ -LKxTcTEIdjFKrPEvDgXLL9CNe747ANcLCV02SRRGYnfQ1aoxJNQlzbFw0unHjyDk -vKcD44kBswQQAQgAHRYhBBPIKmO2A1dhVuMKTqDqmBtmsNlnBQJmV1HlAAoJEKDq -mBtmsNlni3gMALfZSqIL7v66dMyjLQR81G4o6rEAixTuFc3B8xDmWDHKIjmdRMTN -mm2KGz0CG7VjdHSe3oOBYok4fDVS0o636EOxndOHszuB9cfhMMXNDFi4T1xcZCLm -UTdXCH88cagwTf6REsbfuXF8WiFemNNiPzMzLmnTlUe7Va2t+gKD/Q9vSlDLKz66 -IZBMdDoAHDKHZTtvwlAKswnpO0cDIeZjO0C1+YFLLSJ1nYQbh6mH+hJvNLimWPKR -ZQCPAa5w0Gutz91cE9nv03yg3FMcjlEgklQ77g/nGGFJnQHAeMhfgUUfPLx1rI9/ -5NON5w7Wf3PXOlTYWO25ieUVKESu8dUCFktKRMnzauej2vjnQlMFG0upzw8dhytn -E83WanvRzVynanK38PCNYQ3INsydN3wvJNetHpBdpyPfOa61dOUtu1TBvV80qcBR -wIe6vbWZx0WB59b3KV8Sc68j8OJxF6i3E0IRby4f0hcoqogBkry0NPK/rtL2HHnN -vcV0wl+DODz9hw== -=oWlI ------END PGP PUBLIC KEY BLOCK----- ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQENBE5OMmIBCAD+FPYKGriGGf7NqwKfWC83cBV01gabgVWQmZbMcFzeW+hMsgxH -W6iimD0RsfZ9oEbfJCPG0CRSZ7ppq5pKamYs2+EJ8Q2ysOFHHwpGrA2C8zyNAs4I -QxnZZIbETgcSwFtDun0XiqPwPZgyuXVm9PAbLZRbfBzm8wR/3SWygqZBBLdQk5TE -fDR+Eny/M1RVR4xClECONF9UBB2ejFdI1LD45APbP2hsN/piFByU1t7yK2gpFyRt -97WzGHn9MV5/TL7AmRPM4pcr3JacmtCnxXeCZ8nLqedoSuHFuhwyDnlAbu8I16O5 -XRrfzhrHRJFM1JnIiGmzZi6zBvH0ItfyX6ttABEBAAG0KW5naW54IHNpZ25pbmcg -a2V5IDxzaWduaW5nLWtleUBuZ2lueC5jb20+iQE+BBMBAgAoBQJOTjJiAhsDBQkJ -ZgGABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRCr9b2Ce9m/YpvjB/98uV4t -94d0oEh5XlqEZzVMrcTgPQ3BZt05N5xVuYaglv7OQtdlErMXmRWaFZEqDaMHdniC -sF63jWMd29vC4xpzIfmsLK3ce9oYo4t9o4WWqBUdf0Ff1LMz1dfLG2HDtKPfYg3C -8NESud09zuP5NohaE8Qzj/4p6rWDiRpuZ++4fnL3Dt3N6jXILwr/TM/Ma7jvaXGP -DO3kzm4dNKp5b5bn2nT2QWLPnEKxvOg5Zoej8l9+KFsUnXoWoYCkMQ2QTpZQFNwF -xwJGoAz8K3PwVPUrIL6b1lsiNovDgcgP0eDgzvwLynWKBPkRRjtgmWLoeaS9FAZV -ccXJMmANXJFuCf26iQFVBBMBCAA/AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIX -gBYhBFc7/Ws9j7xkEHmmq6v1vYJ72b9iBQJmULK1BQkdphrTAAoJEKv1vYJ72b9i -2+AH/RSX5voZXtSAl0fxVc9GDrGesOsykkSELnailOkWiFEHZS842U1EQst9Omki -OC14xk9fY36gK8bxXnLwww4hnnh/fpj7vJkJpVCi2uO3RKizyN6rp+7xbZ2lCKfp -5tsDg5U4iaaziTNtb4ISq79gLmLY/gqBwGksRozmChsl2QOVgg0KDTI5TP+41IwW -AFuO+XzHZ7OEegxwHta65KeVNipYjCarTRcRhGxA0rpLdBynkZ/OaI5+J6UZVfna -2eyDgHPlMo+v12+g/wOFOwShVWo4PwIsZw1jzBCLhspgezn7IolQFMHtVxCJAkgw -XhLgogChbe885HzTB6GlMowXclGJATMEEAEIAB0WIQRzOJcwae0/RD9NN9+mT9Wx -ets5qAUCZlcuRQAKCRCmT9Wxets5qD1GB/4/NIcvCRj3LvFbrtmtbExBoBP6Hv/8 -U4wUpuJbAAxImJ9uNKKaH+cmvoshkWTSUBXTvNjAQW3SM9oW+V3G7wicUtH+7cnd -xExuqf5e6f6IGqKCgrV25g0WWvJZG6ynMDDkgnyu3fTE7GkVKwoWQ6qV6Akar8oV -29P+xe2U7AWPvw+O+SBghl32x8DA/nUjIyLbvBQuXb6BjHOxrTw3WOJDfwHwOyMd -P7NHe7RE70cSj/TNabuNw9c31H0+PAj+UWfvgs5diPVJ9Fd/PK4pWQoh/4poMEbc -/1Ol0G7SItUKO6v4aHn89g00xnqUxrfwbCWCEF9EjnfFtlsDbGSWIdz8iQE+BBMB -AgAoAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAUCV2K1+AUJGB4fQQAKCRCr -9b2Ce9m/YloaB/9XGrolkocm7l/tsVjaBQCteXKuwsm4XhCuAQ6YAwA1L1UheGOG -/aa2xJvrXE8X32tgcTjrKoYoXWcdxaFjlXGTt6jV85qRguUzvMOxxSEM2Dn115et -N9piPl0Zz+4rkx8+2vJGF+eMlruPXg/zd88NvyLq5gGHEsFRBMVufYmHtNfcp4ok -C1klWiRIRSdp4QY1wdrN1O+/oCTl8Bzy6hcHjLIq3aoumcLxMjtBoclc/5OTioLD -wSDfVx7rWyfRhcBzVbwDoe/PD08AoAA6fxXvWjSxy+dGhEaXoTHjkCbz/l6NxrK3 -JFyauDgU4K4MytsZ1HDiMgMW8hZXxszoICTTiQEcBBABAgAGBQJOTkelAAoJEKZP -1bF62zmo79oH/1XDb29SYtWp+MTJTPFEwlWRiyRuDXy3wBd/BpwBRIWfWzMs1gnC -jNjk0EVBVGa2grvy9JtxJKMd6l/PWXVucSt+U/+GO8rBkw14SdhqxaS2l14v6gyM -eUrSbY3XfToGfwHC4sa/Thn8X4jFaQ2XN5dAIzJGU1s5JA0tjEzUwCnmrKmyMlXZ -aoQVrmORGjCuH0I0aAFkRS0UtnB9HPpxhGVbs24xXZQnZDNbUQeulFxS4uP3OLDB -AeCHl+v4t/uotIad8v6JSO93vc1evIje6lguE81HHmJn9noxPItvOvSMb2yPsE8m -H4cJHRTFNSEhPW6ghmlfWa9ZwiVX5igxcvaIRgQQEQIABgUCTk5b0gAKCRDs8OkL -LBcgg1G+AKCnacLb/+W6cflirUIExgZdUJqoogCeNPVwXiHEIVqithAM1pdY/gca -QZmIRgQQEQIABgUCTk5fYQAKCRCpN2E5pSTFPnNWAJ9gUozyiS+9jf2rJvqmJSeW -uCgVRwCcCUFhXRCpQO2YVa3l3WuB+rgKjsSJAjMEEAEIAB0WIQTWeGzjA9mpAimY -3GzIRk1UmvdcCgUCZldKdQAKCRDIRk1UmvdcCj1hEACv1XfhwpsBPVNzcfzMIpfY -xAQF28m/VFLwD8FYKoVgb4rF2wLBtt9kaoPZxphEvV/FWHhpa3Tyr3L320r6sVk2 -5Ou6G/AH6kNF6vYn98chEmbCc7DE2B03G1HFFuRSOmp0ZwafJ6MYUhjpDrf6fFDL -fmdkr/hjLwCYvFQsHXYiIWDFBPZ6RvVC6ozbdFr4eWj+CIPZM4jcGTgSI/u67tC6 -8tOdX4a8/ujdkLDjyf2xgbWT8ZxY3o0fvfLFEQVpNMUsYtiW/kTPBsq48Gq2BWow -/2Ld86KjgBOyElnVy9kMLCB4d/DPnSdBkjHzWWDx2c/PDGWIGnES6O7NYvRQ9Sr0 -bQwtr70nvai2OkpYVszVwOqyr4vDeTIt0GFKOMRDRrscVGmlGr2mpExiCEgGyAjR -Z/aZDCzEnsswfJ+6IARYzE5nB3+pbJnzQNvj9r/YL8T9HkWID4sWJnnNmaFoWEMF -m+yvI8vyVMGPSqfVtN9pEpx/pzV/Q525nFYuUlEsqGgaDydnwe6AV9gZsRyA+YjE -H3gI1gxGwRyupldmstzoYzTktb4o1KL/vGj/onUIk8mFKx8p1X9VPWW0+8LqnAYf -Ui3jDoXE/9avsF6ipS7y1k8ga81z01NOvuhai3c9pvMAIYrNTvoQVz8vTIOtJac1 -PEoU6jdm8blCt2UjGp8A4okBswQQAQgAHRYhBBPIKmO2A1dhVuMKTqDqmBtmsNln -BQJmV1HrAAoJEKDqmBtmsNlntoEMANBPdskGMrU4ZxHMlOTd1JX74ucp5jez0Y2o -bwlxOiWroraYVBnWT9v150kNf1Tb5mDxi820qebiSPZxhlI1Kj7NrPFNxQkhhNzN -7Xr/M9OGpkwxosEpcMAiWfofyAdrnwos+MA/edu/EoyVRs6zpo75nP9GKUZwVcjH -KtvPMojkZYpxjxsio0aK8LW8VwDtsbwPIXDIHzE7sxUvThrMdXumrh7gKqaC6gep -HZB2lL5ES0kVE3/yjZR1khmcmF1zELeC0IddJjX2R9HMcSLixdJ2V8/VFsWMb2KQ -pGtDzCuRyyxbugzBIxiGV2Xb7XwOByaikc1duqFv3gtk7Vk8wgQN3YwLkZ6pztlK -vCbqy2b2wlPviGjApQ2GVd6EEmlCk2gKPkjrn2lxS2BXWorM+ANSswJT+eILi9yW -Q5zzmYK2vFTzL7FAMeqS/671jNhZQ8O7jvbY/mRhl66k2MY7/JgI+coP0cY+HHr2 -ozw9yNdOZmnk2Prj7+mBuchbT3BJOQ== -=AgHy ------END PGP PUBLIC KEY BLOCK----- ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBGZXO1wBEADEm061e/MGo2f7rpSqokI59in/egWbeQE26vwxB7vPu4e7j+cU -Vg3AezwCbf3nVRAE9DpJ+yuB0KVkM/0QszjOEEBuehZYJrUiwMyiY6jAk8xtqjpV -PsOMyZrypoJhwzg/sYNadUPw4UoHJ/xq4wNA2ZG9Xf0l8M3shYJPmKWLz/eefa5V -Ef/toQ7a55l0aJ7XyACTU6dv4bkHHqomDImK2C94s+KyCxaFyz6NgFz25V/j66Am -gB1m6UGGsvP4qYXW+KTsLz9XDvJeLLHWNcqQoyUO5Vs5C3hGozL7kEkyK/1qHcou -XXkeGN365z93ZeK+VdBZKJtsCswPk2wdDBByU9lAUNHYcLHf6S8fwCACeIqJ6LaY -MKmZUN2gR/boTyMERHEA8XnWXTDp7EsSNIc+LkU5AT8yesANcczH5k/XOI4hltJC -piEsSgg9V7FvO4eA2iQWGv/Y4nlUfw3lbRuRFvd7oqVQKlX4iIs++kVCCegBvtNA -1naxPbvTqrC4THvBSSZpOW/y/6XibAr/scCNNW1mEhwm5SPBHq9Sv35p6xKDTcgQ -8o3KLM8tKKt6kokAqlrXk9Nq6LYrZKwg5a9crFF7nCL2xgxZy1OJQVcPuhhZy5WT -WReE5RJdlF5VGRT9nMJ3B4Vlp5luQnMUFYXTAKQd6Cogbb99J4MjDttAlwARAQAB -tCtuZ2lueCBzaWduaW5nIGtleSA8c2lnbmluZy1rZXktM0BuZ2lueC5jb20+iQIi -BBMBCgAWBQJmVztcCRC83NijjYiiswIbAwIZAQAA9FMQAJ/e8F1egZGbRIV6qU/Q -bJD3EsKZZlitQSVXbBpxqDlkD+uzSFATGjiLGvJoTzfpJpJjI7FwrtO74lRkjCl9 -wQUNJ+wm2Kod6rEEQc6lWkDsgxpjqAAGVS0lmMf+VPBGQ+kc8S3ZdCOWEeq7nThZ -/xWR+UuQQcz1vCKmEgwTrr5MJVcqDg4wiH1Z4lRVfjTezf9IWk+xeE3mV8h7Ltbr -N5ZvOkiw88JLrbQsurxx+lYEaGIZyIk3huiDE/KpsMdw9KXUfoDcBqWc7oDjqKL+ -QEaq7TW6VetKyJaakP6Do+Opx0BtS3eH86PEZqtULEw9WifC86GtRr50iTXWBTfI -MFZo4AwigHXvZ5WrJvLfldY+scoU1rPMouYlZJ9W+6YHLjf/jpr4W1w6LKKXX3ah -h4VLtlOmrOLA21E7RQ0PwoE6nT7DAm1DsMFCXy7lyp3u5IXGahnJddWCb0Px3RTm -PZgOt+YAGJDsP46ngl5LxhilMK5f5R8v5n1lJ/XzFcXCEN4i/d8A1jx9DQx4CJN1 -wp/WZzJ6GjnCqMCdOBlQ2eNmhR+q1bAI79kSv86ahaM/aS1FvHMz8ppzwkRhv5jY -eR9aRlAwaCPOjbWhYJt/xveOWmxCdg5ta+Pj5g+41wHZyNf9aqR314aKwsxo2AYH -uUe+PgpsHbe1sQTkb/W1OfSCiQEzBBABCAAdFiEEcziXMGntP0Q/TTffpk/VsXrb -OagFAmZXO+kACgkQpk/VsXrbOajGgwf8CAXJwSIhGOWFSgV6vpvZPChTsgteZxhT -8NrJJLxL8X34Rw5YctSli4akkchTonm5RRp/SlvI2fPe0o6q2ymF4BASPJ/oSI3p -Gs/jwctHz8hwaVN0xQ4SBXgquIFWrLRNOjCxEV/vMRJRzuF9jrrdv3vxZEugETI+ -rnoEZu2Z2ZlMj7PPeiScf8dFXax67+Xi5S2KJCaXm1QGAJvttHrwsbBAIE9CVUg4 -UmXwADQ6HkOKjY+QS5AP8Ak1dg8/oadgyMqB4GrcE44KUpo4YafP37XnwXfQNKpk -Rb0bO9Qm9lM/LhPulBY8WIPkmrFCVhGTE6K5ZvI59R4nECHHx24/LYkBMwQQAQgA -HRYhBFc7/Ws9j7xkEHmmq6v1vYJ72b9iBQJmVzzzAAoJEKv1vYJ72b9iPPIIAJ5k -hTz2d7CaJefHzoraogKSIeBnA3OR+nDgdDl9Mp8i2WLGu9YYhIrPU0iSVw8jqa8t -GIjCw4/bS9HN8oub2Ip802xDLugCz1Yz6CXjCXN2rlNPsdBV8IIKNHOv93qMvnZS -DwyBUAvAs4XzF7zbYgfZ30B0gRI0g0+Nt44oDOn3PfO/kNUJyBVPT9m7l3JUHuZT -FPOD8a0oJPvW+iYlSkmPELBvgehsX7MVLoeQ5qtS1KkuWr+y1wqD5kxqabMPcfdU -jAr4ssXs/pSsYJVyS4CuUWkY4FiCJm4KtU+XPDs1RCTzMkW6HHgSebocTZzLETYw -XsDx80qd21UAdGc116qJAjMEEAEIAB0WIQTWeGzjA9mpAimY3GzIRk1UmvdcCgUC -ZldKYgAKCRDIRk1UmvdcCoG/D/9qLmHYOGnsmedUbgtLmuBJOuA6oqnaWxYI45eV -+vaAaI2+QfRoJTrjklTXv29Pi4LTzN5YBySSIkv/z9ry5Xsz5yroNY9Xb6JdrqOt -fLa/U0wddNuJbmIom4gUPXGInhHUBbP6mNz+s6e2ukBEWvb2XIsGe5v291QXMohQ -/PT8zTIwNYaw2zVF6Sa/0spA9/9XA5BdUcrtl7xPgYL7pLVmKYGJlCf5TOaWfLDJ -mIMeeUznVK9vK+vT+YqUPfFyIqO7dvio/+MRFjePoD6csT4UBT009ugy8vrYg2YR -K9uaRxP3laz9b6xdUM648ycUQLoI4fLhyKAHwPU9/Q+4rOFdrL72ZGVKzv1XOB0H -VXf0/E4JmJBydM7AyXHNxIPDtNFydosGn6VZsEvSPZdQSCsCeBs9UuBWgwFb1XBB -61XiHGnheb3U3ZRkajS1ZNdxfohHrBzHnd8tbDkv5Rq+XoUmDauoeM0VcN15hl4a -M/JzkeOrHuJicn3mg+HRHxQSCl3D37bVQT7O36n7cff22GykT7XQUBBxMlhKzygD -SgdQUtSEt0eu7AXIvr6yl0kobgZQS3wzUIaY0JEuv2ahtEXXjoPzCVWB2OHIpPbu -D58cpyyEVqr+ZecaI4HlaO9lVShf+K0rf/6DC12rC2gNzzv/fCIinDiqiMsPTfEM -fduRSYkBswQQAQgAHRYhBBPIKmO2A1dhVuMKTqDqmBtmsNlnBQJmV1HlAAoJEKDq -mBtmsNlnhI4L/0MHtfCZ2nuKTF/BkxJ7oB3Uule0tWiFj5SU97GjcVj1LgawGY7Y -+zoyEd6Twpl6H/+QkZBB55Bf8+cTzRbDzH1Og0fSORu0pGC0uxWdYu1sTLeTnn93 -mesXAvevHFNbsPchIWwsVJopTdzMWuAQS5hMMMtNb/14ZfnBadzhjvaJeH3DlZVK -0cGFp0qfbMfjr9yRJzQ1IkiXsS4G4uKg9T+KRsPr4+JalurWJgLnBXZGetNNjjUa -UCV1KZY/iWCAlZjkZ5z7yBRj5nUWLb5AVouEQPEDbn+i/0uEjukC+G6EMq2mgbrh -m0bFHbHAYBaf9EH0eP799HpoAx2aziDB5igAC516i3BnqxINI9mXHh92tU/H797I -oYZvpBsAHDWDHj6O74jwk5lXF5Qwri8gjA8aTudmuQX3uX4h0/FyGGQJW4/wWecH -/1fMuvHHyRtOSsJsheDwcSjrw5WlsyNjvSIbBPV2fIx60W2haVMUVX6CrxAeq44F -UYda9m8fOnaIew== -=TEOn ------END PGP PUBLIC KEY BLOCK----- ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBGKE4psBEADpHSM/IxFD1nXBmnODYXzcl2A+6b6m9m1m2Y4Dlr0ed+y5Lxne -QidE9I74A2KSm6+eHW2yh4i1ZwZbmwpmQqM+j5BMt7axoXOdKSyN+fYtUakzNbBN -EDRKT79q/zIzkgTJradHkCQkwF1W3go+qPXjR2ZEnLma9dZED9VNI6PmOpeYaASo -IkEfbKbwa/vPrvnDSSYY6Y02RXSRk5U1NvQgVUTJP9WGK7NlPUcTBDELLQv6fFPU -kjBOel6MecsQ+v8iq4RJF2cbVF0hNjbAiNldjLV74Xd7yWVRlCbdb2agyvQjMNrD -jHSvbEMiNB3R8yBHVW2Zldv8q0XjcwoDfdiZYFJe3lRUYmv6I2p+/DptD4r/3ILI -peGZtSeOdQEw+vvODL/Ehq03anTrzcpZ6sDLfLrYJhYcrltj0/LMUnLDAjciwRUq -XI46EfxwqsdLeqoZFQeO3LOFsh0kJKR2xOrUHIVy84NJ4Gmro6WmUkb1NfdjyHzF -z8Lfbo46NKoTcwFsFF0q74jVVIVNUyIS91DusiMqLCsP8jqDOz/kyP4bOJQ+aUXf -BANn4Ll1TFWsJ417moxz+Pi5sTaI0na8z2XB1N9WPsSml3FS75hJPJshN2T3VIea -zB7GFWqk33ynSDt+cAisG5nsK9fFdcH+t5wm59oobyFbFhKxwX6ROuxlZwARAQAB -tCRTZXJnZXkgS2FuZGF1cm92IDxwbHVrbmV0QG5naW54LmNvbT6JAk4EEwEKADgW -IQTWeGzjA9mpAimY3GzIRk1UmvdcCgUCYoTimwIbAwULCQgHAwUVCgkICwUWAwIB -AAIeAQIXgAAKCRDIRk1UmvdcCqbOD/9Htgk3mWvUFmrApkWQTIDNmLACZ1Sw1PXj -Uqte8StYB0bYY+nmAXs7O5eC2h1ViParl7En1joEEMQQmH0qSnw4X1CM/hA8TAYW -mBPITTNWo/R52WoyWeWGFnFNIperQmuIZc+pXm0VEFVPiX/2DXbCIu+jaXySvlCN -LekmOD4VC7dJS8/ohoaXOR2T8ufS+1CsyPXomEb+COhqRZ3EVBa+k7pnElkFft3Y -a1fR0AgatZFQpy+ukePhK7s/M5RGhDJWHgSAZFkf+X2jVV4NRJ+XsY80gU5DD2ZX -QT6Je6Knxqk7FnWNSxkhReH6Ss5flZSoGDCmJ2AsPtGeUhus2fGqeN+waGKTZC35 -die2V4/cro1SWswSI6Y5GFDZT1olIUztPmSXU/A3oyizJI7XZybwUbpk5kK83VXm -el3U/7Qr/VErlDWFefZWeUvT1RILZ8IRoNj4dv158RnKHt9G508A5qz4hUPKoSeq -SiXhYwfkc31WPzIJ4ev+X5Ka2sG/CKbEMJ7qwc0Kadiu+ePPfqqbXjpTWRyrbcRM -hRNcLNUi1SLWMBClOQG+5GNG1dPPHkbj4dO1OZuaUMwQdu8R8NlsGoVWS40bmVv5 -pXstzYCl7k/UnC/Ytlq61GeAoq8ILa6jGj0EWqlhvi0ZNMN+fROhzrRlTzIr/+WE -Xf8EiVNFSbQlU2VyZ2V5IEthbmRhdXJvdiA8cy5rYW5kYXVyb3ZAZjUuY29tPokC -TgQTAQoAOBYhBNZ4bOMD2akCKZjcbMhGTVSa91wKBQJihO2zAhsDBQsJCAcDBRUK -CQgLBRYDAgEAAh4BAheAAAoJEMhGTVSa91wKgLQQANaf4UMndkWoefDQPkJ5qR4K -fuV0WRz59riZEApTkVpPXzl8Y1i8Rgt9pa1v1i12vPyIXKav1rJXQcuDEzqrhQ2G -yvuAE2U/t2mYaMUmwxWO2d8JA3slvBSgOkiYpbLooDizAdKMT5UQWGyw31Wm51iz -HjoztebsyXeXgq9VDjv3D8LUBr/OY3Hguj6HV+zRtC95qgXYadW2FiCtvBK6RTDb -iShTuseLSheGh9dZIUSnzaOiJpDA61ZDYtFZxSpe67vEzhSfHVsF+ZdCjoWhhVv+ -+2wR4E0VQQtOM9uX1PMlZ5Ymr02/gidsXCM0ZjYXx4cDDhnq+nKomN64VloXWY9t -PIi86XmzcSWlGUd+Ac6LyW7/f64bUWs4Ih0Idl0PF0sAr/6axKUsIs1nbn5MEtXk -ZPAjcDLqLb9IIQaXRurm/il8v+bLXVBOJq33YUuGRuz8pu4vPA5Q97zglqhlIgbu -prHMJ9hl5q39JwS3As2rK0o6Q9VVKr29rqSEfk4wEttvk0QMMU5zEvVl8MtqPj42 -qURqpHOadFbYMTwhUmRBUszRZPa5/pWqq0gWOtpyCWFVAsHFWQGJM1Eo6gGEyHZM -YgBp+d29p2p409r1+06U67GBnXvUy0RyIpkLQtU+lyOJ6vvrBmmsDs/gc69GnlSC -tZmCt0pLesJ7ZJzGdDkduQINBGKE4psBEADQr/enuDeVT11v6ejuYrg7aaZaGFUe -3i28bQ4pRUKNfxs7zVYDDHi2i2bhS5j2yQnbsQtGcgoenw6lapmdQRzr4vjQAz9o -kT6l4qpqvFFQM0wZTnigVDmmO9vTHR8Uk3iCKTd2ax3oko/xPWWYJautJ6ex8cOA -coHSDeOjuIWSxCKq0BDFp6LoxkM8nuyLAX2cbhI3LncaZhVveMeN+Fmcsv+WpkKs -yhX92umZuGwlraSyFy23FiRWSZPu9qVIxMMHvVrQJIgfhyWaHFzoF4M4qDoSKx92 -uWfUWgFwPOxOJ6/YcPsX4T8qTl9htmwPN0BibPTlcWaIFXtiU5bE1MivUPeACrI/ -gwUfCR3Mg+GYc13C6jzepREUhI7PLi3+A203PlMZd/aaSZkP6j+h4cwdapH5P4uF -7T1EQ0MSdx3neAvu5p0IM6JpriwxfT3HsG+Y952T6MIeXcjNRebsBrygJhJ0/vyr -wV5t8jL0yQty4CiE/QFnBs42l+rngi7K7Y1AZRBGK7JA09XaoLrfLmS+PrbYPsaJ -flkM8GzUB7BBCLozxDHPzmPkf/A1w3XHZnYuZmS+pvjWCIoKpLQHI99oSUGho/TR -gMRO4v7EAzluqCiepMl0xwFfHB115ND/mATazc4Pt6FxUsqffzfZrN01e1UVPrp5 -4x6YLO80JnOY6QARAQABiQI2BBgBCgAgFiEE1nhs4wPZqQIpmNxsyEZNVJr3XAoF -AmKE4psCGwwACgkQyEZNVJr3XAp9ghAAgCgErxQYn/Lh/mzsxYXPnisggcBpceks -mGw7knj1EGkXqq9CHn3EjCw8dB5N857UFlUr++DHwpFL5O36PRQo33RIUFbmBypG -8C/xX1jWGu3xcaqS3P1ncsSSl6ckdvy9pjMxThm/RkXO0eJCn7FcanwPJXEB3Pbb -mm0wLI2OXl/m7l5QAr7kErnPvGNzcbX6G35Q/MY8mumBWQ9H53R5ZPpi+OS40Wfn -pZNKdh/Acwa7+2RokPqoOcJfxVdBOUigXTzb45qZgqEsSR7bkZAy2E80A/sJKPqs -OGjp9cog3rBYyNBn5dasfR9KeBtluKnjUbzutXsQoKUSECY00YGrtneSXMku5hoE -Dguk68w/L63ZApYHO/JTgJAYvqPOErAVUegPIw2CT1/2qi5vpClBcKkNS7RXrssA -X+lElE0zbzX3bNG+lQuXby7jNUFYltkEiz6vTtc4HuHy8u40DHMswzkoDr0T8IE0 -7ZRAWXwV1nlA/dI337cHCsWMJyqem5wZZO13iqe07qaCg1uvBPeqDo81hOCn1us7 -l5SYRUTlt7KSFEHZ+Sx4bmVneAuRi5okaQdmrepy/ss/vVpRwWuQxsPkvT8boS7s -mqOVsZFcNOuUJPUyOz1dHUL6FMYpk1dw+9n41gO4fLBzJekFTB/fxL6SRbYFWWn7 -x0VGHDmuaYQ= -=HmVo ------END PGP PUBLIC KEY BLOCK----- diff --git a/debian/vim/nginx.yaml b/debian/vim/nginx.yaml deleted file mode 100644 index 37cf6bf..0000000 --- a/debian/vim/nginx.yaml +++ /dev/null @@ -1,6 +0,0 @@ -addon: nginx -description: "allow syntax highlighting for Nginx configuration files" -files: - - ftdetect/nginx.vim - - indent/nginx.vim - - syntax/nginx.vim diff --git a/debian/watch b/debian/watch deleted file mode 100644 index 86d8da1..0000000 --- a/debian/watch +++ /dev/null @@ -1,3 +0,0 @@ -version=4 -opts=pgpsigurlmangle=s/$/.asc/ \ -https://nginx.org/download/nginx-(\d+\.\d+[02468]\.\d+)\.tar\.gz diff --git a/modules/PLACEHOLDER b/modules/PLACEHOLDER deleted file mode 100644 index e69de29..0000000 diff --git a/modules/nginx-secure-token-module b/modules/nginx-secure-token-module deleted file mode 160000 index 24f7b99..0000000 --- a/modules/nginx-secure-token-module +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24f7b99d9b665e11c92e585d6645ed6f45f7d310 diff --git a/modules/nginx-stream-preread-str-module b/modules/nginx-stream-preread-str-module deleted file mode 160000 index 7326626..0000000 --- a/modules/nginx-stream-preread-str-module +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7326626fce5d6ec31ac892377e0a734e503d40e6 diff --git a/modules/njs b/modules/njs deleted file mode 160000 index 4fd3ff9..0000000 --- a/modules/njs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4fd3ff98e413ede57c88456cf84b116a8382061a diff --git a/modules/quickjs b/modules/quickjs deleted file mode 160000 index 1fdc768..0000000 --- a/modules/quickjs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1fdc768fdc8571300755cdd3e4654ce99c0255ce diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/.travis.yml b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/.travis.yml deleted file mode 100644 index 57d2b8a..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -# required for http2 support in curl. -dist: bionic -language: c -sudo: false -matrix: - include: - # unfortunately, gcc-4.9 is dropped in bionic - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-5 - env: - - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" - - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-6 - env: - - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - - -script: -- script/.travis-compile.sh -- script/.travis-before-test.sh -- script/.travis-test.sh -after_success: -- killall nginx -after_failure: -- killall nginx - diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/CONTRIBUTING.md b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/CONTRIBUTING.md deleted file mode 100644 index a9eabff..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/CONTRIBUTING.md +++ /dev/null @@ -1,27 +0,0 @@ -# Contributing - -Want to contribute? Great! First, read this page (including the small print at the end). - -### Before you contribute -Before we can use your code, you must sign the -[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual) -(CLA), which you can do online. The CLA is necessary mainly because you own the -copyright to your changes, even after your contribution becomes part of our -codebase, so we need your permission to use and distribute your code. We also -need to be sure of various other things—for instance that you'll tell us if you -know that your code infringes on other people's patents. You don't have to sign -the CLA until after you've submitted your code for review and a member has -approved it, but you must do it before we can put your code into our codebase. -Before you start working on a larger contribution, you should get in touch with -us first through the issue tracker with your idea so that we can help out and -possibly guide you. Coordinating up front makes it much easier to avoid -frustration later on. - -### Code reviews -All submissions, including submissions by project members, require review. We -use Github pull requests for this purpose. - -### The small print -Contributions made by corporations are covered by a different agreement than -the one above, the -[Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate). diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/LICENSE b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/LICENSE deleted file mode 100644 index db3aca7..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2002-2015 Igor Sysoev - * Copyright (C) 2011-2015 Nginx, Inc. - * Copyright (C) 2015-2019 Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/README.md b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/README.md deleted file mode 100644 index 80428e9..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/README.md +++ /dev/null @@ -1,177 +0,0 @@ -# ngx_brotli - -Brotli is a generic-purpose lossless compression algorithm that compresses data -using a combination of a modern variant of the LZ77 algorithm, Huffman coding -and 2nd order context modeling, with a compression ratio comparable to the best -currently available general-purpose compression methods. It is similar in speed -with deflate but offers more dense compression. - -ngx_brotli is a set of two nginx modules: - -- ngx_brotli filter module - used to compress responses on-the-fly, -- ngx_brotli static module - used to serve pre-compressed files. - -[![TravisCI Build Status](https://travis-ci.org/google/ngx_brotli.svg?branch=master)](https://travis-ci.org/google/ngx_brotli) - -## Table of Contents - -- [Status](#status) -- [Installation](#installation) -- [Configuration directives](#configuration-directives) - - [`brotli_static`](#brotli_static) - - [`brotli`](#brotli) - - [`brotli_types`](#brotli_types) - - [`brotli_buffers`](#brotli_buffers) - - [`brotli_comp_level`](#brotli_comp_level) - - [`brotli_window`](#brotli_window) - - [`brotli_min_length`](#brotli_min_length) -- [Variables](#variables) - - [`$brotli_ratio`](#brotli_ratio) -- [Sample configuration](#sample-configuration) -- [Contributing](#contributing) -- [License](#license) - -## Status - -Both Brotli library and nginx module are under active development. - -## Installation - -### Dynamically loaded - - $ cd nginx-1.x.x - $ ./configure --with-compat --add-dynamic-module=/path/to/ngx_brotli - $ make modules - -You will need to use **exactly** the same `./configure` arguments as your Nginx configuration and append `--with-compat --add-dynamic-module=/path/to/ngx_brotli` to the end, otherwise you will get a "module is not binary compatible" error on startup. You can run `nginx -V` to get the configuration arguments for your Nginx installation. - -`make modules` will result in `ngx_http_brotli_filter_module.so` and `ngx_http_brotli_static_module.so` in the `objs` directory. Copy these to `/usr/lib/nginx/modules/` then add the `load_module` directives to `nginx.conf` (above the http block): -```nginx -load_module modules/ngx_http_brotli_filter_module.so; -load_module modules/ngx_http_brotli_static_module.so; -``` - -### Statically compiled - - $ cd nginx-1.x.x - $ ./configure --add-module=/path/to/ngx_brotli - $ make && make install - -This will compile the module directly into Nginx. - -## Configuration directives - -### `brotli_static` - -- **syntax**: `brotli_static on|off|always` -- **default**: `off` -- **context**: `http`, `server`, `location` - -Enables or disables checking of the existence of pre-compressed files with`.br` -extension. With the `always` value, pre-compressed file is used in all cases, -without checking if the client supports it. - -### `brotli` - -- **syntax**: `brotli on|off` -- **default**: `off` -- **context**: `http`, `server`, `location`, `if` - -Enables or disables on-the-fly compression of responses. - -### `brotli_types` - -- **syntax**: `brotli_types [..]` -- **default**: `text/html` -- **context**: `http`, `server`, `location` - -Enables on-the-fly compression of responses for the specified MIME types -in addition to `text/html`. The special value `*` matches any MIME type. -Responses with the `text/html` MIME type are always compressed. - -### `brotli_buffers` - -- **syntax**: `brotli_buffers ` -- **default**: `32 4k|16 8k` -- **context**: `http`, `server`, `location` - -**Deprecated**, ignored. - -### `brotli_comp_level` - -- **syntax**: `brotli_comp_level ` -- **default**: `6` -- **context**: `http`, `server`, `location` - -Sets on-the-fly compression Brotli quality (compression) `level`. -Acceptable values are in the range from `0` to `11`. - -### `brotli_window` - -- **syntax**: `brotli_window ` -- **default**: `512k` -- **context**: `http`, `server`, `location` - -Sets Brotli window `size`. Acceptable values are `1k`, `2k`, `4k`, `8k`, `16k`, -`32k`, `64k`, `128k`, `256k`, `512k`, `1m`, `2m`, `4m`, `8m` and `16m`. - -### `brotli_min_length` - -- **syntax**: `brotli_min_length ` -- **default**: `20` -- **context**: `http`, `server`, `location` - -Sets the minimum `length` of a response that will be compressed. -The length is determined only from the `Content-Length` response header field. - -## Variables - -### `$brotli_ratio` - -Achieved compression ratio, computed as the ratio between the original -and compressed response sizes. - -## Sample configuration - -``` -brotli on; -brotli_comp_level 6; -brotli_static on; -brotli_types application/atom+xml application/javascript application/json application/rss+xml - application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype - application/x-font-ttf application/x-javascript application/xhtml+xml application/xml - font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon - image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml; -``` - -## Contributing - -See [Contributing](CONTRIBUTING.md). - -## License - - Copyright (C) 2002-2015 Igor Sysoev - Copyright (C) 2011-2015 Nginx, Inc. - Copyright (C) 2015 Google Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/config b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/config deleted file mode 100644 index 42162a6..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/config +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2019 Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -# Make sure the module knows it is a submodule. -ngx_addon_name=ngx_brotli -. $ngx_addon_dir/filter/config - -# Make sure the module knows it is a submodule. -ngx_addon_name=ngx_brotli -. $ngx_addon_dir/static/config - -# The final name for reporting. -ngx_addon_name=ngx_brotli diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/changelog b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/changelog deleted file mode 100644 index c7021b7..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/changelog +++ /dev/null @@ -1,49 +0,0 @@ -libnginx-mod-http-brotli (1.0.0~rc-6) unstable; urgency=medium - - * d/control: update my email to janmojzis@debian.org - * d/copyright: update my email to janmojzis@debian.org - * d/control: bump Standards-Version: 4.7.2, no changes - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:55 +0200 - -libnginx-mod-http-brotli (1.0.0~rc-5) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:24 +0200 - -libnginx-mod-http-brotli (1.0.0~rc-4) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:35 +0200 - -libnginx-mod-http-brotli (1.0.0~rc-3) unstable; urgency=medium - - * d/watch: updated uversionmangle to be more generic - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:11 +0100 - -libnginx-mod-http-brotli (1.0.0~rc-2) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/p/0001-Fix-Vary-header.patch added (Closes: 1028153) - "brotli_static on;" causes "Vary: Accept-Encoding" to be added to every - file (including images, ...) - The patch fixes the problem and adds "Vary: Accept-Encoding" only to - responses when brotli static compression is used. - * d/changelog: bump my copyright year - - -- Jan Mojžíš Fri, 13 Jan 2023 17:45:13 +0100 - -libnginx-mod-http-brotli (1.0.0~rc-1) unstable; urgency=medium - - * Initial release. (Closes: 1025515) - - -- Jan Mojžíš Tue, 06 Dec 2022 10:25:40 +0100 diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/control b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/control deleted file mode 100644 index 6e5752d..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/control +++ /dev/null @@ -1,41 +0,0 @@ -Source: libnginx-mod-http-brotli -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, - libbrotli-dev, -Standards-Version: 4.7.2 -Homepage: https://github.com/google/ngx_brotli -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-brotli.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-brotli -Rules-Requires-Root: no - -Package: libnginx-mod-http-brotli-filter -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Description: Brotli lossless compression support for Nginx - filter - Brotli is a generic-purpose lossless compression algorithm that compresses - data using a combination of a modern variant of the LZ77 algorithm, Huffman - coding and 2nd order context modeling, with a compression ratio comparable - to the best currently available general-purpose compression methods. It is - similar in speed with deflate but offers more dense compression. - . - ngx_brotli filter module - used to compress responses on-the-fly - -Package: libnginx-mod-http-brotli-static -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Description: Brotli lossless compression support for Nginx - static - Brotli is a generic-purpose lossless compression algorithm that compresses - data using a combination of a modern variant of the LZ77 algorithm, Huffman - coding and 2nd order context modeling, with a compression ratio comparable - to the best currently available general-purpose compression methods. It is - similar in speed with deflate but offers more dense compression. - . - ngx_brotli static module - used to serve pre-compressed files diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/copyright b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/copyright deleted file mode 100644 index 2ecfff5..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/copyright +++ /dev/null @@ -1,72 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ngx-brotli -Source: https://github.com/google/ngx_brotli - -Files: * -Copyright: 2015-2019, Google Inc. - 2011-2015, Nginx, Inc. - 2002-2015, Igor Sysoev -License: BSD-2-clause - -Files: CONTRIBUTING.md -Copyright: Copyright (C) 2015 Google Inc. - Copyright (C) 2011-2015 Nginx, Inc. - Copyright (C) 2002-2015 Igor Sysoev -License: BSD-2-clause - -Files: config -Copyright: 2015-2019, Google Inc. -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: filter/* -Copyright: 2015-2019, Google Inc. -License: BSD-2-clause - -Files: filter/ngx_http_brotli_filter_module.c -Copyright: Nginx, Inc. - Igor Sysoev - Google Inc. -License: BSD-2-clause - -Files: script/* -Copyright: Copyright (C) 2015 Google Inc. - Copyright (C) 2011-2015 Nginx, Inc. - Copyright (C) 2002-2015 Igor Sysoev -License: BSD-2-clause - -Files: static/* -Copyright: 2015-2019, Google Inc. -License: BSD-2-clause - -Files: static/ngx_http_brotli_static_module.c -Copyright: Nginx, Inc. - Igor Sysoev - Google Inc. -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/gbp.conf b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/gbp.conf deleted file mode 100644 index 38c12c1..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/gbp.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-filter.install b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-filter.install deleted file mode 100644 index 5fcd39d..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-filter.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ngx_http_brotli_filter_module.so diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-static.install b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-static.install deleted file mode 100644 index dd4a44e..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-static.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ngx_http_brotli_static_module.so diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/0001-Fix-Vary-header.patch b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/0001-Fix-Vary-header.patch deleted file mode 100644 index 09735a7..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/0001-Fix-Vary-header.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Jan Mojzis -Date: Fri, 13 Jan 2023 12:59:07 +0100 -Subject: Fix 'Vary' header - -The patch fixes problem described here: -https://github.com/google/ngx_brotli/issues/97 - -"brotli_static on;" causes "Vary: Accept-Encoding" to be added to every -file (including images, ...) -The patch fixes the problem and adds "Vary: Accept-Encoding" only to -responses when brotli static compression is used. ---- - static/ngx_http_brotli_static_module.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/static/ngx_http_brotli_static_module.c b/static/ngx_http_brotli_static_module.c -index 8f96177..44f0cb0 100644 ---- a/static/ngx_http_brotli_static_module.c -+++ b/static/ngx_http_brotli_static_module.c -@@ -168,7 +168,6 @@ static ngx_int_t handler(ngx_http_request_t* req) { - /* Ignore request properties (e.g. Accept-Encoding). */ - } else { - /* NGX_HTTP_BROTLI_STATIC_ON */ -- req->gzip_vary = 1; - rc = check_eligility(req); - if (rc != NGX_OK) return NGX_DECLINED; - } -@@ -227,6 +226,10 @@ static ngx_int_t handler(ngx_http_request_t* req) { - return NGX_DECLINED; - } - -+ if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ON) { -+ req->gzip_vary = 1; -+ } -+ - /* So far so good. */ - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", - file_info.fd); diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/series b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/series deleted file mode 100644 index dfd7340..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -0001-Fix-Vary-header.patch diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/rules b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/source/format b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/control b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/control deleted file mode 100644 index de69689..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/control +++ /dev/null @@ -1,22 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: static -Restrictions: allow-stderr isolation-container needs-root -Depends: brotli, - curl, - libnginx-mod-http-brotli-static, - nginx, - nginx-core, - -Tests: filter -Restrictions: allow-stderr isolation-container needs-root -Depends: brotli, - curl, - libnginx-mod-http-brotli-filter, - nginx, - nginx-core, diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/filter b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/filter deleted file mode 100644 index 16ac356..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/filter +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - root /var/www/html; - - location /helloworld { - default_type text/plain; - brotli on; - brotli_types text/plain; - brotli_min_length 10; - brotli_comp_level 11; - } -} -EOF - -mkdir -p /var/www/html -echo 'hello world' > /var/www/html/helloworld - -exp="content-encoding: br -hello world -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --compressed --fail -D- -w "response_code: %{http_code}\n" http://127.0.0.1/helloworld` -out=`echo "${out}" | sed 's/\r//'` -out=`echo "${out}" | awk '{print tolower($0)}'` -out=`echo "${out}" | grep '^content-encoding: \|^hello world$\|response_code: '` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/generic b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/static b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/static deleted file mode 100644 index bce1fbc..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/static +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - root /var/www/html; - - location /helloworld { - brotli_static on; - } -} -EOF - -mkdir -p /var/www/html -echo 'hello world' | brotli -9 > /var/www/html/helloworld.br - -exp="hello world -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --compressed --fail -w "response_code: %{http_code}\n" http://127.0.0.1/helloworld` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/upstream/metadata b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/upstream/metadata deleted file mode 100644 index 30627c6..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/google/ngx_brotli/issues -Bug-Submit: https://github.com/google/ngx_brotli/issues/new -Repository-Browse: https://github.com/google/ngx_brotli diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/watch b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/watch deleted file mode 100644 index 08b8983..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/google/ngx_brotli/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/config b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/config deleted file mode 100644 index 9c27fc7..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/config +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (C) 2015-2016 Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -if [ "$ngx_addon_name" = "ngx_brotli" ]; then - BROTLI_MODULE_SRC_DIR="$ngx_addon_dir/filter" -else - BROTLI_MODULE_SRC_DIR="$ngx_addon_dir" -fi - -ngx_addon_name=ngx_brotli_filter - -if [ -z "$ngx_module_link" ]; then -cat << END - -$0: error: Brotli module requires recent version of NGINX (1.9.11+). - -END - exit 1 -fi - -ngx_module_type=HTTP_FILTER -ngx_module_name=ngx_http_brotli_filter_module - -brotli="$ngx_addon_dir/deps/brotli/c" -if [ ! -f "$brotli/include/brotli/encode.h" ]; then - brotli="/usr/local" -fi -if [ ! -f "$brotli/include/brotli/encode.h" ]; then - brotli="/usr" -fi -if [ ! -f "$brotli/include/brotli/encode.h" ]; then -cat << END - -$0: error: \ -Brotli library is missing from the $brotli directory. - -Please make sure that the git submodule has been checked out: - - cd $ngx_addon_dir && git submodule update --init && cd $PWD - -END - exit 1 -fi - -BROTLI_LISTS_FILE="$brotli/../scripts/sources.lst" - -if [ -f "$BROTLI_LISTS_FILE" ]; then - -BROTLI_LISTS=`cat "$BROTLI_LISTS_FILE" | grep -v "#" | tr '\n' '#' | \ - sed 's/\\\\#//g' | tr -s ' ' '+' | tr -s '#' ' ' | \ - sed 's/+c/+$brotli/g' | sed 's/+=+/=/g'` -for ITEM in ${BROTLI_LISTS}; do - VAR=`echo $ITEM | sed 's/=.*//'` - VAL=`echo $ITEM | sed 's/.*=//' | tr '+' ' '` - eval ${VAR}=\"$VAL\" -done - -else # BROTLI_LISTS_FILE - -BROTLI_ENC_H="$brotli/include/brotli/encode.h \ - $brotli/include/brotli/port.h \ - $brotli/include/brotli/types.h" -BROTLI_ENC_LIB="-lbrotlienc" - -fi - -ngx_module_incs="$brotli/include" -ngx_module_deps="$BROTLI_COMMON_H $BROTLI_ENC_H" -ngx_module_srcs="$BROTLI_COMMON_C $BROTLI_ENC_C \ - $BROTLI_MODULE_SRC_DIR/ngx_http_brotli_filter_module.c" -ngx_module_libs="$BROTLI_ENC_LIB -lm" -ngx_module_order="$ngx_module_name \ - ngx_pagespeed \ - ngx_http_postpone_filter_module \ - ngx_http_ssi_filter_module \ - ngx_http_charset_filter_module \ - ngx_http_xslt_filter_module \ - ngx_http_image_filter_module \ - ngx_http_sub_filter_module \ - ngx_http_addition_filter_module \ - ngx_http_gunzip_filter_module \ - ngx_http_userid_filter_module \ - ngx_http_headers_filter_module \ - ngx_http_copy_filter_module \ - ngx_http_range_body_filter_module \ - ngx_http_not_modified_filter_module \ - ngx_http_slice_filter_module" - -. auto/module - -if [ "$ngx_module_link" != DYNAMIC ]; then - # ngx_module_order doesn't work with static modules, - # so we must re-order filters here. - - if [ "$HTTP_GZIP" = YES ]; then - next=ngx_http_gzip_filter_module - elif echo $HTTP_FILTER_MODULES | grep pagespeed_etag_filter >/dev/null; then - next=ngx_pagespeed_etag_filter - else - next=ngx_http_range_header_filter_module - fi - - HTTP_FILTER_MODULES=`echo $HTTP_FILTER_MODULES \ - | sed "s/$ngx_module_name//" \ - | sed "s/$next/$next $ngx_module_name/"` -fi - -CFLAGS="$CFLAGS -Wno-deprecated-declarations" - -have=NGX_HTTP_BROTLI_FILTER . auto/have -have=NGX_HTTP_BROTLI_FILTER_MODULE . auto/have # deprecated diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/ngx_http_brotli_filter_module.c b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/ngx_http_brotli_filter_module.c deleted file mode 100644 index 592b767..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/ngx_http_brotli_filter_module.c +++ /dev/null @@ -1,770 +0,0 @@ -/* - * Copyright (C) Igor Sysoev - * Copyright (C) Nginx, Inc. - * Copyright (C) Google Inc. - */ - -#include -#include -#include - -#if (NGX_HAVE_BROTLI_ENC_ENCODE_H) -#include -#else -#include -#endif - -/* Brotli and GZip modules never stack, i.e. when one of them sets - "Content-Encoding" the other becomes a pass-through filter. Consequently, - it is almost legal to reuse this "buffered" bit. - IIUC, buffered == some data passed to filter has not been pushed further. */ -#define NGX_HTTP_BROTLI_BUFFERED NGX_HTTP_GZIP_BUFFERED - -/* Module configuration. */ -typedef struct { - ngx_flag_t enable; - - /* Supported MIME types. */ - ngx_hash_t types; - ngx_array_t* types_keys; - - /* Minimal required length for compression (if known). */ - ssize_t min_length; - - ngx_bufs_t deprecated_unused_bufs; - - /* Brotli encoder parameter: quality */ - ngx_int_t quality; - - /* Brotli encoder parameter: (max) lg_win */ - size_t lg_win; -} ngx_http_brotli_conf_t; - -/* Instance context. */ -typedef struct { - /* Brotli encoder instance. */ - BrotliEncoderState* encoder; - - /* Payload length; -1, if unknown. */ - off_t content_length; - - /* (uncompressed) bytes pushed to encoder. */ - size_t bytes_in; - /* (compressed) bytes pulled from encoder. */ - size_t bytes_out; - - /* Input buffer chain. */ - ngx_chain_t* in; - - /* Output chain. */ - ngx_chain_t* out_chain; - - /* Output buffer. */ - ngx_buf_t* out_buf; - - /* Various state flags. */ - - /* 1 if encoder is initialized, output chain and buffer are allocated. */ - unsigned initialized : 1; - /* 1 if compression is finished / failed. */ - unsigned closed : 1; - /* 1 if compression is finished. */ - unsigned success : 1; - - /* 1 if out_chain is ready to be committed, 0 otherwise. */ - unsigned output_ready : 1; - /* 1 if output buffer is committed to the next filter and not yet fully used. - 0 otherwise. */ - unsigned output_busy : 1; - - unsigned end_of_input : 1; - unsigned end_of_block : 1; - - ngx_http_request_t* request; -} ngx_http_brotli_ctx_t; - -/* Forward declarations. */ - -/* Initializes encoder, output chain and buffer, if necessary. Returns NGX_OK - if encoder is successfully initialized (have been already initialized), - and requires objects are allocated. Returns NGX_ERROR otherwise. */ -static ngx_int_t ngx_http_brotli_filter_ensure_stream_initialized( - ngx_http_request_t* r, ngx_http_brotli_ctx_t* ctx); -/* Marks instance as closed and performs cleanup. */ -static void ngx_http_brotli_filter_close(ngx_http_brotli_ctx_t* ctx); - -static void* ngx_http_brotli_filter_alloc(void* opaque, size_t size); -static void ngx_http_brotli_filter_free(void* opaque, void* address); - -static ngx_int_t ngx_http_brotli_check_request(ngx_http_request_t* r); - -static ngx_int_t ngx_http_brotli_add_variables(ngx_conf_t* cf); -static ngx_int_t ngx_http_brotli_ratio_variable(ngx_http_request_t* r, - ngx_http_variable_value_t* v, - uintptr_t data); - -static void* ngx_http_brotli_create_conf(ngx_conf_t* cf); -static char* ngx_http_brotli_merge_conf(ngx_conf_t* cf, void* parent, - void* child); -static ngx_int_t ngx_http_brotli_filter_init(ngx_conf_t* cf); - -static char* ngx_http_brotli_parse_wbits(ngx_conf_t* cf, void* post, - void* data); - -/* Configuration literals. */ - -static ngx_conf_num_bounds_t ngx_http_brotli_comp_level_bounds = { - ngx_conf_check_num_bounds, BROTLI_MIN_QUALITY, BROTLI_MAX_QUALITY}; - -static ngx_conf_post_handler_pt ngx_http_brotli_parse_wbits_p = - ngx_http_brotli_parse_wbits; - -static ngx_command_t ngx_http_brotli_filter_commands[] = { - {ngx_string("brotli"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_HTTP_LIF_CONF | NGX_CONF_FLAG, - ngx_conf_set_flag_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, enable), NULL}, - - /* Deprecated, unused. */ - {ngx_string("brotli_buffers"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE2, - ngx_conf_set_bufs_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, deprecated_unused_bufs), NULL}, - - {ngx_string("brotli_types"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_1MORE, - ngx_http_types_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, types_keys), - &ngx_http_html_default_types[0]}, - - {ngx_string("brotli_comp_level"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE1, - ngx_conf_set_num_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, quality), - &ngx_http_brotli_comp_level_bounds}, - - {ngx_string("brotli_window"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE1, - ngx_conf_set_size_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, lg_win), &ngx_http_brotli_parse_wbits_p}, - - {ngx_string("brotli_min_length"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE1, - ngx_conf_set_size_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, min_length), NULL}, - - ngx_null_command}; - -/* Module context hooks. */ -static ngx_http_module_t ngx_http_brotli_filter_module_ctx = { - ngx_http_brotli_add_variables, /* pre-configuration */ - ngx_http_brotli_filter_init, /* post-configuration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_brotli_create_conf, /* create location configuration */ - ngx_http_brotli_merge_conf /* merge location configuration */ -}; - -/* Module descriptor. */ -ngx_module_t ngx_http_brotli_filter_module = { - NGX_MODULE_V1, - &ngx_http_brotli_filter_module_ctx, /* module context */ - ngx_http_brotli_filter_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING}; - -/* Variable names. */ -static ngx_str_t ngx_http_brotli_ratio = ngx_string("brotli_ratio"); - -/* Next filter in the filter chain. */ -static ngx_http_output_header_filter_pt ngx_http_next_header_filter; -static ngx_http_output_body_filter_pt ngx_http_next_body_filter; - -static /* const */ char kEncoding[] = "br"; -static const size_t kEncodingLen = 2; - -static ngx_int_t check_accept_encoding(ngx_http_request_t* req) { - ngx_table_elt_t* accept_encoding_entry; - ngx_str_t* accept_encoding; - u_char* cursor; - u_char* end; - u_char before; - u_char after; - - accept_encoding_entry = req->headers_in.accept_encoding; - if (accept_encoding_entry == NULL) return NGX_DECLINED; - accept_encoding = &accept_encoding_entry->value; - - cursor = accept_encoding->data; - end = cursor + accept_encoding->len; - while (1) { - u_char digit; - /* It would be an idiotic idea to rely on compiler to produce performant - binary, that is why we just do -1 at every call site. */ - cursor = ngx_strcasestrn(cursor, kEncoding, kEncodingLen - 1); - if (cursor == NULL) return NGX_DECLINED; - before = (cursor == accept_encoding->data) ? ' ' : cursor[-1]; - cursor += kEncodingLen; - after = (cursor >= end) ? ' ' : *cursor; - if (before != ',' && before != ' ') continue; - if (after != ',' && after != ' ' && after != ';') continue; - - /* Check for ";q=0[.[0[0[0]]]]" */ - while (*cursor == ' ') cursor++; - if (*(cursor++) != ';') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != 'q') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != '=') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != '0') break; - if (*(cursor++) != '.') return NGX_DECLINED; /* ;q=0, */ - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0., */ - if (digit > '0') break; - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0.0, */ - if (digit > '0') break; - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0.00, */ - if (digit > '0') break; - return NGX_DECLINED; /* ;q=0.000 */ - } - return NGX_OK; -} - -/* Process headers and decide if request is eligible for brotli compression. */ -static ngx_int_t ngx_http_brotli_header_filter(ngx_http_request_t* r) { - ngx_table_elt_t* h; - ngx_http_brotli_ctx_t* ctx; - ngx_http_brotli_conf_t* conf; - - conf = ngx_http_get_module_loc_conf(r, ngx_http_brotli_filter_module); - - /* Filter only if enabled. */ - if (!conf->enable) { - return ngx_http_next_header_filter(r); - } - - /* Only compress OK / forbidden / not found responses. */ - if (r->headers_out.status != NGX_HTTP_OK && - r->headers_out.status != NGX_HTTP_FORBIDDEN && - r->headers_out.status != NGX_HTTP_NOT_FOUND) { - return ngx_http_next_header_filter(r); - } - - /* Bypass "header only" responses. */ - if (r->header_only) { - return ngx_http_next_header_filter(r); - } - - /* Bypass already compressed responses. */ - if (r->headers_out.content_encoding && - r->headers_out.content_encoding->value.len) { - return ngx_http_next_header_filter(r); - } - - /* If response size is known, do not compress tiny responses. */ - if (r->headers_out.content_length_n != -1 && - r->headers_out.content_length_n < conf->min_length) { - return ngx_http_next_header_filter(r); - } - - /* Compress only certain MIME-typed responses. */ - if (ngx_http_test_content_type(r, &conf->types) == NULL) { - return ngx_http_next_header_filter(r); - } - - r->gzip_vary = 1; - - /* Check if client support brotli encoding. */ - if (ngx_http_brotli_check_request(r) != NGX_OK) { - return ngx_http_next_header_filter(r); - } - - /* Prepare instance context. */ - ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_brotli_ctx_t)); - if (ctx == NULL) { - return NGX_ERROR; - } - ctx->request = r; - ctx->content_length = r->headers_out.content_length_n; - ngx_http_set_ctx(r, ctx, ngx_http_brotli_filter_module); - - /* Prepare response headers, so that following filters in the chain will - notice that response body is compressed. */ - h = ngx_list_push(&r->headers_out.headers); - if (h == NULL) { - return NGX_ERROR; - } - - h->hash = 1; - ngx_str_set(&h->key, "Content-Encoding"); - ngx_str_set(&h->value, "br"); - r->headers_out.content_encoding = h; - - r->main_filter_need_in_memory = 1; - - ngx_http_clear_content_length(r); - ngx_http_clear_accept_ranges(r); - ngx_http_weak_etag(r); - - return ngx_http_next_header_filter(r); -} - -/* Response body filtration (compression). */ -static ngx_int_t ngx_http_brotli_body_filter(ngx_http_request_t* r, - ngx_chain_t* in) { - int rc; - ngx_http_brotli_ctx_t* ctx; - size_t available_output; - ptrdiff_t available_busy_output; - size_t input_size; - size_t available_input; - const uint8_t* next_input_byte; - size_t consumed_input; - BROTLI_BOOL ok; - u_char* out; - ngx_chain_t* link; - - ctx = ngx_http_get_module_ctx(r, ngx_http_brotli_filter_module); - - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http brotli filter"); - - if (ctx == NULL || ctx->closed || r->header_only) { - return ngx_http_next_body_filter(r, in); - } - - if (ngx_http_brotli_filter_ensure_stream_initialized(r, ctx) != NGX_OK) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - - /* If more input is provided - append it to our input chain. */ - if (in) { - if (ngx_chain_add_copy(r->pool, &ctx->in, in) != NGX_OK) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - } - - /* Main loop: - - if output is not yet consumed - stop; encoder should not be touched, - until all the output is consumed - - if encoder has output - wrap it and send to consumer - - if encoder is finished (and all output is consumed) - stop - - if there is more input - push it to encoder */ - for (;;) { - if (ctx->output_busy || ctx->output_ready) { - if (ctx->output_busy) { - available_busy_output = ngx_buf_size(ctx->out_buf); - } else { - available_busy_output = 0; - } - - rc = ngx_http_next_body_filter(r, - ctx->output_ready ? ctx->out_chain : NULL); - if (ctx->output_ready) { - ctx->output_ready = 0; - ctx->output_busy = 1; - } - if (ngx_buf_size(ctx->out_buf) == 0) { - ctx->output_busy = 0; - } - if (rc == NGX_OK) { - if (ctx->output_busy && - available_busy_output == ngx_buf_size(ctx->out_buf)) { - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - return NGX_AGAIN; - } - continue; - } else if (rc == NGX_AGAIN) { - if (ctx->output_busy) { - /* Can't continue compression, let the outer filer decide. */ - if (ctx->in != NULL) { - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - } - return NGX_AGAIN; - } else { - /* Inner filter has given up, but we can continue processing. */ - continue; - } - } else { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - } - - if (BrotliEncoderHasMoreOutput(ctx->encoder)) { - available_output = 0; - out = (u_char*)BrotliEncoderTakeOutput(ctx->encoder, &available_output); - if (out == NULL || available_output == 0) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - ctx->out_buf->start = out; - ctx->out_buf->pos = out; - ctx->out_buf->last = out + available_output; - ctx->out_buf->end = out + available_output; - ctx->bytes_out += available_output; - ctx->out_buf->last_buf = 0; - ctx->out_buf->flush = 0; - if (ctx->end_of_input && BrotliEncoderIsFinished(ctx->encoder)) { - ctx->out_buf->last_buf = 1; - r->connection->buffered &= ~NGX_HTTP_BROTLI_BUFFERED; - } else if (ctx->end_of_block) { - ctx->out_buf->flush = 1; - r->connection->buffered &= ~NGX_HTTP_BROTLI_BUFFERED; - } - ctx->end_of_block = 0; - ctx->output_ready = 1; - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "brotli out: %p, size:%uz", ctx->out_buf, - ngx_buf_size(ctx->out_buf)); - continue; - } - - if (BrotliEncoderIsFinished(ctx->encoder)) { - ctx->success = 1; - r->connection->buffered &= ~NGX_HTTP_BROTLI_BUFFERED; - ngx_http_brotli_filter_close(ctx); - return NGX_OK; - } - - if (ctx->end_of_input) { - // Ask the encoder to dump the leftover. - available_input = 0; - available_output = 0; - ok = BrotliEncoderCompressStream(ctx->encoder, BROTLI_OPERATION_FINISH, - &available_input, NULL, - &available_output, NULL, NULL); - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - if (!ok) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - continue; - } - - if (ctx->in == NULL) { - return NGX_OK; - } - - /* TODO: coalesce tiny inputs, if they are not last/flush. */ - input_size = ngx_buf_size(ctx->in->buf); - if (input_size == 0) { - if (!ctx->in->buf->last_buf && !ctx->in->buf->flush) { - link = ctx->in; - ctx->in = ctx->in->next; - ngx_free_chain(r->pool, link); - continue; - } - } - - available_input = input_size; - next_input_byte = (const uint8_t*)ctx->in->buf->pos; - available_output = 0; - ok = BrotliEncoderCompressStream( - ctx->encoder, - ctx->in->buf->last_buf ? BROTLI_OPERATION_FINISH - : ctx->in->buf->flush ? BROTLI_OPERATION_FLUSH - : BROTLI_OPERATION_PROCESS, - &available_input, &next_input_byte, &available_output, NULL, NULL); - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - if (!ok) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - - consumed_input = input_size - available_input; - ctx->bytes_in += consumed_input; - ctx->in->buf->pos += consumed_input; - - if (consumed_input == input_size) { - if (ctx->in->buf->last_buf) { - ctx->end_of_input = 1; - } else if (ctx->in->buf->flush) { - ctx->end_of_block = 1; - } - link = ctx->in; - ctx->in = ctx->in->next; - ngx_free_chain(r->pool, link); - continue; - } - - /* Should never happen, just to make sure we don't enter infinite loop. */ - if (consumed_input == 0) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - } - - /* unreachable */ - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; -} - -static ngx_int_t ngx_http_brotli_filter_ensure_stream_initialized( - ngx_http_request_t* r, ngx_http_brotli_ctx_t* ctx) { - ngx_http_brotli_conf_t* conf; - BROTLI_BOOL ok; - size_t wbits; - - if (ctx->initialized) { - return NGX_OK; - } - ctx->initialized = 1; - - conf = ngx_http_get_module_loc_conf(r, ngx_http_brotli_filter_module); - - /* Tune lg_win, if size is known. */ - if (ctx->content_length > 0) { - wbits = BROTLI_MIN_WINDOW_BITS; - while ((wbits < conf->lg_win) && (ctx->content_length > (1 << wbits))) { - wbits++; - } - } else { - wbits = conf->lg_win; - } - - ctx->encoder = BrotliEncoderCreateInstance( - ngx_http_brotli_filter_alloc, ngx_http_brotli_filter_free, r->pool); - if (ctx->encoder == NULL) { - ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, - "OOM / BrotliEncoderCreateInstance"); - return NGX_ERROR; - } - - ok = BrotliEncoderSetParameter(ctx->encoder, BROTLI_PARAM_QUALITY, - (uint32_t)conf->quality); - if (!ok) { - ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, - "BrotliEncoderSetParameter(QUALITY, %uD) failed", - (uint32_t)conf->quality); - return NGX_ERROR; - } - - ok = BrotliEncoderSetParameter(ctx->encoder, BROTLI_PARAM_LGWIN, - (uint32_t)wbits); - if (!ok) { - ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, - "BrotliEncoderSetParameter(LGWIN, %uD) failed", - (uint32_t)wbits); - return NGX_ERROR; - } - - ctx->out_buf = ngx_calloc_buf(r->pool); - if (ctx->out_buf == NULL) { - return NGX_ERROR; - } - ctx->out_buf->temporary = 1; - - ctx->out_chain = ngx_alloc_chain_link(r->pool); - if (ctx->out_chain == NULL) { - return NGX_ERROR; - } - ctx->out_chain->buf = ctx->out_buf; - ctx->out_chain->next = NULL; - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "brotli encoder initialized: lvl:%i win:%d", conf->quality, - (1 << wbits)); - - return NGX_OK; -} - -static void* ngx_http_brotli_filter_alloc(void* opaque, size_t size) { - ngx_pool_t* pool = opaque; - void* p; - - p = ngx_palloc(pool, size); - -#if (NGX_DEBUG) - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pool->log, 0, "brotli alloc: %p, size:%uz", - p, size); -#endif - - return p; -} - -static void ngx_http_brotli_filter_free(void* opaque, void* address) { - ngx_pool_t* pool = opaque; - -#if (NGX_DEBUG) - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pool->log, 0, "brotli free: %p", address); -#endif - - ngx_pfree(pool, address); -} - -static void ngx_http_brotli_filter_close(ngx_http_brotli_ctx_t* ctx) { - ctx->closed = 1; - if (ctx->encoder) { - BrotliEncoderDestroyInstance(ctx->encoder); - ctx->encoder = NULL; - } - if (ctx->out_chain) { - ngx_free_chain(ctx->request->pool, ctx->out_chain); - ctx->out_chain = NULL; - } - if (ctx->out_buf) { - ngx_pfree(ctx->request->pool, ctx->out_buf); - ctx->out_buf = NULL; - } -} - -static ngx_int_t ngx_http_brotli_check_request(ngx_http_request_t* req) { - if (req != req->main) return NGX_DECLINED; - if (check_accept_encoding(req) != NGX_OK) return NGX_DECLINED; - req->gzip_tested = 1; - req->gzip_ok = 0; - return NGX_OK; -} - -static ngx_int_t ngx_http_brotli_add_variables(ngx_conf_t* cf) { - ngx_http_variable_t* var; - - var = ngx_http_add_variable(cf, &ngx_http_brotli_ratio, 0); - if (var == NULL) { - return NGX_ERROR; - } - - var->get_handler = ngx_http_brotli_ratio_variable; - - return NGX_OK; -} - -static ngx_int_t ngx_http_brotli_ratio_variable(ngx_http_request_t* r, - ngx_http_variable_value_t* v, - uintptr_t data) { - ngx_uint_t ratio_int; - ngx_uint_t ratio_frac; - ngx_http_brotli_ctx_t* ctx; - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - ctx = ngx_http_get_module_ctx(r, ngx_http_brotli_filter_module); - - /* Only report variable on non-failing streams. */ - if (ctx == NULL || !ctx->success) { - v->not_found = 1; - return NGX_OK; - } - - v->data = ngx_pnalloc(r->pool, NGX_INT32_LEN + 3); - if (v->data == NULL) { - return NGX_ERROR; - } - - ratio_int = (ngx_uint_t)(ctx->bytes_in / ctx->bytes_out); - ratio_frac = (ngx_uint_t)((ctx->bytes_in * 100 / ctx->bytes_out) % 100); - - /* Rounding; e.g. 2.125 to 2.13 */ - if ((ctx->bytes_in * 1000 / ctx->bytes_out) % 10 > 4) { - ratio_frac++; - if (ratio_frac > 99) { - ratio_int++; - ratio_frac = 0; - } - } - - v->len = ngx_sprintf(v->data, "%ui.%02ui", ratio_int, ratio_frac) - v->data; - - return NGX_OK; -} - -static void* ngx_http_brotli_create_conf(ngx_conf_t* cf) { - ngx_http_brotli_conf_t* conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_brotli_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* ngx_pcalloc fills result with zeros -> - conf->bufs.num = 0; - conf->types = { NULL }; - conf->types_keys = NULL; */ - - conf->enable = NGX_CONF_UNSET; - - conf->quality = NGX_CONF_UNSET; - conf->lg_win = NGX_CONF_UNSET_SIZE; - conf->min_length = NGX_CONF_UNSET; - - return conf; -} - -static char* ngx_http_brotli_merge_conf(ngx_conf_t* cf, void* parent, - void* child) { - ngx_http_brotli_conf_t* prev = parent; - ngx_http_brotli_conf_t* conf = child; - char* rc; - - ngx_conf_merge_value(conf->enable, prev->enable, 0); - - ngx_conf_merge_value(conf->quality, prev->quality, 6); - ngx_conf_merge_size_value(conf->lg_win, prev->lg_win, 19); - ngx_conf_merge_value(conf->min_length, prev->min_length, 20); - - rc = ngx_http_merge_types(cf, &conf->types_keys, &conf->types, - &prev->types_keys, &prev->types, - ngx_http_html_default_types); - if (rc != NGX_CONF_OK) { - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - -/* Prepend to filter chain. */ -static ngx_int_t ngx_http_brotli_filter_init(ngx_conf_t* cf) { - ngx_http_next_header_filter = ngx_http_top_header_filter; - ngx_http_top_header_filter = ngx_http_brotli_header_filter; - - ngx_http_next_body_filter = ngx_http_top_body_filter; - ngx_http_top_body_filter = ngx_http_brotli_body_filter; - - return NGX_OK; -} - -/* Translate "window size" to window bits (log2), and check bounds. */ -static char* ngx_http_brotli_parse_wbits(ngx_conf_t* cf, void* post, - void* data) { - size_t* parameter = data; - size_t bits; - size_t wsize; - - for (bits = BROTLI_MIN_WINDOW_BITS; bits <= BROTLI_MAX_WINDOW_BITS; bits++) { - wsize = 1u << bits; - if (*parameter == wsize) { - *parameter = bits; - return NGX_CONF_OK; - } - } - - return "must be 1k, 2k, 4k, 8k, 16k, 32k, 64k, 128k, 256k, 512k, 1m, 2m, 4m, " - "8m or 16m"; -} diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-before-test.sh b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-before-test.sh deleted file mode 100755 index 9f69164..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-before-test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -ex - -# Setup shortcuts. -ROOT=`pwd` -FILES=$ROOT/script/test - -# Setup directory structure. -cd $ROOT/script -if [ ! -d test ]; then - mkdir test -fi -cd test -if [ ! -d logs ]; then - mkdir logs -fi - -# Download sample texts. -curl --compressed -o $FILES/war-and-peace.txt http://www.gutenberg.org/files/2600/2600-0.txt -echo "Kot lomom kolol slona!" > $FILES/small.txt -echo "Kot lomom kolol slona!" > $FILES/small.html - -# Restore status-quo. -cd $ROOT diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-compile.sh b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-compile.sh deleted file mode 100755 index 2fa01d6..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-compile.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -set -ex - -# Setup shortcuts. -ROOT=`pwd` - -# Clone nginx read-only git repository. -if [ ! -d "nginx" ]; then - git clone https://github.com/nginx/nginx.git -fi - -# Build nginx + filter module. -cd $ROOT/nginx -# Pro memoria: --with-debug -./auto/configure \ - --prefix=$ROOT/script/test \ - --with-http_v2_module \ - --add-module=$ROOT -make -j 16 - -# Build brotli CLI. -cd $ROOT/deps/brotli -mkdir out -cd out -cmake .. -make -j 16 brotli - -# Restore status-quo. -cd $ROOT diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-test.sh b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-test.sh deleted file mode 100755 index 1db8d15..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-test.sh +++ /dev/null @@ -1,168 +0,0 @@ -#!/bin/bash - -# Setup shortcuts. -ROOT=`pwd` -NGINX=$ROOT/nginx/objs/nginx -BROTLI=$ROOT/deps/brotli/out/brotli -SERVER=http://localhost:8080 -FILES=$ROOT/script/test -HR="---------------------------------------------------------------------------" - -if [ ! -d tmp ]; then - mkdir tmp -fi - -rm tmp/* - -add_result() { - echo $1 >&2 - echo $1 >> tmp/results.log -} - -get_failed() { - echo `cat tmp/results.log | grep -v OK | wc -l` -} - -get_count() { - echo `cat tmp/results.log | wc -l` -} - -expect_equal() { - expected=$1 - actual=$2 - if cmp $expected $actual; then - add_result "OK" - else - add_result "FAIL (equality)" - fi -} - -expect_br_equal() { - expected=$1 - actual_br=$2 - if $BROTLI -dfk ./${actual_br}.br; then - expect_equal $expected $actual_br - else - add_result "FAIL (decompression)" - fi -} - -################################################################################ - -# Start default server. -echo "Statring NGINX" -$NGINX -c $ROOT/script/test.conf -# Fetch vanilla 404 response. -curl -s -o tmp/notfound.txt $SERVER/notfound - -CURL="curl -s" - -# Run tests. -echo $HR - -echo "Test: long file with rate limit" -$CURL -H 'Accept-encoding: br' -o tmp/war-and-peace.br --limit-rate 300K $SERVER/war-and-peace.txt -expect_br_equal $FILES/war-and-peace.txt tmp/war-and-peace - -echo "Test: compressed 404" -$CURL -H 'Accept-encoding: br' -o tmp/notfound.br $SERVER/notfound -expect_br_equal tmp/notfound.txt tmp/notfound - -echo "Test: A-E: 'gzip, br'" -$CURL -H 'Accept-encoding: gzip, br' -o tmp/ae-01.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/ae-01 - -echo "Test: A-E: 'gzip, br, deflate'" -$CURL -H 'Accept-encoding: gzip, br, deflate' -o tmp/ae-02.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/ae-02 - -echo "Test: A-E: 'gzip, br;q=1, deflate'" -$CURL -H 'Accept-encoding: gzip, br;q=1, deflate' -o tmp/ae-03.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/ae-03 - -echo "Test: A-E: 'br;q=0.001'" -$CURL -H 'Accept-encoding: br;q=0.001' -o tmp/ae-04.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/ae-04 - -echo "Test: A-E: 'bro'" -$CURL -H 'Accept-encoding: bro' -o tmp/ae-05.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-05.txt - -echo "Test: A-E: 'bo'" -$CURL -H 'Accept-encoding: bo' -o tmp/ae-06.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-06.txt - -echo "Test: A-E: 'br;q=0'" -$CURL -H 'Accept-encoding: br;q=0' -o tmp/ae-07.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-07.txt - -echo "Test: A-E: 'br;q=0.'" -$CURL -H 'Accept-encoding: br;q=0.' -o tmp/ae-08.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-08.txt - -echo "Test: A-E: 'br;q=0.0'" -$CURL -H 'Accept-encoding: br;q=0.0' -o tmp/ae-09.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-09.txt - -echo "Test: A-E: 'br;q=0.00'" -$CURL -H 'Accept-encoding: br;q=0.00' -o tmp/ae-10.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-10.txt - -echo "Test: A-E: 'br ; q = 0.000'" -$CURL -H 'Accept-encoding: br ; q = 0.000' -o tmp/ae-11.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-11.txt - -echo "Test: A-E: 'bar'" -$CURL -H 'Accept-encoding: bar' -o tmp/ae-12.txt $SERVER/small.html -expect_equal $FILES/small.html tmp/ae-12.txt - -echo "Test: A-E: 'b'" -$CURL -H 'Accept-encoding: b' -o tmp/ae-13.txt $SERVER/small.html -expect_equal $FILES/small.html tmp/ae-13.txt - -echo $HR -echo "Stopping default NGINX" -# Stop server. -$NGINX -c $ROOT/script/test.conf -s stop - -################################################################################ - -# Start default server. -echo "Statring h2 NGINX" -$NGINX -c $ROOT/script/test_h2.conf - -CURL="curl --http2-prior-knowledge -s" - -# Run tests. -echo $HR - -echo "Test: long file with rate limit" -$CURL -H 'Accept-encoding: br' -o tmp/h2-war-and-peace.br --limit-rate 300K $SERVER/war-and-peace.txt -expect_br_equal $FILES/war-and-peace.txt tmp/h2-war-and-peace - -echo "Test: A-E: 'gzip, br'" -$CURL -H 'Accept-encoding: gzip, br' -o tmp/h2-ae-01.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/h2-ae-01 - -echo "Test: A-E: 'b'" -$CURL -H 'Accept-encoding: b' -o tmp/h2-ae-13.txt $SERVER/small.html -expect_equal $FILES/small.html tmp/h2-ae-13.txt - -echo $HR -echo "Stopping h2 NGINX" -# Stop server. -$NGINX -c $ROOT/script/test_h2.conf -s stop - -################################################################################ - -# Report. - -FAILED=$(get_failed $STATUS) -COUNT=$(get_count $STATUS) -echo $HR -echo "Results: $FAILED of $COUNT tests failed" - -# Restore status-quo. -cd $ROOT - -exit $FAILED diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test.conf b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test.conf deleted file mode 100644 index 93957f9..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test.conf +++ /dev/null @@ -1,32 +0,0 @@ -events { - worker_connections 4; -} - -daemon on; -error_log /dev/stdout info; - -http { - access_log ./access.log; - error_log ./error.log; - - gzip on; - gzip_comp_level 1; - gzip_types text/plain text/css; - - brotli on; - brotli_comp_level 1; - brotli_types text/plain text/css; - - server { - listen 8080 default_server; - listen [::]:8080 default_server; - - root ./; - - index index.html; - - location / { - try_files $uri $uri/ =404; - } - } -} diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test_h2.conf b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test_h2.conf deleted file mode 100644 index 0f2c791..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test_h2.conf +++ /dev/null @@ -1,32 +0,0 @@ -events { - worker_connections 4; -} - -daemon on; -error_log /dev/stdout info; - -http { - access_log ./access.log; - error_log ./error.log; - - gzip on; - gzip_comp_level 1; - gzip_types text/plain text/css; - - brotli on; - brotli_comp_level 1; - brotli_types text/plain text/css; - - server { - listen 8080 http2; - listen [::]:8080 http2; - - root ./; - - index index.html; - - location / { - try_files $uri $uri/ =404; - } - } -} diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/config b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/config deleted file mode 100644 index de07d1c..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/config +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (C) 2015-2019 Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -if [ "$ngx_addon_name" = "ngx_brotli" ]; then - BROTLI_MODULE_SRC_DIR="$ngx_addon_dir/static" -else - BROTLI_MODULE_SRC_DIR="$ngx_addon_dir" -fi - -ngx_addon_name=ngx_brotli_static - -if [ -z "$ngx_module_link" ]; then -cat << END - -$0: error: Brotli module requires recent version of NGINX (1.9.11+). - -END - exit 1 -fi - -ngx_module_type=HTTP -ngx_module_name=ngx_http_brotli_static_module -ngx_module_incs= -ngx_module_deps= -ngx_module_srcs="$BROTLI_MODULE_SRC_DIR/ngx_http_brotli_static_module.c" -ngx_module_libs= -ngx_module_order= - -. auto/module - -have=NGX_HTTP_GZIP . auto/have -have=NGX_HTTP_BROTLI_STATIC . auto/have -have=NGX_HTTP_BROTLI_STATIC_MODULE . auto/have # deprecated diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/ngx_http_brotli_static_module.c b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/ngx_http_brotli_static_module.c deleted file mode 100644 index 44f0cb0..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/ngx_http_brotli_static_module.c +++ /dev/null @@ -1,323 +0,0 @@ - -/* - * Copyright (C) Igor Sysoev - * Copyright (C) Nginx, Inc. - * Copyright (C) Google Inc. - */ - -#include -#include -#include - -/* >> Configuration */ - -#define NGX_HTTP_BROTLI_STATIC_OFF 0 -#define NGX_HTTP_BROTLI_STATIC_ON 1 -#define NGX_HTTP_BROTLI_STATIC_ALWAYS 2 - -typedef struct { - ngx_uint_t enable; -} configuration_t; - -static ngx_conf_enum_t kBrotliStaticEnum[] = { - {ngx_string("off"), NGX_HTTP_BROTLI_STATIC_OFF}, - {ngx_string("on"), NGX_HTTP_BROTLI_STATIC_ON}, - {ngx_string("always"), NGX_HTTP_BROTLI_STATIC_ALWAYS}, - {ngx_null_string, 0}}; - -/* << Configuration */ - -/* >> Forward declarations */ - -static ngx_int_t handler(ngx_http_request_t* req); -static void* create_conf(ngx_conf_t* root_cfg); -static char* merge_conf(ngx_conf_t* root_cfg, void* parent, void* child); -static ngx_int_t init(ngx_conf_t* root_cfg); - -/* << Forward declarations*/ - -/* >> Module definition */ - -static ngx_command_t kCommands[] = { - {ngx_string("brotli_static"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE1, - ngx_conf_set_enum_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(configuration_t, enable), &kBrotliStaticEnum}, - ngx_null_command}; - -static ngx_http_module_t kModuleContext = { - NULL, /* preconfiguration */ - init, /* postconfiguration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - create_conf, /* create location configuration */ - merge_conf /* merge location configuration */ -}; - -ngx_module_t ngx_http_brotli_static_module = { - NGX_MODULE_V1, - &kModuleContext, /* module context */ - kCommands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING}; - -/* << Module definition*/ - -static const u_char kContentEncoding[] = "Content-Encoding"; -static /* const */ char kEncoding[] = "br"; -static const size_t kEncodingLen = 2; -static /* const */ u_char kSuffix[] = ".br"; -static const size_t kSuffixLen = 3; - -static ngx_int_t check_accept_encoding(ngx_http_request_t* req) { - ngx_table_elt_t* accept_encoding_entry; - ngx_str_t* accept_encoding; - u_char* cursor; - u_char* end; - u_char before; - u_char after; - - accept_encoding_entry = req->headers_in.accept_encoding; - if (accept_encoding_entry == NULL) return NGX_DECLINED; - accept_encoding = &accept_encoding_entry->value; - - cursor = accept_encoding->data; - end = cursor + accept_encoding->len; - while (1) { - u_char digit; - /* It would be an idiotic idea to rely on compiler to produce performant - binary, that is why we just do -1 at every call site. */ - cursor = ngx_strcasestrn(cursor, kEncoding, kEncodingLen - 1); - if (cursor == NULL) return NGX_DECLINED; - before = (cursor == accept_encoding->data) ? ' ' : cursor[-1]; - cursor += kEncodingLen; - after = (cursor >= end) ? ' ' : *cursor; - if (before != ',' && before != ' ') continue; - if (after != ',' && after != ' ' && after != ';') continue; - - /* Check for ";q=0[.[0[0[0]]]]" */ - while (*cursor == ' ') cursor++; - if (*(cursor++) != ';') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != 'q') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != '=') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != '0') break; - if (*(cursor++) != '.') return NGX_DECLINED; /* ;q=0, */ - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0., */ - if (digit > '0') break; - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0.0, */ - if (digit > '0') break; - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0.00, */ - if (digit > '0') break; - return NGX_DECLINED; /* ;q=0.000 */ - } - return NGX_OK; -} - -/* Test if this request is allowed to have the brotli response. */ -static ngx_int_t check_eligility(ngx_http_request_t* req) { - if (req != req->main) return NGX_DECLINED; - if (check_accept_encoding(req) != NGX_OK) return NGX_DECLINED; - req->gzip_tested = 1; - req->gzip_ok = 0; - return NGX_OK; -} - -static ngx_int_t handler(ngx_http_request_t* req) { - configuration_t* cfg; - ngx_int_t rc; - u_char* last; - ngx_str_t path; - size_t root; - ngx_log_t* log; - ngx_http_core_loc_conf_t* location_cfg; - ngx_open_file_info_t file_info; - ngx_table_elt_t* content_encoding_entry; - ngx_buf_t* buf; - ngx_chain_t out; - - /* Only GET and HEAD requensts are supported. */ - if (!(req->method & (NGX_HTTP_GET | NGX_HTTP_HEAD))) return NGX_DECLINED; - - /* Only files are supported. */ - if (req->uri.data[req->uri.len - 1] == '/') return NGX_DECLINED; - - /* Get configuration and check if module is disabled. */ - cfg = ngx_http_get_module_loc_conf(req, ngx_http_brotli_static_module); - if (cfg->enable == NGX_HTTP_BROTLI_STATIC_OFF) return NGX_DECLINED; - - if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ALWAYS) { - /* Ignore request properties (e.g. Accept-Encoding). */ - } else { - /* NGX_HTTP_BROTLI_STATIC_ON */ - rc = check_eligility(req); - if (rc != NGX_OK) return NGX_DECLINED; - } - - /* Get path and append the suffix. */ - last = ngx_http_map_uri_to_path(req, &path, &root, kSuffixLen); - if (last == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; - /* +1 for reinstating the terminating 0. */ - ngx_cpystrn(last, kSuffix, kSuffixLen + 1); - path.len += kSuffixLen; - - log = req->connection->log; - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http filename: \"%s\"", - path.data); - - /* Prepare to read the file. */ - location_cfg = ngx_http_get_module_loc_conf(req, ngx_http_core_module); - ngx_memzero(&file_info, sizeof(ngx_open_file_info_t)); - file_info.read_ahead = location_cfg->read_ahead; - file_info.directio = location_cfg->directio; - file_info.valid = location_cfg->open_file_cache_valid; - file_info.min_uses = location_cfg->open_file_cache_min_uses; - file_info.errors = location_cfg->open_file_cache_errors; - file_info.events = location_cfg->open_file_cache_events; - rc = ngx_http_set_disable_symlinks(req, location_cfg, &path, &file_info); - if (rc != NGX_OK) return NGX_HTTP_INTERNAL_SERVER_ERROR; - - /* Try to fetch file and process errors. */ - rc = ngx_open_cached_file(location_cfg->open_file_cache, &path, &file_info, - req->pool); - if (rc != NGX_OK) { - ngx_uint_t level; - switch (file_info.err) { - case 0: - return NGX_HTTP_INTERNAL_SERVER_ERROR; - - case NGX_ENOENT: - case NGX_ENOTDIR: - case NGX_ENAMETOOLONG: - return NGX_DECLINED; - -#if (NGX_HAVE_OPENAT) - case NGX_EMLINK: - case NGX_ELOOP: -#endif - case NGX_EACCES: - level = NGX_LOG_ERR; - break; - - default: - level = NGX_LOG_CRIT; - break; - } - ngx_log_error(level, log, file_info.err, "%s \"%s\" failed", - file_info.failed, path.data); - return NGX_DECLINED; - } - - if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ON) { - req->gzip_vary = 1; - } - - /* So far so good. */ - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", - file_info.fd); - - /* Only files are supported. */ - if (file_info.is_dir) { - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir"); - return NGX_DECLINED; - } -#if !(NGX_WIN32) - if (!file_info.is_file) { - ngx_log_error(NGX_LOG_CRIT, log, 0, "\"%s\" is not a regular file", - path.data); - return NGX_HTTP_NOT_FOUND; - } -#endif - - /* Prepare request push the body. */ - req->root_tested = !req->error_page; - rc = ngx_http_discard_request_body(req); - if (rc != NGX_OK) return rc; - log->action = "sending response to client"; - req->headers_out.status = NGX_HTTP_OK; - req->headers_out.content_length_n = file_info.size; - req->headers_out.last_modified_time = file_info.mtime; - rc = ngx_http_set_etag(req); - if (rc != NGX_OK) return NGX_HTTP_INTERNAL_SERVER_ERROR; - rc = ngx_http_set_content_type(req); - if (rc != NGX_OK) return NGX_HTTP_INTERNAL_SERVER_ERROR; - - /* Set "Content-Encoding" header. */ - content_encoding_entry = ngx_list_push(&req->headers_out.headers); - if (content_encoding_entry == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; - content_encoding_entry->hash = 1; - ngx_str_set(&content_encoding_entry->key, kContentEncoding); - ngx_str_set(&content_encoding_entry->value, kEncoding); - req->headers_out.content_encoding = content_encoding_entry; - - /* Setup response body. */ - buf = ngx_pcalloc(req->pool, sizeof(ngx_buf_t)); - if (buf == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; - buf->file = ngx_pcalloc(req->pool, sizeof(ngx_file_t)); - if (buf->file == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; - buf->file_pos = 0; - buf->file_last = file_info.size; - buf->in_file = buf->file_last ? 1 : 0; - buf->last_buf = (req == req->main) ? 1 : 0; - buf->last_in_chain = 1; - buf->file->fd = file_info.fd; - buf->file->name = path; - buf->file->log = log; - buf->file->directio = file_info.is_directio; - out.buf = buf; - out.next = NULL; - - /* Push the response header. */ - rc = ngx_http_send_header(req); - if (rc == NGX_ERROR || rc > NGX_OK || req->header_only) { - return rc; - } - - /* Push the response body. */ - return ngx_http_output_filter(req, &out); -} - -static void* create_conf(ngx_conf_t* root_cfg) { - configuration_t* cfg; - cfg = ngx_palloc(root_cfg->pool, sizeof(configuration_t)); - if (cfg == NULL) return NULL; - cfg->enable = NGX_CONF_UNSET_UINT; - return cfg; -} - -static char* merge_conf(ngx_conf_t* root_cfg, void* parent, void* child) { - configuration_t* prev = parent; - configuration_t* cfg = child; - ngx_conf_merge_uint_value(cfg->enable, prev->enable, - NGX_HTTP_BROTLI_STATIC_OFF); - return NGX_CONF_OK; -} - -static ngx_int_t init(ngx_conf_t* root_cfg) { - ngx_http_core_main_conf_t* core_cfg; - ngx_http_handler_pt* handler_slot; - core_cfg = ngx_http_conf_get_module_main_conf(root_cfg, ngx_http_core_module); - handler_slot = - ngx_array_push(&core_cfg->phases[NGX_HTTP_CONTENT_PHASE].handlers); - if (handler_slot == NULL) return NGX_ERROR; - *handler_slot = handler; - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.astylerc b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.astylerc deleted file mode 100644 index 3c009b3..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.astylerc +++ /dev/null @@ -1,22 +0,0 @@ -# astylerc -align-pointer=name -align-reference=name -break-after-logical -#indent=spaces=2 -max-code-length=120 -style=google -suffix=none - -# Indent -indent-preproc-block - -# Padding -pad-header -unpad-paren - -# Formatting: -add-brackets -#convert-tabs - -# Output: -formatted \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.format.sh b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.format.sh deleted file mode 100755 index 75209eb..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.format.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Search in the script folder -pushd "$(dirname $0)" >/dev/null -CWD="$(pwd -P)" -popd >/dev/null -FILES='ngx_cache_purge_module.c' - -# The file format in accordance with the style defined in .astylerc -astyle -v --options='.astylerc' ${FILES} || (echo 'astyle failed'; exit 1); - -# To correct this, the issuance dos2unix on each file -# sometimes adds in Windows as a string-endins (\r\n). -dos2unix --quiet ${FILES} || (echo 'dos2unix failed'; exit 2); \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.gitattributes b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.gitattributes deleted file mode 100644 index 9b27d9f..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.travis.yml b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.travis.yml deleted file mode 100644 index 3714921..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -sudo: required -os: linux -dist: trusty -language: c -compiler: - - gcc - - clang -cache: - apt: true - directories: - - download-cache -env: - global: - - JOBS=4 - - NGINX_PREFIX=/opt/nginx - matrix: - - NGINX_VERSION=1.18.0 - - NGINX_VERSION=1.19.2 - -before_install: - - mkdir --parents download-cache - - sudo apt-get update -qq - - sudo apt-get install -qq zlib1g-dev libpcre3-dev cpanminus - # Get OpenSSL 1.0.2 from Ubuntu Xenial - # https://packages.ubuntu.com/xenial-updates/libssl1.0.0 - - test -f download-cache/libssl1.0.0_1.0.2g-1ubuntu4.16_amd64.deb || wget -O download-cache/libssl1.0.0_1.0.2g-1ubuntu4.17_amd64.deb "http://de.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.17_amd64.deb" - # https://packages.ubuntu.com/xenial/libssl-dev - - test -f download-cache/libssl-dev_1.0.2g-1ubuntu4.16_amd64.deb || wget -O download-cache/libssl-dev_1.0.2g-1ubuntu4.17_amd64.deb "http://de.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.0.2g-1ubuntu4.17_amd64.deb" - - sudo dpkg -i download-cache/libssl*_amd64.deb - # Test::Nginx - - git clone https://github.com/openresty/test-nginx.git test-nginx - - cd test-nginx/ && sudo cpanm . && cd .. - # NGINX source - - test -f download-cache/nginx-$NGINX_VERSION.tar.gz || wget -O download-cache/nginx-$NGINX_VERSION.tar.gz http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz - -install: - - tar -xzf download-cache/nginx-${NGINX_VERSION}.tar.gz - - cd nginx-${NGINX_VERSION}/ - - ./configure --prefix=${NGINX_PREFIX} --with-debug --with-http_ssl_module --add-module=${PWD}/.. - - make -j${JOBS} - - sudo make install - - cd .. - - export PATH="${NGINX_PREFIX}/sbin:$PATH" -# - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} - -script: - - nginx -V - - ldd $(which nginx) - - prove t diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/CHANGES b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/CHANGES deleted file mode 100644 index 7495742..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/CHANGES +++ /dev/null @@ -1,103 +0,0 @@ -2020-06-27 VERSION 2.5.1 - * fix: empty key check - it coredumps when cache key is empty, Tuğrul Topuz - * fix: purge report calloc fix - Report template has not cache file path but it's length is use in buffer memory allocation, Tuğrul Topuz - -2018-08-04 VERSION 2.5 - * feat/docs: cache_purge_response_type directive, selecting response type (html|json|xml|text) - * break: changed status of HTTP code 404 (Not Found) to 412 (Precondition Failed) - * fix: remove path information of response body (#4, 3a8c08a, #11) - -2020-06-27 VERSION 2.4.3 - * fix: empty key check - it coredumps when cache key is empty, Tuğrul Topuz - -2017-09-28 VERSION 2.4.2 - * fix: segfault in call to `ngx_read_file` of partial key purge, Frankie Dintino - * fix: segfault in `cplcf->conf->purge_all` with separate location syntax, Frankie Dintino - -2017-02-21 VERSION 2.4.1 - * Fix compatibility with nginx-1.11.6+, Sułowicz Paweł - -2016-11-20 VERSION 2.4 - * Fix compatibility with nginx-1.7.12+. - * explain the purge logic - * feat(purge all): Include option to purge all the cached files - This option can be slow if a lot of content is cached, or if the - storage used for the cache is slow. But you really should be using - RAM as your cache storage. - * feat(partial keys): Support partial keys to purge multiple keys. - Put an '*' at the end of your purge cache URL. - e.g: - proxy_cache_key $scheme$host$uri$is_args$args$cookie_JSESSIONID; - curl -X PURGE https://example.com/pass* - This will remove every cached page whose key cache starting with: - httpsexample.com/pass* - Be careful not passing any value for the values after the $uri, or put - it at the end of your cache key. - * Convert a config file to build a dynamic module - -2014-12-23 VERSION 2.3 - * Fix compatibility with nginx-1.7.9+. - -2014-12-02 VERSION 2.2 - * Fix compatibility with nginx-1.7.8+. - -2014-05-19 - * Fix build on Solaris with SunCC (Solaris Studio). - Reported by Jussi Sallinen. - -2013-03-19 VERSION 2.1 - * When enabled, cache purge will now catch all requests with - PURGE (or specified) method, even if cache isn't configured. - Previously, it would pass such requests to the upstream. - -2012-12-07 VERSION 2.0 - * Add alternative "same location" syntax. - From CloudFlare. - -2012-07-02 VERSION 1.6 - * Fix compatibility with nginx-1.3.2+. - Reported by MagicBear, patch from Ruslan Ermilov. - -2011-12-20 VERSION 1.5 - * Fix on-disk cache size calculation. - Since the initial release, recorded on-disk cache size was - decreased twice for purged content (once during cache purge - and once during subsequent cache update). - This resulted in recorded on-disk cache size being much - smaller than in reality, which could lead to on-disk cache - outgrowing defined "max_size" parameter. - Patch from Pyry Hakulinen. - -2011-10-05 VERSION 1.4 - * Add AIO support. - Requested by Emin Hasanov. - -2011-05-03 VERSION 1.3 - * Fix compatibility with nginx-1.0.1. - Reported by Sergey A. Osokin and Markus Linnala. - -2010-08-29 - * Fix compatibility with nginx-0.8.0 and versions older than - nginx-0.7.60. - -2010-08-11 VERSION 1.2 - * Fix various build scenarios with disabled upstream modules. - Reported by Johan Bergstroem. - - * Add ability to purge content from SCGI's cache. - Requested by Johan Bergstroem. - -2010-06-08 VERSION 1.1 - * Fix compatibility with nginx-0.8.40+. - - * Add ability to purge content from uWSGI's cache. - -2010-01-10 VERSION 1.0 - * Initial module release. - -2009-11-17 - * Fix patch compatibility with nginx-0.8.11+. - Reported by Bing Ran. - -2009-08-11 - * Initial patch release. diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/LICENSE b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/LICENSE deleted file mode 100644 index 0047538..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2009-2014, FRiCKLE -Copyright (c) 2009-2014, Piotr Sikora -All rights reserved. - -This project was fully funded by yo.se. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/README.md b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/README.md deleted file mode 100644 index e3d92b4..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/README.md +++ /dev/null @@ -1,283 +0,0 @@ -About -===== -`ngx_cache_purge` is `nginx` module which adds ability to purge content from -`FastCGI`, `proxy`, `SCGI` and `uWSGI` caches. A purge operation removes the -content with the same cache key as the purge request has. - - -Sponsors -======== -Work on the original patch was fully funded by [yo.se](http://yo.se). - - -Status -====== -This module is production-ready. - - -Configuration directives (same location syntax) -=============================================== -fastcgi_cache_purge -------------------- -* **syntax**: `fastcgi_cache_purge on|off| [purge_all] [from all| [.. ]]` -* **default**: `none` -* **context**: `http`, `server`, `location` - -Allow purging of selected pages from `FastCGI`'s cache. - - -proxy_cache_purge ------------------ -* **syntax**: `proxy_cache_purge on|off| [purge_all] [from all| [.. ]]` -* **default**: `none` -* **context**: `http`, `server`, `location` - -Allow purging of selected pages from `proxy`'s cache. - - -scgi_cache_purge ----------------- -* **syntax**: `scgi_cache_purge on|off| [purge_all] [from all| [.. ]]` -* **default**: `none` -* **context**: `http`, `server`, `location` - -Allow purging of selected pages from `SCGI`'s cache. - - -uwsgi_cache_purge ------------------ -* **syntax**: `uwsgi_cache_purge on|off| [purge_all] [from all| [.. ]]` -* **default**: `none` -* **context**: `http`, `server`, `location` - -Allow purging of selected pages from `uWSGI`'s cache. - - -Configuration directives (separate location syntax) -=================================================== -fastcgi_cache_purge -------------------- -* **syntax**: `fastcgi_cache_purge zone_name key` -* **default**: `none` -* **context**: `location` - -Sets area and key used for purging selected pages from `FastCGI`'s cache. - - -proxy_cache_purge ------------------ -* **syntax**: `proxy_cache_purge zone_name key` -* **default**: `none` -* **context**: `location` - -Sets area and key used for purging selected pages from `proxy`'s cache. - - -scgi_cache_purge ----------------- -* **syntax**: `scgi_cache_purge zone_name key` -* **default**: `none` -* **context**: `location` - -Sets area and key used for purging selected pages from `SCGI`'s cache. - - -uwsgi_cache_purge ------------------ -* **syntax**: `uwsgi_cache_purge zone_name key` -* **default**: `none` -* **context**: `location` - -Sets area and key used for purging selected pages from `uWSGI`'s cache. - -Configuration directives (Optional) -=================================================== - -cache_purge_response_type ------------------ -* **syntax**: `cache_purge_response_type html|json|xml|text` -* **default**: `html` -* **context**: `http`, `server`, `location` - -Sets a response type of purging result. - - - -Partial Keys -============ -Sometimes it's not possible to pass the exact key cache to purge a page. For example; when the content of a cookie or the params are part of the key. -You can specify a partial key adding an asterisk at the end of the URL. - - curl -X PURGE /page* - -The asterisk must be the last character of the key, so you **must** put the $uri variable at the end. - - - -Sample configuration (same location syntax) -=========================================== - http { - proxy_cache_path /tmp/cache keys_zone=tmpcache:10m; - - server { - location / { - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - proxy_cache_purge PURGE from 127.0.0.1; - } - } - } - - -Sample configuration (same location syntax - purge all cached files) -==================================================================== - http { - proxy_cache_path /tmp/cache keys_zone=tmpcache:10m; - - server { - location / { - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - proxy_cache_purge PURGE purge_all from 127.0.0.1 192.168.0.0/8; - } - } - } - - -Sample configuration (separate location syntax) -=============================================== - http { - proxy_cache_path /tmp/cache keys_zone=tmpcache:10m; - - server { - location / { - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - } - - location ~ /purge(/.*) { - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - } - } - } - -Sample configuration (Optional) -=============================================== - http { - proxy_cache_path /tmp/cache keys_zone=tmpcache:10m; - - cache_purge_response_type text; - - server { - - cache_purge_response_type json; - - location / { #json - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - } - - location ~ /purge(/.*) { #xml - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - cache_purge_response_type xml; - } - - location ~ /purge2(/.*) { # json - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - } - } - - server { - - location / { #text - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - } - - location ~ /purge(/.*) { #text - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - } - - location ~ /purge2(/.*) { #html - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - cache_purge_response_type html; - } - } - } - - - -Solve problems -============== -* Enabling [`gzip_vary`](https://nginx.org/r/gzip_vary) can lead to different results when clearing, when enabling it, you may have problems clearing the cache. For reliable operation, you can disable [`gzip_vary`](https://nginx.org/r/gzip_vary) inside the location [#20](https://github.com/nginx-modules/ngx_cache_purge/issues/20). - - -Testing -======= -`ngx_cache_purge` comes with complete test suite based on [Test::Nginx](http://github.com/agentzh/test-nginx). - -You can test it by running: - -`$ prove` - - -License -======= - Copyright (c) 2009-2014, FRiCKLE - Copyright (c) 2009-2014, Piotr Sikora - All rights reserved. - - This project was fully funded by yo.se. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -See also -======== -- [ngx_slowfs_cache](http://github.com/FRiCKLE/ngx_slowfs_cache). -- http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#purger -- http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_cache_purge -- https://github.com/wandenberg/nginx-selective-cache-purge-module -- https://github.com/wandenberg/nginx-sorted-querystring-module -- https://github.com/ledgetech/ledge -- [Faking Surrogate Cache-Keys for Nginx Plus](https://www.innoq.com/en/blog/faking-surrogate-cache-keys-for-nginx-plus/) ([gist](https://gist.github.com/titpetric/2f142e89eaa0f36ba4e4383b16d61474)) -- [Delete NGINX cached md5 items with a PURGE with wildcard support](https://gist.github.com/nosun/0cfb58d3164f829e2f027fd37b338ede) diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/config b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/config deleted file mode 100644 index b900680..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/config +++ /dev/null @@ -1,31 +0,0 @@ -if [ "$HTTP_PROXY" = "YES" ]; then - have=NGX_HTTP_PROXY . auto/have -fi - -if [ "$HTTP_FASTCGI" = "YES" ]; then - have=NGX_HTTP_FASTCGI . auto/have -fi - -if [ "$HTTP_SCGI" = "YES" ]; then - have=NGX_HTTP_SCGI . auto/have -fi - -if [ "$HTTP_UWSGI" = "YES" ]; then - have=NGX_HTTP_UWSGI . auto/have -fi - -ngx_addon_name=ngx_http_cache_purge_module -CACHE_PURGE_SRCS="$ngx_addon_dir/ngx_cache_purge_module.c" - -if [ -n "$ngx_module_link" ]; then - ngx_module_type=HTTP - ngx_module_name="$ngx_addon_name" - ngx_module_srcs="$CACHE_PURGE_SRCS" - - . auto/module -else - HTTP_MODULES="$HTTP_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $CACHE_PURGE_SRCS" -fi - -have=NGX_CACHE_PURGE_MODULE . auto/have diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/changelog b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/changelog deleted file mode 100644 index 9e03744..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/changelog +++ /dev/null @@ -1,74 +0,0 @@ -libnginx-mod-http-cache-purge (1:2.5.3-3) unstable; urgency=medium - - * d/control: update my email to janmojzis@debian.org - * d/copyright: update my email to janmojzis@debian.org - * d/control: bump Standards-Version: 4.7.2, no changes - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:56 +0200 - -libnginx-mod-http-cache-purge (1:2.5.3-2) unstable; urgency=medium - - * d/changelog fix closed bug number 1019003 -> 1055742 (Closes: 1055742) - - -- Jan Mojžíš Fri, 21 Jun 2024 19:34:05 +0200 - -libnginx-mod-http-cache-purge (1:2.5.3-1) unstable; urgency=medium - - * switch to a new upstream - https://github.com/nginx-modules/ngx_cache_purge - (Closes: 1072836) (Closes: 1055742) - * d/p/dynamic-module.patch remove, fixed in upstream - * d/p/segfault-1.11.6.patch remove, fixed in upstream - * d/t/purgetest added - * d/copyright: bump my copyright year - * d/gbp.conf: add [pull] track-missing = True - * d/control: bump Standards-Version: 4.7.0, no changes - - -- Jan Mojžíš Fri, 21 Jun 2024 13:36:53 +0200 - -libnginx-mod-http-cache-purge (1:2.3-6) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:25 +0200 - -libnginx-mod-http-cache-purge (1:2.3-5) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:35 +0200 - -libnginx-mod-http-cache-purge (1:2.3-4) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: bump my copyright year - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:14 +0100 - -libnginx-mod-http-cache-purge (1:2.3-3) unstable; urgency=medium - - * d/copyright: fixed typo (empty line ngx_cache_purge_module.c) - - -- Jan Mojžíš Fri, 09 Dec 2022 14:50:48 +0100 - -libnginx-mod-http-cache-purge (1:2.3-2) experimental; urgency=medium - - * d/control: added Multi-Arch: foreign - * d/copyright: add Igor Sysoev + Nginx, Inc. - - -- Jan Mojžíš Mon, 05 Dec 2022 21:15:13 +0100 - -libnginx-mod-http-cache-purge (1:2.3-1) experimental; urgency=medium - - * Initial release. (Closes: 1024213) - * Additional info: The separate package libnginx-mod-http-cache-purge ships - newest version of ngx_cache_purge (Closes: 911099) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:45 +0100 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/control b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/control deleted file mode 100644 index 3936731..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/control +++ /dev/null @@ -1,23 +0,0 @@ -Source: libnginx-mod-http-cache-purge -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, -Standards-Version: 4.7.2 -Homepage: https://github.com/FRiCKLE/ngx_cache_purge -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-cache-purge.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-cache-purge -Rules-Requires-Root: no - -Package: libnginx-mod-http-cache-purge -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Purge content from Nginx caches - Cache Purge module adds purging capabilities to Nginx. It allows purging - content from caches used by all of Nginx proxy modules, like FastCGI, Proxy, - SCGI and uWSGI. diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/copyright b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/copyright deleted file mode 100644 index a0ef36d..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/copyright +++ /dev/null @@ -1,36 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ngx_cache_purge -Upstream-Contact: FRiCKLE -Source: https://github.com/FRiCKLE/ngx_cache_purge - -Files: * -Copyright: 2009-2014, Piotr Sikora - 2009-2014, FRiCKLE -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/gbp.conf b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/gbp.conf deleted file mode 100644 index 97cd209..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/gbp.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/rules b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/source/format b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/control b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/control deleted file mode 100644 index dd4e1a3..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/control +++ /dev/null @@ -1,13 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: purgetest -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/generic b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/purgetest b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/purgetest deleted file mode 100644 index 1574080..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/purgetest +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; -proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; - -server { - listen 127.0.0.1:80 default_server; - - location /proxy { - proxy_pass \$scheme://127.0.0.1:\$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key \$uri\$is_args\$args; - proxy_cache_valid 3m; - add_header X-Cache-Status \$upstream_cache_status; - } - - location ~ /purge(/.*) { - proxy_cache_purge test_cache \$1\$is_args\$args; - } - - location = /etc/passwd { - root /; - } -} -EOF - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -curl --fail -s -o /dev/null -w "GET key: %{http_code}\n" http://127.0.0.1/proxy/passwd -curl --fail -s -o /dev/null -w "PURGE existing key: %{http_code}\n" -X PURGE http://127.0.0.1/purge/proxy/passwd -curl -s -o /dev/null -w "PURGE non-existing key: %{http_code}\n" -X PURGE http://127.0.0.1/purge/proxy/passwd diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/upstream/metadata b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/upstream/metadata deleted file mode 100644 index ca2631c..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/FRiCKLE/ngx_cache_purge/issues -Bug-Submit: https://github.com/FRiCKLE/ngx_cache_purge/issues/new -Repository-Browse: https://github.com/FRiCKLE/ngx_cache_purge \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/watch b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/watch deleted file mode 100644 index 11bd9bf..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/nginx-modules/ngx_cache_purge/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/ngx_cache_purge_module.c b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/ngx_cache_purge_module.c deleted file mode 100644 index 251d3fe..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/ngx_cache_purge_module.c +++ /dev/null @@ -1,2163 +0,0 @@ -/* - * Copyright (c) 2009-2014, FRiCKLE - * Copyright (c) 2009-2014, Piotr Sikora - * All rights reserved. - * - * This project was fully funded by yo.se. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include - - -#ifndef nginx_version - #error This module cannot be build against an unknown nginx version. -#endif - -#define NGX_REPONSE_TYPE_HTML 1 -#define NGX_REPONSE_TYPE_XML 2 -#define NGX_REPONSE_TYPE_JSON 3 -#define NGX_REPONSE_TYPE_TEXT 4 - -static const char ngx_http_cache_purge_content_type_json[] = "application/json"; -static const char ngx_http_cache_purge_content_type_html[] = "text/html"; -static const char ngx_http_cache_purge_content_type_xml[] = "text/xml"; -static const char ngx_http_cache_purge_content_type_text[] = "text/plain"; - -static size_t ngx_http_cache_purge_content_type_json_size = sizeof(ngx_http_cache_purge_content_type_json); -static size_t ngx_http_cache_purge_content_type_html_size = sizeof(ngx_http_cache_purge_content_type_html); -static size_t ngx_http_cache_purge_content_type_xml_size = sizeof(ngx_http_cache_purge_content_type_xml); -static size_t ngx_http_cache_purge_content_type_text_size = sizeof(ngx_http_cache_purge_content_type_text); - -static const char ngx_http_cache_purge_body_templ_json[] = "{\"Key\": \"%s\"}"; -static const char ngx_http_cache_purge_body_templ_html[] = "Successful purge

Successful purge

Key : %s

"; -static const char ngx_http_cache_purge_body_templ_xml[] = ""; -static const char ngx_http_cache_purge_body_templ_text[] = "Key:%s\n"; - -static size_t ngx_http_cache_purge_body_templ_json_size = sizeof(ngx_http_cache_purge_body_templ_json); -static size_t ngx_http_cache_purge_body_templ_html_size = sizeof(ngx_http_cache_purge_body_templ_html); -static size_t ngx_http_cache_purge_body_templ_xml_size = sizeof(ngx_http_cache_purge_body_templ_xml); -static size_t ngx_http_cache_purge_body_templ_text_size = sizeof(ngx_http_cache_purge_body_templ_text); - -#if (NGX_HTTP_CACHE) - -typedef struct { - ngx_flag_t enable; - ngx_str_t method; - ngx_flag_t purge_all; - ngx_array_t *access; /* array of ngx_in_cidr_t */ - ngx_array_t *access6; /* array of ngx_in6_cidr_t */ -} ngx_http_cache_purge_conf_t; - -typedef struct { -# if (NGX_HTTP_FASTCGI) - ngx_http_cache_purge_conf_t fastcgi; -# endif /* NGX_HTTP_FASTCGI */ -# if (NGX_HTTP_PROXY) - ngx_http_cache_purge_conf_t proxy; -# endif /* NGX_HTTP_PROXY */ -# if (NGX_HTTP_SCGI) - ngx_http_cache_purge_conf_t scgi; -# endif /* NGX_HTTP_SCGI */ -# if (NGX_HTTP_UWSGI) - ngx_http_cache_purge_conf_t uwsgi; -# endif /* NGX_HTTP_UWSGI */ - - ngx_http_cache_purge_conf_t *conf; - ngx_http_handler_pt handler; - ngx_http_handler_pt original_handler; - - ngx_uint_t resptype; /* response content-type */ -} ngx_http_cache_purge_loc_conf_t; - -# if (NGX_HTTP_FASTCGI) -char *ngx_http_fastcgi_cache_purge_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_fastcgi_cache_purge_handler(ngx_http_request_t *r); -# endif /* NGX_HTTP_FASTCGI */ - -# if (NGX_HTTP_PROXY) -char *ngx_http_proxy_cache_purge_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_proxy_cache_purge_handler(ngx_http_request_t *r); -# endif /* NGX_HTTP_PROXY */ - -# if (NGX_HTTP_SCGI) -char *ngx_http_scgi_cache_purge_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_scgi_cache_purge_handler(ngx_http_request_t *r); -# endif /* NGX_HTTP_SCGI */ - -# if (NGX_HTTP_UWSGI) -char *ngx_http_uwsgi_cache_purge_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_uwsgi_cache_purge_handler(ngx_http_request_t *r); -# endif /* NGX_HTTP_UWSGI */ - -char *ngx_http_cache_purge_response_type_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static ngx_int_t -ngx_http_purge_file_cache_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path); -static ngx_int_t -ngx_http_purge_file_cache_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path); - -ngx_int_t ngx_http_cache_purge_access_handler(ngx_http_request_t *r); -ngx_int_t ngx_http_cache_purge_access(ngx_array_t *a, ngx_array_t *a6, - struct sockaddr *s); - -ngx_int_t ngx_http_cache_purge_send_response(ngx_http_request_t *r); -# if (nginx_version >= 1007009) -ngx_int_t ngx_http_cache_purge_cache_get(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_file_cache_t **cache); -# endif /* nginx_version >= 1007009 */ -ngx_int_t ngx_http_cache_purge_init(ngx_http_request_t *r, - ngx_http_file_cache_t *cache, ngx_http_complex_value_t *cache_key); -void ngx_http_cache_purge_handler(ngx_http_request_t *r); - -ngx_int_t ngx_http_file_cache_purge(ngx_http_request_t *r); - - -void ngx_http_cache_purge_all(ngx_http_request_t *r, ngx_http_file_cache_t *cache); -void ngx_http_cache_purge_partial(ngx_http_request_t *r, ngx_http_file_cache_t *cache); -ngx_int_t ngx_http_cache_purge_is_partial(ngx_http_request_t *r); - -char *ngx_http_cache_purge_conf(ngx_conf_t *cf, - ngx_http_cache_purge_conf_t *cpcf); - -void *ngx_http_cache_purge_create_loc_conf(ngx_conf_t *cf); -char *ngx_http_cache_purge_merge_loc_conf(ngx_conf_t *cf, - void *parent, void *child); - -static ngx_command_t ngx_http_cache_purge_module_commands[] = { - -# if (NGX_HTTP_FASTCGI) - { - ngx_string("fastcgi_cache_purge"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_fastcgi_cache_purge_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL - }, -# endif /* NGX_HTTP_FASTCGI */ - -# if (NGX_HTTP_PROXY) - { - ngx_string("proxy_cache_purge"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_proxy_cache_purge_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL - }, -# endif /* NGX_HTTP_PROXY */ - -# if (NGX_HTTP_SCGI) - { - ngx_string("scgi_cache_purge"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_scgi_cache_purge_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL - }, -# endif /* NGX_HTTP_SCGI */ - -# if (NGX_HTTP_UWSGI) - { - ngx_string("uwsgi_cache_purge"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_uwsgi_cache_purge_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL - }, -# endif /* NGX_HTTP_UWSGI */ - - - { ngx_string("cache_purge_response_type"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_http_cache_purge_response_type_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL }, - - ngx_null_command -}; - -static ngx_http_module_t ngx_http_cache_purge_module_ctx = { - NULL, /* preconfiguration */ - NULL, /* postconfiguration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_cache_purge_create_loc_conf, /* create location configuration */ - ngx_http_cache_purge_merge_loc_conf /* merge location configuration */ -}; - -ngx_module_t ngx_http_cache_purge_module = { - NGX_MODULE_V1, - &ngx_http_cache_purge_module_ctx, /* module context */ - ngx_http_cache_purge_module_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - -# if (NGX_HTTP_FASTCGI) -extern ngx_module_t ngx_http_fastcgi_module; - -# if (nginx_version >= 1007009) - -typedef struct { - ngx_array_t caches; /* ngx_http_file_cache_t * */ -} ngx_http_fastcgi_main_conf_t; - -# endif /* nginx_version >= 1007009 */ - -# if (nginx_version >= 1007008) - -typedef struct { - ngx_array_t *flushes; - ngx_array_t *lengths; - ngx_array_t *values; - ngx_uint_t number; - ngx_hash_t hash; -} ngx_http_fastcgi_params_t; - -# endif /* nginx_version >= 1007008 */ - -typedef struct { - ngx_http_upstream_conf_t upstream; - - ngx_str_t index; - -# if (nginx_version >= 1007008) - ngx_http_fastcgi_params_t params; - ngx_http_fastcgi_params_t params_cache; -# else - ngx_array_t *flushes; - ngx_array_t *params_len; - ngx_array_t *params; -# endif /* nginx_version >= 1007008 */ - - ngx_array_t *params_source; - ngx_array_t *catch_stderr; - - ngx_array_t *fastcgi_lengths; - ngx_array_t *fastcgi_values; - -# if (nginx_version >= 8040) && (nginx_version < 1007008) - ngx_hash_t headers_hash; - ngx_uint_t header_params; -# endif /* nginx_version >= 8040 && nginx_version < 1007008 */ - -# if (nginx_version >= 1001004) - ngx_flag_t keep_conn; -# endif /* nginx_version >= 1001004 */ - - ngx_http_complex_value_t cache_key; - -# if (NGX_PCRE) - ngx_regex_t *split_regex; - ngx_str_t split_name; -# endif /* NGX_PCRE */ -} ngx_http_fastcgi_loc_conf_t; - -char * -ngx_http_fastcgi_cache_purge_conf(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) { - ngx_http_compile_complex_value_t ccv; - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_http_core_loc_conf_t *clcf; - ngx_http_fastcgi_loc_conf_t *flcf; - ngx_str_t *value; -# if (nginx_version >= 1007009) - ngx_http_complex_value_t cv; -# endif /* nginx_version >= 1007009 */ - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->fastcgi.enable != NGX_CONF_UNSET) { - return "is duplicate"; - } - - if (cf->args->nelts != 3) { - return ngx_http_cache_purge_conf(cf, &cplcf->fastcgi); - } - - if (cf->cmd_type & (NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF)) { - return "(separate location syntax) is not allowed here"; - } - - flcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_fastcgi_module); - -# if (nginx_version >= 1007009) - if (flcf->upstream.cache > 0) -# else - if (flcf->upstream.cache != NGX_CONF_UNSET_PTR - && flcf->upstream.cache != NULL) -# endif /* nginx_version >= 1007009 */ - { - return "is incompatible with \"fastcgi_cache\""; - } - - if (flcf->upstream.upstream || flcf->fastcgi_lengths) { - return "is incompatible with \"fastcgi_pass\""; - } - - if (flcf->upstream.store > 0 -# if (nginx_version < 1007009) - || flcf->upstream.store_lengths -# endif /* nginx_version >= 1007009 */ - ) { - return "is incompatible with \"fastcgi_store\""; - } - - value = cf->args->elts; - - /* set fastcgi_cache part */ -# if (nginx_version >= 1007009) - - flcf->upstream.cache = 1; - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = &cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (cv.lengths != NULL) { - - flcf->upstream.cache_value = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (flcf->upstream.cache_value == NULL) { - return NGX_CONF_ERROR; - } - - *flcf->upstream.cache_value = cv; - - } else { - - flcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_fastcgi_module); - if (flcf->upstream.cache_zone == NULL) { - return NGX_CONF_ERROR; - } - } - -# else - - flcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_fastcgi_module); - if (flcf->upstream.cache == NULL) { - return NGX_CONF_ERROR; - } - -# endif /* nginx_version >= 1007009 */ - - /* set fastcgi_cache_key part */ - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[2]; - ccv.complex_value = &flcf->cache_key; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - /* set handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - cplcf->fastcgi.enable = 0; - cplcf->conf = &cplcf->fastcgi; - clcf->handler = ngx_http_fastcgi_cache_purge_handler; - - return NGX_CONF_OK; -} - -ngx_int_t -ngx_http_fastcgi_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_fastcgi_loc_conf_t *flcf; - ngx_http_cache_purge_loc_conf_t *cplcf; -# if (nginx_version >= 1007009) - ngx_http_fastcgi_main_conf_t *fmcf; - ngx_int_t rc; -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module); - - r->upstream->conf = &flcf->upstream; - -# if (nginx_version >= 1007009) - - fmcf = ngx_http_get_module_main_conf(r, ngx_http_fastcgi_module); - - r->upstream->caches = &fmcf->caches; - - rc = ngx_http_cache_purge_cache_get(r, r->upstream, &cache); - if (rc != NGX_OK) { - return rc; - } - -# else - - cache = flcf->upstream.cache->data; - -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_cache_purge_init(r, cache, &flcf->cache_key) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* Purge-all option */ - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - if (cplcf->conf->purge_all) { - ngx_http_cache_purge_all(r, cache); - } else { - if (ngx_http_cache_purge_is_partial(r)) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge with partial enabled"); - - ngx_http_cache_purge_partial(r, cache); - } - } - -# if (nginx_version >= 8011) - r->main->count++; -# endif - - ngx_http_cache_purge_handler(r); - - return NGX_DONE; -} -# endif /* NGX_HTTP_FASTCGI */ - -# if (NGX_HTTP_PROXY) -extern ngx_module_t ngx_http_proxy_module; - -typedef struct { - ngx_str_t key_start; - ngx_str_t schema; - ngx_str_t host_header; - ngx_str_t port; - ngx_str_t uri; -} ngx_http_proxy_vars_t; - -# if (nginx_version >= 1007009) - -typedef struct { - ngx_array_t caches; /* ngx_http_file_cache_t * */ -} ngx_http_proxy_main_conf_t; - -# endif /* nginx_version >= 1007009 */ - -# if (nginx_version >= 1007008) - -typedef struct { - ngx_array_t *flushes; - ngx_array_t *lengths; - ngx_array_t *values; - ngx_hash_t hash; -} ngx_http_proxy_headers_t; - -# endif /* nginx_version >= 1007008 */ - -typedef struct { - ngx_http_upstream_conf_t upstream; - -# if (nginx_version >= 1007008) - ngx_array_t *body_flushes; - ngx_array_t *body_lengths; - ngx_array_t *body_values; - ngx_str_t body_source; - - ngx_http_proxy_headers_t headers; - ngx_http_proxy_headers_t headers_cache; -# else - ngx_array_t *flushes; - ngx_array_t *body_set_len; - ngx_array_t *body_set; - ngx_array_t *headers_set_len; - ngx_array_t *headers_set; - ngx_hash_t headers_set_hash; -# endif /* nginx_version >= 1007008 */ - - ngx_array_t *headers_source; -# if (nginx_version < 8040) - ngx_array_t *headers_names; -# endif /* nginx_version < 8040 */ - - ngx_array_t *proxy_lengths; - ngx_array_t *proxy_values; - - ngx_array_t *redirects; -# if (nginx_version >= 1001015) - ngx_array_t *cookie_domains; - ngx_array_t *cookie_paths; -# endif /* nginx_version >= 1001015 */ -# if (nginx_version >= 1019003) - ngx_array_t *cookie_flags; -# endif /* nginx_version >= 1019003 */ -# if (nginx_version < 1007008) - ngx_str_t body_source; -# endif /* nginx_version < 1007008 */ - -# if (nginx_version >= 1011006) - ngx_http_complex_value_t *method; -# else - ngx_str_t method; -# endif /* nginx_version >= 1011006 */ - ngx_str_t location; - ngx_str_t url; - - ngx_http_complex_value_t cache_key; - - ngx_http_proxy_vars_t vars; - - ngx_flag_t redirect; - -# if (nginx_version >= 1001004) - ngx_uint_t http_version; -# endif /* nginx_version >= 1001004 */ - - ngx_uint_t headers_hash_max_size; - ngx_uint_t headers_hash_bucket_size; - -# if (NGX_HTTP_SSL) -# if (nginx_version >= 1005006) - ngx_uint_t ssl; - ngx_uint_t ssl_protocols; - ngx_str_t ssl_ciphers; -# endif /* nginx_version >= 1005006 */ -# if (nginx_version >= 1007000) - ngx_uint_t ssl_verify_depth; - ngx_str_t ssl_trusted_certificate; - ngx_str_t ssl_crl; -# endif /* nginx_version >= 1007000 */ -# if ((nginx_version >= 1007008) && (nginx_version < 1021000)) - ngx_str_t ssl_certificate; - ngx_str_t ssl_certificate_key; - ngx_array_t *ssl_passwords; -# endif /* nginx_version >= 1007008 && nginx_version < 1021000 */ -# if (nginx_version >= 1019004) - ngx_array_t *ssl_conf_commands; -# endif /*nginx_version >= 1019004 */ -# endif -} ngx_http_proxy_loc_conf_t; - -char * -ngx_http_proxy_cache_purge_conf(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { - ngx_http_compile_complex_value_t ccv; - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_http_core_loc_conf_t *clcf; - ngx_http_proxy_loc_conf_t *plcf; - ngx_str_t *value; -# if (nginx_version >= 1007009) - ngx_http_complex_value_t cv; -# endif /* nginx_version >= 1007009 */ - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->proxy.enable != NGX_CONF_UNSET) { - return "is duplicate"; - } - - if (cf->args->nelts != 3) { - return ngx_http_cache_purge_conf(cf, &cplcf->proxy); - } - - if (cf->cmd_type & (NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF)) { - return "(separate location syntax) is not allowed here"; - } - - plcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_proxy_module); - -# if (nginx_version >= 1007009) - if (plcf->upstream.cache > 0) -# else - if (plcf->upstream.cache != NGX_CONF_UNSET_PTR - && plcf->upstream.cache != NULL) -# endif /* nginx_version >= 1007009 */ - { - return "is incompatible with \"proxy_cache\""; - } - - if (plcf->upstream.upstream || plcf->proxy_lengths) { - return "is incompatible with \"proxy_pass\""; - } - - if (plcf->upstream.store > 0 -# if (nginx_version < 1007009) - || plcf->upstream.store_lengths -# endif /* nginx_version >= 1007009 */ - ) { - return "is incompatible with \"proxy_store\""; - } - - value = cf->args->elts; - - /* set proxy_cache part */ -# if (nginx_version >= 1007009) - - plcf->upstream.cache = 1; - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = &cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (cv.lengths != NULL) { - - plcf->upstream.cache_value = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (plcf->upstream.cache_value == NULL) { - return NGX_CONF_ERROR; - } - - *plcf->upstream.cache_value = cv; - - } else { - - plcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_proxy_module); - if (plcf->upstream.cache_zone == NULL) { - return NGX_CONF_ERROR; - } - } - -# else - - plcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_proxy_module); - if (plcf->upstream.cache == NULL) { - return NGX_CONF_ERROR; - } - -# endif /* nginx_version >= 1007009 */ - - /* set proxy_cache_key part */ - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[2]; - ccv.complex_value = &plcf->cache_key; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - /* set handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - cplcf->proxy.enable = 0; - cplcf->conf = &cplcf->proxy; - clcf->handler = ngx_http_proxy_cache_purge_handler; - - return NGX_CONF_OK; -} - -ngx_int_t -ngx_http_proxy_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_proxy_loc_conf_t *plcf; - ngx_http_cache_purge_loc_conf_t *cplcf; -# if (nginx_version >= 1007009) - ngx_http_proxy_main_conf_t *pmcf; - ngx_int_t rc; -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); - - r->upstream->conf = &plcf->upstream; - -# if (nginx_version >= 1007009) - - pmcf = ngx_http_get_module_main_conf(r, ngx_http_proxy_module); - - r->upstream->caches = &pmcf->caches; - - rc = ngx_http_cache_purge_cache_get(r, r->upstream, &cache); - if (rc != NGX_OK) { - return rc; - } - -# else - - cache = plcf->upstream.cache->data; - -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_cache_purge_init(r, cache, &plcf->cache_key) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* Purge-all option */ - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - if (cplcf->conf->purge_all) { - ngx_http_cache_purge_all(r, cache); - } else { - if (ngx_http_cache_purge_is_partial(r)) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge with partial enabled"); - - ngx_http_cache_purge_partial(r, cache); - } - } - -# if (nginx_version >= 8011) - r->main->count++; -# endif - - ngx_http_cache_purge_handler(r); - - return NGX_DONE; -} -# endif /* NGX_HTTP_PROXY */ - -# if (NGX_HTTP_SCGI) -extern ngx_module_t ngx_http_scgi_module; - -# if (nginx_version >= 1007009) - -typedef struct { - ngx_array_t caches; /* ngx_http_file_cache_t * */ -} ngx_http_scgi_main_conf_t; - -# endif /* nginx_version >= 1007009 */ - -# if (nginx_version >= 1007008) - -typedef struct { - ngx_array_t *flushes; - ngx_array_t *lengths; - ngx_array_t *values; - ngx_uint_t number; - ngx_hash_t hash; -} ngx_http_scgi_params_t; - -# endif /* nginx_version >= 1007008 */ - -typedef struct { - ngx_http_upstream_conf_t upstream; - -# if (nginx_version >= 1007008) - ngx_http_scgi_params_t params; - ngx_http_scgi_params_t params_cache; - ngx_array_t *params_source; -# else - ngx_array_t *flushes; - ngx_array_t *params_len; - ngx_array_t *params; - ngx_array_t *params_source; - - ngx_hash_t headers_hash; - ngx_uint_t header_params; -# endif /* nginx_version >= 1007008 */ - - ngx_array_t *scgi_lengths; - ngx_array_t *scgi_values; - - ngx_http_complex_value_t cache_key; -} ngx_http_scgi_loc_conf_t; - -char * -ngx_http_scgi_cache_purge_conf(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { - ngx_http_compile_complex_value_t ccv; - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_http_core_loc_conf_t *clcf; - ngx_http_scgi_loc_conf_t *slcf; - ngx_str_t *value; -# if (nginx_version >= 1007009) - ngx_http_complex_value_t cv; -# endif /* nginx_version >= 1007009 */ - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->scgi.enable != NGX_CONF_UNSET) { - return "is duplicate"; - } - - if (cf->args->nelts != 3) { - return ngx_http_cache_purge_conf(cf, &cplcf->scgi); - } - - if (cf->cmd_type & (NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF)) { - return "(separate location syntax) is not allowed here"; - } - - slcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_scgi_module); - -# if (nginx_version >= 1007009) - if (slcf->upstream.cache > 0) -# else - if (slcf->upstream.cache != NGX_CONF_UNSET_PTR - && slcf->upstream.cache != NULL) -# endif /* nginx_version >= 1007009 */ - { - return "is incompatible with \"scgi_cache\""; - } - - if (slcf->upstream.upstream || slcf->scgi_lengths) { - return "is incompatible with \"scgi_pass\""; - } - - if (slcf->upstream.store > 0 -# if (nginx_version < 1007009) - || slcf->upstream.store_lengths -# endif /* nginx_version >= 1007009 */ - ) { - return "is incompatible with \"scgi_store\""; - } - - value = cf->args->elts; - - /* set scgi_cache part */ -# if (nginx_version >= 1007009) - - slcf->upstream.cache = 1; - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = &cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (cv.lengths != NULL) { - - slcf->upstream.cache_value = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (slcf->upstream.cache_value == NULL) { - return NGX_CONF_ERROR; - } - - *slcf->upstream.cache_value = cv; - - } else { - - slcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_scgi_module); - if (slcf->upstream.cache_zone == NULL) { - return NGX_CONF_ERROR; - } - } - -# else - - slcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_scgi_module); - if (slcf->upstream.cache == NULL) { - return NGX_CONF_ERROR; - } - -# endif /* nginx_version >= 1007009 */ - - /* set scgi_cache_key part */ - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[2]; - ccv.complex_value = &slcf->cache_key; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - /* set handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - cplcf->scgi.enable = 0; - cplcf->conf = &cplcf->scgi; - clcf->handler = ngx_http_scgi_cache_purge_handler; - - return NGX_CONF_OK; -} - -ngx_int_t -ngx_http_scgi_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_scgi_loc_conf_t *slcf; - ngx_http_cache_purge_loc_conf_t *cplcf; -# if (nginx_version >= 1007009) - ngx_http_scgi_main_conf_t *smcf; - ngx_int_t rc; -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - slcf = ngx_http_get_module_loc_conf(r, ngx_http_scgi_module); - - r->upstream->conf = &slcf->upstream; - -# if (nginx_version >= 1007009) - - smcf = ngx_http_get_module_main_conf(r, ngx_http_scgi_module); - - r->upstream->caches = &smcf->caches; - - rc = ngx_http_cache_purge_cache_get(r, r->upstream, &cache); - if (rc != NGX_OK) { - return rc; - } - -# else - - cache = slcf->upstream.cache->data; - -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_cache_purge_init(r, cache, &slcf->cache_key) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* Purge-all option */ - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - if (cplcf->conf->purge_all) { - ngx_http_cache_purge_all(r, cache); - } else { - if (ngx_http_cache_purge_is_partial(r)) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge with partial enabled"); - - ngx_http_cache_purge_partial(r, cache); - } - } - -# if (nginx_version >= 8011) - r->main->count++; -# endif - - ngx_http_cache_purge_handler(r); - - return NGX_DONE; -} -# endif /* NGX_HTTP_SCGI */ - -# if (NGX_HTTP_UWSGI) -extern ngx_module_t ngx_http_uwsgi_module; - -# if (nginx_version >= 1007009) - -typedef struct { - ngx_array_t caches; /* ngx_http_file_cache_t * */ -} ngx_http_uwsgi_main_conf_t; - -# endif /* nginx_version >= 1007009 */ - -# if (nginx_version >= 1007008) - -typedef struct { - ngx_array_t *flushes; - ngx_array_t *lengths; - ngx_array_t *values; - ngx_uint_t number; - ngx_hash_t hash; -} ngx_http_uwsgi_params_t; - -# endif /* nginx_version >= 1007008 */ - -typedef struct { - ngx_http_upstream_conf_t upstream; - -# if (nginx_version >= 1007008) - ngx_http_uwsgi_params_t params; - ngx_http_uwsgi_params_t params_cache; - ngx_array_t *params_source; -# else - ngx_array_t *flushes; - ngx_array_t *params_len; - ngx_array_t *params; - ngx_array_t *params_source; - - ngx_hash_t headers_hash; - ngx_uint_t header_params; -# endif /* nginx_version >= 1007008 */ - - ngx_array_t *uwsgi_lengths; - ngx_array_t *uwsgi_values; - - ngx_http_complex_value_t cache_key; - - ngx_str_t uwsgi_string; - - ngx_uint_t modifier1; - ngx_uint_t modifier2; - -# if (NGX_HTTP_SSL) -# if (nginx_version >= 1005008) - ngx_uint_t ssl; - ngx_uint_t ssl_protocols; - ngx_str_t ssl_ciphers; -# endif /* nginx_version >= 1005008 */ -# if (nginx_version >= 1007000) - ngx_uint_t ssl_verify_depth; - ngx_str_t ssl_trusted_certificate; - ngx_str_t ssl_crl; -# endif /* nginx_version >= 1007000 */ -# if ((nginx_version >= 1007008) && (nginx_version < 1021000)) - ngx_str_t ssl_certificate; - ngx_str_t ssl_certificate_key; - ngx_array_t *ssl_passwords; -# endif /* nginx_version >= 1007008 && nginx_version < 1021000 */ -# if (nginx_version >= 1019004) - ngx_array_t *ssl_conf_commands; -# endif /*nginx_version >= 1019004 */ -# endif -} ngx_http_uwsgi_loc_conf_t; - -char * -ngx_http_uwsgi_cache_purge_conf(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { - ngx_http_compile_complex_value_t ccv; - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_http_core_loc_conf_t *clcf; - ngx_http_uwsgi_loc_conf_t *ulcf; - ngx_str_t *value; -# if (nginx_version >= 1007009) - ngx_http_complex_value_t cv; -# endif /* nginx_version >= 1007009 */ - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->uwsgi.enable != NGX_CONF_UNSET) { - return "is duplicate"; - } - - if (cf->args->nelts != 3) { - return ngx_http_cache_purge_conf(cf, &cplcf->uwsgi); - } - - if (cf->cmd_type & (NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF)) { - return "(separate location syntax) is not allowed here"; - } - - ulcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_uwsgi_module); - -# if (nginx_version >= 1007009) - if (ulcf->upstream.cache > 0) -# else - if (ulcf->upstream.cache != NGX_CONF_UNSET_PTR - && ulcf->upstream.cache != NULL) -# endif /* nginx_version >= 1007009 */ - { - return "is incompatible with \"uwsgi_cache\""; - } - - if (ulcf->upstream.upstream || ulcf->uwsgi_lengths) { - return "is incompatible with \"uwsgi_pass\""; - } - - if (ulcf->upstream.store > 0 -# if (nginx_version < 1007009) - || ulcf->upstream.store_lengths -# endif /* nginx_version >= 1007009 */ - ) { - return "is incompatible with \"uwsgi_store\""; - } - - value = cf->args->elts; - - /* set uwsgi_cache part */ -# if (nginx_version >= 1007009) - - ulcf->upstream.cache = 1; - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = &cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (cv.lengths != NULL) { - - ulcf->upstream.cache_value = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (ulcf->upstream.cache_value == NULL) { - return NGX_CONF_ERROR; - } - - *ulcf->upstream.cache_value = cv; - - } else { - - ulcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_uwsgi_module); - if (ulcf->upstream.cache_zone == NULL) { - return NGX_CONF_ERROR; - } - } - -# else - - ulcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_uwsgi_module); - if (ulcf->upstream.cache == NULL) { - return NGX_CONF_ERROR; - } - -# endif /* nginx_version >= 1007009 */ - - /* set uwsgi_cache_key part */ - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[2]; - ccv.complex_value = &ulcf->cache_key; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - /* set handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - cplcf->uwsgi.enable = 0; - cplcf->conf = &cplcf->uwsgi; - clcf->handler = ngx_http_uwsgi_cache_purge_handler; - - return NGX_CONF_OK; -} - - -ngx_int_t -ngx_http_uwsgi_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_uwsgi_loc_conf_t *ulcf; - ngx_http_cache_purge_loc_conf_t *cplcf; -# if (nginx_version >= 1007009) - ngx_http_uwsgi_main_conf_t *umcf; - ngx_int_t rc; -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ulcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module); - - r->upstream->conf = &ulcf->upstream; - -# if (nginx_version >= 1007009) - - umcf = ngx_http_get_module_main_conf(r, ngx_http_uwsgi_module); - - r->upstream->caches = &umcf->caches; - - rc = ngx_http_cache_purge_cache_get(r, r->upstream, &cache); - if (rc != NGX_OK) { - return rc; - } - -# else - - cache = ulcf->upstream.cache->data; - -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_cache_purge_init(r, cache, &ulcf->cache_key) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* Purge-all option */ - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - if (cplcf->conf->purge_all) { - ngx_http_cache_purge_all(r, cache); - } else { - if (ngx_http_cache_purge_is_partial(r)) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge with partial enabled"); - - ngx_http_cache_purge_partial(r, cache); - } - } - -# if (nginx_version >= 8011) - r->main->count++; -# endif - - ngx_http_cache_purge_handler(r); - - return NGX_DONE; -} -# endif /* NGX_HTTP_UWSGI */ - - -char * -ngx_http_cache_purge_response_type_conf(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_str_t *value; - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->resptype != NGX_CONF_UNSET_UINT && cf->cmd_type == NGX_HTTP_LOC_CONF ) { - return "is duplicate"; - } - - /* sanity check */ - if (cf->args->nelts < 2) { - return "is invalid paramter, ex) cache_purge_response_type (html|json|xml|text)"; - } - - if (cf->args->nelts > 2 ) { - return "is required only 1 option, ex) cache_purge_response_type (html|json|xml|text)"; - } - - value = cf->args->elts; - - if (ngx_strcmp(value[1].data, "html") != 0 && ngx_strcmp(value[1].data, "json") != 0 - && ngx_strcmp(value[1].data, "xml") != 0 && ngx_strcmp(value[1].data, "text") != 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid parameter \"%V\", expected" - " \"(html|json|xml|text)\" keyword", &value[1]); - return NGX_CONF_ERROR; - } - - if (cf->cmd_type == NGX_HTTP_MODULE) { - return "(separate server or location syntax) is not allowed here"; - } - - if (ngx_strcmp(value[1].data, "html") == 0) { - cplcf->resptype = NGX_REPONSE_TYPE_HTML; - } else if (ngx_strcmp(value[1].data, "xml") == 0) { - cplcf->resptype = NGX_REPONSE_TYPE_XML; - } else if (ngx_strcmp(value[1].data, "json") == 0) { - cplcf->resptype = NGX_REPONSE_TYPE_JSON; - } else if (ngx_strcmp(value[1].data, "text") == 0) { - cplcf->resptype = NGX_REPONSE_TYPE_TEXT; - } - - return NGX_CONF_OK; -} - -static ngx_int_t -ngx_http_purge_file_cache_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path) { - return NGX_OK; -} - -static ngx_int_t -ngx_http_purge_file_cache_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0, - "http file cache delete: \"%s\"", path->data); - - if (ngx_delete_file(path->data) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno, - ngx_delete_file_n " \"%s\" failed", path->data); - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_purge_file_cache_delete_partial_file(ngx_tree_ctx_t *ctx, ngx_str_t *path) { - u_char *key_partial; - u_char *key_in_file; - ngx_uint_t len; - ngx_flag_t remove_file = 0; - - key_partial = ctx->data; - len = ngx_strlen(key_partial); - - /* if key_partial is empty always match, because is a '*' */ - if (len == 0) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, ctx->log, 0, - "empty key_partial, forcing deletion"); - remove_file = 1; - } else { - ngx_file_t file; - - ngx_memzero(&file, sizeof(ngx_file_t)); - file.offset = file.sys_offset = 0; - file.fd = ngx_open_file(path->data, NGX_FILE_RDONLY, NGX_FILE_OPEN, - NGX_FILE_DEFAULT_ACCESS); - if (file.fd == -1) { - return NGX_OK; - } - file.log = ctx->log; - - /* I don't know if it's a good idea to use the ngx_cycle pool for this, - but the request is not available here */ - key_in_file = ngx_pcalloc(ngx_cycle->pool, sizeof(u_char) * (len + 1)); - - /* KEY: /proxy/passwd */ - /* since we don't need the "KEY: " ignore 5 + 1 extra u_char from last - intro */ - /* Optimization: we don't need to read the full key only the n chars - included in key_partial */ - ngx_read_file(&file, key_in_file, sizeof(u_char) * len, - sizeof(ngx_http_file_cache_header_t) + sizeof(u_char) * 6); - ngx_close_file(file.fd); - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ctx->log, 0, - "http cache file \"%s\" key read: \"%s\"", path->data, key_in_file); - - if (ngx_strncasecmp(key_in_file, key_partial, len) == 0) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, ctx->log, 0, - "match found, deleting file \"%s\"", path->data); - remove_file = 1; - } - } - - if (remove_file && ngx_delete_file(path->data) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno, - ngx_delete_file_n " \"%s\" failed", path->data); - } - - return NGX_OK; -} - -ngx_int_t -ngx_http_cache_purge_access_handler(ngx_http_request_t *r) { - ngx_http_cache_purge_loc_conf_t *cplcf; - - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - - if (r->method_name.len != cplcf->conf->method.len - || (ngx_strncmp(r->method_name.data, cplcf->conf->method.data, - r->method_name.len))) { - return cplcf->original_handler(r); - } - - if ((cplcf->conf->access || cplcf->conf->access6) - && ngx_http_cache_purge_access(cplcf->conf->access, - cplcf->conf->access6, - r->connection->sockaddr) != NGX_OK) { - return NGX_HTTP_FORBIDDEN; - } - - if (cplcf->handler == NULL) { - return NGX_HTTP_NOT_FOUND; - } - - return cplcf->handler(r); -} - -ngx_int_t -ngx_http_cache_purge_access(ngx_array_t *access, ngx_array_t *access6, - struct sockaddr *s) { - in_addr_t inaddr; - ngx_in_cidr_t *a; - ngx_uint_t i; -# if (NGX_HAVE_INET6) - struct in6_addr *inaddr6; - ngx_in6_cidr_t *a6; - u_char *p; - ngx_uint_t n; -# endif /* NGX_HAVE_INET6 */ - - switch (s->sa_family) { - case AF_INET: - if (access == NULL) { - return NGX_DECLINED; - } - - inaddr = ((struct sockaddr_in *) s)->sin_addr.s_addr; - -# if (NGX_HAVE_INET6) -ipv4: -# endif /* NGX_HAVE_INET6 */ - - a = access->elts; - for (i = 0; i < access->nelts; i++) { - if ((inaddr & a[i].mask) == a[i].addr) { - return NGX_OK; - } - } - - return NGX_DECLINED; - -# if (NGX_HAVE_INET6) - case AF_INET6: - inaddr6 = &((struct sockaddr_in6 *) s)->sin6_addr; - p = inaddr6->s6_addr; - - if (access && IN6_IS_ADDR_V4MAPPED(inaddr6)) { - inaddr = p[12] << 24; - inaddr += p[13] << 16; - inaddr += p[14] << 8; - inaddr += p[15]; - inaddr = htonl(inaddr); - - goto ipv4; - } - - if (access6 == NULL) { - return NGX_DECLINED; - } - - a6 = access6->elts; - for (i = 0; i < access6->nelts; i++) { - for (n = 0; n < 16; n++) { - if ((p[n] & a6[i].mask.s6_addr[n]) != a6[i].addr.s6_addr[n]) { - goto next; - } - } - - return NGX_OK; - -next: - continue; - } - - return NGX_DECLINED; -# endif /* NGX_HAVE_INET6 */ - } - - return NGX_DECLINED; -} - -ngx_int_t -ngx_http_cache_purge_send_response(ngx_http_request_t *r) { - ngx_chain_t out; - ngx_buf_t *b; - ngx_str_t *key; - ngx_int_t rc; - size_t len; - - size_t body_len; - size_t resp_tmpl_len; - u_char *buf; - u_char *buf_keydata; - u_char *p; - const char *resp_ct; - size_t resp_ct_size; - const char *resp_body; - size_t resp_body_size; - - ngx_http_cache_purge_loc_conf_t *cplcf; - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - - key = r->cache->keys.elts; - - buf_keydata = ngx_pcalloc(r->pool, key[0].len+1); - if (buf_keydata == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - p = ngx_cpymem(buf_keydata, key[0].data, key[0].len); - if (p == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - switch(cplcf->resptype) { - - case NGX_REPONSE_TYPE_JSON: - resp_ct = ngx_http_cache_purge_content_type_json; - resp_ct_size = ngx_http_cache_purge_content_type_json_size; - resp_body = ngx_http_cache_purge_body_templ_json; - resp_body_size = ngx_http_cache_purge_body_templ_json_size; - break; - - case NGX_REPONSE_TYPE_XML: - resp_ct = ngx_http_cache_purge_content_type_xml; - resp_ct_size = ngx_http_cache_purge_content_type_xml_size; - resp_body = ngx_http_cache_purge_body_templ_xml; - resp_body_size = ngx_http_cache_purge_body_templ_xml_size; - break; - - case NGX_REPONSE_TYPE_TEXT: - resp_ct = ngx_http_cache_purge_content_type_text; - resp_ct_size = ngx_http_cache_purge_content_type_text_size; - resp_body = ngx_http_cache_purge_body_templ_text; - resp_body_size = ngx_http_cache_purge_body_templ_text_size; - break; - - default: - case NGX_REPONSE_TYPE_HTML: - resp_ct = ngx_http_cache_purge_content_type_html; - resp_ct_size = ngx_http_cache_purge_content_type_html_size; - resp_body = ngx_http_cache_purge_body_templ_html; - resp_body_size = ngx_http_cache_purge_body_templ_html_size; - break; - } - - body_len = resp_body_size - 2 - 1; - r->headers_out.content_type.len = resp_ct_size - 1; - r->headers_out.content_type.data = (u_char *) resp_ct; - - resp_tmpl_len = body_len + key[0].len ; - - buf = ngx_pcalloc(r->pool, resp_tmpl_len); - if (buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - p = ngx_snprintf(buf, resp_tmpl_len, resp_body , buf_keydata); - if (p == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - len = body_len + key[0].len; - - r->headers_out.status = NGX_HTTP_OK; - r->headers_out.content_length_n = len; - - if (r->method == NGX_HTTP_HEAD) { - rc = ngx_http_send_header(r); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - } - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - - out.buf = b; - out.next = NULL; - - b->last = ngx_cpymem(b->last, buf, resp_tmpl_len); - b->last_buf = 1; - - rc = ngx_http_send_header(r); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - return ngx_http_output_filter(r, &out); -} - -# if (nginx_version >= 1007009) - -/* - * Based on: ngx_http_upstream.c/ngx_http_upstream_cache_get - * Copyright (C) Igor Sysoev - * Copyright (C) Nginx, Inc. - */ -ngx_int_t -ngx_http_cache_purge_cache_get(ngx_http_request_t *r, ngx_http_upstream_t *u, - ngx_http_file_cache_t **cache) { - ngx_str_t *name, val; - ngx_uint_t i; - ngx_http_file_cache_t **caches; - - if (u->conf->cache_zone) { - *cache = u->conf->cache_zone->data; - return NGX_OK; - } - - if (ngx_http_complex_value(r, u->conf->cache_value, &val) != NGX_OK) { - return NGX_ERROR; - } - - if (val.len == 0 - || (val.len == 3 && ngx_strncmp(val.data, "off", 3) == 0)) { - return NGX_DECLINED; - } - - caches = u->caches->elts; - - for (i = 0; i < u->caches->nelts; i++) { - name = &caches[i]->shm_zone->shm.name; - - if (name->len == val.len - && ngx_strncmp(name->data, val.data, val.len) == 0) { - *cache = caches[i]; - return NGX_OK; - } - } - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "cache \"%V\" not found", &val); - - return NGX_ERROR; -} - -# endif /* nginx_version >= 1007009 */ - -ngx_int_t -ngx_http_cache_purge_init(ngx_http_request_t *r, ngx_http_file_cache_t *cache, - ngx_http_complex_value_t *cache_key) { - ngx_http_cache_t *c; - ngx_str_t *key; - ngx_int_t rc; - - rc = ngx_http_discard_request_body(r); - if (rc != NGX_OK) { - return NGX_ERROR; - } - - c = ngx_pcalloc(r->pool, sizeof(ngx_http_cache_t)); - if (c == NULL) { - return NGX_ERROR; - } - - rc = ngx_array_init(&c->keys, r->pool, 1, sizeof(ngx_str_t)); - if (rc != NGX_OK) { - return NGX_ERROR; - } - - key = ngx_array_push(&c->keys); - if (key == NULL) { - return NGX_ERROR; - } - - rc = ngx_http_complex_value(r, cache_key, key); - if (rc != NGX_OK) { - return NGX_ERROR; - } - - r->cache = c; - c->body_start = ngx_pagesize; - c->file_cache = cache; - c->file.log = r->connection->log; - - ngx_http_file_cache_create_key(r); - - return NGX_OK; -} - -void -ngx_http_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_int_t rc; - -# if (NGX_HAVE_FILE_AIO) - if (r->aio) { - return; - } -# endif - - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - rc = NGX_OK; - if (!cplcf->conf->purge_all && !ngx_http_cache_purge_is_partial(r)) { - rc = ngx_http_file_cache_purge(r); - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge: %i, \"%s\"", - rc, r->cache->file.name.data); - } - - switch (rc) { - case NGX_OK: - r->write_event_handler = ngx_http_request_empty_handler; - ngx_http_finalize_request(r, ngx_http_cache_purge_send_response(r)); - return; - case NGX_DECLINED: - ngx_http_finalize_request(r, NGX_HTTP_PRECONDITION_FAILED); - return; -# if (NGX_HAVE_FILE_AIO) - case NGX_AGAIN: - r->write_event_handler = ngx_http_cache_purge_handler; - return; -# endif - default: - ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - } -} - -ngx_int_t -ngx_http_file_cache_purge(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_cache_t *c; - - switch (ngx_http_file_cache_open(r)) { - case NGX_OK: - case NGX_HTTP_CACHE_STALE: -# if (nginx_version >= 8001) \ - || ((nginx_version < 8000) && (nginx_version >= 7060)) - case NGX_HTTP_CACHE_UPDATING: -# endif - break; - case NGX_DECLINED: - return NGX_DECLINED; -# if (NGX_HAVE_FILE_AIO) - case NGX_AGAIN: - return NGX_AGAIN; -# endif - default: - return NGX_ERROR; - } - - c = r->cache; - cache = c->file_cache; - - /* - * delete file from disk but *keep* in-memory node, - * because other requests might still point to it. - */ - - ngx_shmtx_lock(&cache->shpool->mutex); - - if (!c->node->exists) { - /* race between concurrent purges, backoff */ - ngx_shmtx_unlock(&cache->shpool->mutex); - return NGX_DECLINED; - } - -# if (nginx_version >= 1000001) - cache->sh->size -= c->node->fs_size; - c->node->fs_size = 0; -# else - cache->sh->size -= (c->node->length + cache->bsize - 1) / cache->bsize; - c->node->length = 0; -# endif - - c->node->exists = 0; -# if (nginx_version >= 8001) \ - || ((nginx_version < 8000) && (nginx_version >= 7060)) - c->node->updating = 0; -# endif - - ngx_shmtx_unlock(&cache->shpool->mutex); - - if (ngx_delete_file(c->file.name.data) == NGX_FILE_ERROR) { - /* entry in error log is enough, don't notice client */ - ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, - ngx_delete_file_n " \"%s\" failed", c->file.name.data); - } - - /* file deleted from cache */ - return NGX_OK; -} - - -void -ngx_http_cache_purge_all(ngx_http_request_t *r, ngx_http_file_cache_t *cache) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "purge_all http in %s", - cache->path->name.data); - - /* Walk the tree and remove all the files */ - ngx_tree_ctx_t tree; - tree.init_handler = NULL; - tree.file_handler = ngx_http_purge_file_cache_delete_file; - tree.pre_tree_handler = ngx_http_purge_file_cache_noop; - tree.post_tree_handler = ngx_http_purge_file_cache_noop; - tree.spec_handler = ngx_http_purge_file_cache_noop; - tree.data = NULL; - tree.alloc = 0; - tree.log = ngx_cycle->log; - - ngx_walk_tree(&tree, &cache->path->name); -} - -void -ngx_http_cache_purge_partial(ngx_http_request_t *r, ngx_http_file_cache_t *cache) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "purge_partial http in %s", - cache->path->name.data); - - u_char *key_partial; - ngx_str_t *key; - ngx_http_cache_t *c; - ngx_uint_t len; - - c = r->cache; - key = c->keys.elts; - len = key[0].len; - - /* Only check the first key */ - key_partial = ngx_pcalloc(r->pool, sizeof(u_char) * len); - ngx_memcpy(key_partial, key[0].data, sizeof(u_char) * (len - 1)); - - /* Walk the tree and remove all the files matching key_partial */ - ngx_tree_ctx_t tree; - tree.init_handler = NULL; - tree.file_handler = ngx_http_purge_file_cache_delete_partial_file; - tree.pre_tree_handler = ngx_http_purge_file_cache_noop; - tree.post_tree_handler = ngx_http_purge_file_cache_noop; - tree.spec_handler = ngx_http_purge_file_cache_noop; - tree.data = key_partial; - tree.alloc = 0; - tree.log = ngx_cycle->log; - - ngx_walk_tree(&tree, &cache->path->name); -} - -ngx_int_t -ngx_http_cache_purge_is_partial(ngx_http_request_t *r) { - ngx_str_t *key; - ngx_http_cache_t *c; - - c = r->cache; - key = c->keys.elts; - - /* Only check the first key */ - return c->keys.nelts > 0 // number of array elements - && key[0].len > 0 // char length of the key - && key[0].data[key[0].len - 1] == '*'; // is the last char an asterix char? -} - -char * -ngx_http_cache_purge_conf(ngx_conf_t *cf, ngx_http_cache_purge_conf_t *cpcf) { - ngx_cidr_t cidr; - ngx_in_cidr_t *access; -# if (NGX_HAVE_INET6) - ngx_in6_cidr_t *access6; -# endif /* NGX_HAVE_INET6 */ - ngx_str_t *value; - ngx_int_t rc; - ngx_uint_t i; - ngx_uint_t from_position; - - from_position = 2; - - /* xxx_cache_purge on|off| [purge_all] [from all| [.. ]] */ - value = cf->args->elts; - - if (ngx_strcmp(value[1].data, "off") == 0) { - cpcf->enable = 0; - return NGX_CONF_OK; - - } else if (ngx_strcmp(value[1].data, "on") == 0) { - ngx_str_set(&cpcf->method, "PURGE"); - - } else { - cpcf->method = value[1]; - } - - if (cf->args->nelts < 4) { - cpcf->enable = 1; - return NGX_CONF_OK; - } - - /* We will purge all the keys */ - if (ngx_strcmp(value[from_position].data, "purge_all") == 0) { - cpcf->purge_all = 1; - from_position++; - } - - - /* sanity check */ - if (ngx_strcmp(value[from_position].data, "from") != 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid parameter \"%V\", expected" - " \"from\" keyword", &value[from_position]); - return NGX_CONF_ERROR; - } - - if (ngx_strcmp(value[from_position + 1].data, "all") == 0) { - cpcf->enable = 1; - return NGX_CONF_OK; - } - - for (i = (from_position + 1); i < cf->args->nelts; i++) { - rc = ngx_ptocidr(&value[i], &cidr); - - if (rc == NGX_ERROR) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid parameter \"%V\"", &value[i]); - return NGX_CONF_ERROR; - } - - if (rc == NGX_DONE) { - ngx_conf_log_error(NGX_LOG_WARN, cf, 0, - "low address bits of %V are meaningless", - &value[i]); - } - - switch (cidr.family) { - case AF_INET: - if (cpcf->access == NULL) { - cpcf->access = ngx_array_create(cf->pool, cf->args->nelts - (from_position + 1), - sizeof(ngx_in_cidr_t)); - if (cpcf->access == NULL) { - return NGX_CONF_ERROR; - } - } - - access = ngx_array_push(cpcf->access); - if (access == NULL) { - return NGX_CONF_ERROR; - } - - access->mask = cidr.u.in.mask; - access->addr = cidr.u.in.addr; - - break; - -# if (NGX_HAVE_INET6) - case AF_INET6: - if (cpcf->access6 == NULL) { - cpcf->access6 = ngx_array_create(cf->pool, cf->args->nelts - (from_position + 1), - sizeof(ngx_in6_cidr_t)); - if (cpcf->access6 == NULL) { - return NGX_CONF_ERROR; - } - } - - access6 = ngx_array_push(cpcf->access6); - if (access6 == NULL) { - return NGX_CONF_ERROR; - } - - access6->mask = cidr.u.in6.mask; - access6->addr = cidr.u.in6.addr; - - break; -# endif /* NGX_HAVE_INET6 */ - } - } - - cpcf->enable = 1; - - return NGX_CONF_OK; -} - -void -ngx_http_cache_purge_merge_conf(ngx_http_cache_purge_conf_t *conf, - ngx_http_cache_purge_conf_t *prev) { - if (conf->enable == NGX_CONF_UNSET) { - if (prev->enable == 1) { - conf->enable = prev->enable; - conf->method = prev->method; - conf->purge_all = prev->purge_all; - conf->access = prev->access; - conf->access6 = prev->access6; - } else { - conf->enable = 0; - } - } -} - -void * -ngx_http_cache_purge_create_loc_conf(ngx_conf_t *cf) { - ngx_http_cache_purge_loc_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_cache_purge_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* - * set by ngx_pcalloc(): - * - * conf->*.method = { 0, NULL } - * conf->*.access = NULL - * conf->*.access6 = NULL - * conf->handler = NULL - * conf->original_handler = NULL - */ - -# if (NGX_HTTP_FASTCGI) - conf->fastcgi.enable = NGX_CONF_UNSET; -# endif /* NGX_HTTP_FASTCGI */ -# if (NGX_HTTP_PROXY) - conf->proxy.enable = NGX_CONF_UNSET; -# endif /* NGX_HTTP_PROXY */ -# if (NGX_HTTP_SCGI) - conf->scgi.enable = NGX_CONF_UNSET; -# endif /* NGX_HTTP_SCGI */ -# if (NGX_HTTP_UWSGI) - conf->uwsgi.enable = NGX_CONF_UNSET; -# endif /* NGX_HTTP_UWSGI */ - - conf->resptype = NGX_CONF_UNSET_UINT; - - conf->conf = NGX_CONF_UNSET_PTR; - - return conf; -} - -char * -ngx_http_cache_purge_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) { - ngx_http_cache_purge_loc_conf_t *prev = parent; - ngx_http_cache_purge_loc_conf_t *conf = child; - ngx_http_core_loc_conf_t *clcf; -# if (NGX_HTTP_FASTCGI) - ngx_http_fastcgi_loc_conf_t *flcf; -# endif /* NGX_HTTP_FASTCGI */ -# if (NGX_HTTP_PROXY) - ngx_http_proxy_loc_conf_t *plcf; -# endif /* NGX_HTTP_PROXY */ -# if (NGX_HTTP_SCGI) - ngx_http_scgi_loc_conf_t *slcf; -# endif /* NGX_HTTP_SCGI */ -# if (NGX_HTTP_UWSGI) - ngx_http_uwsgi_loc_conf_t *ulcf; -# endif /* NGX_HTTP_UWSGI */ - - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - ngx_conf_merge_uint_value(conf->resptype, prev->resptype, NGX_REPONSE_TYPE_HTML); - -# if (NGX_HTTP_FASTCGI) - ngx_http_cache_purge_merge_conf(&conf->fastcgi, &prev->fastcgi); - - if (conf->fastcgi.enable && clcf->handler != NULL) { - flcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_fastcgi_module); - - if (flcf->upstream.upstream || flcf->fastcgi_lengths) { - conf->conf = &conf->fastcgi; - conf->handler = flcf->upstream.cache - ? ngx_http_fastcgi_cache_purge_handler : NULL; - conf->original_handler = clcf->handler; - - clcf->handler = ngx_http_cache_purge_access_handler; - - return NGX_CONF_OK; - } - } -# endif /* NGX_HTTP_FASTCGI */ - -# if (NGX_HTTP_PROXY) - ngx_http_cache_purge_merge_conf(&conf->proxy, &prev->proxy); - - if (conf->proxy.enable && clcf->handler != NULL) { - plcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_proxy_module); - - if (plcf->upstream.upstream || plcf->proxy_lengths) { - conf->conf = &conf->proxy; - conf->handler = plcf->upstream.cache - ? ngx_http_proxy_cache_purge_handler : NULL; - conf->original_handler = clcf->handler; - - clcf->handler = ngx_http_cache_purge_access_handler; - - return NGX_CONF_OK; - } - } -# endif /* NGX_HTTP_PROXY */ - -# if (NGX_HTTP_SCGI) - ngx_http_cache_purge_merge_conf(&conf->scgi, &prev->scgi); - - if (conf->scgi.enable && clcf->handler != NULL) { - slcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_scgi_module); - - if (slcf->upstream.upstream || slcf->scgi_lengths) { - conf->conf = &conf->scgi; - conf->handler = slcf->upstream.cache - ? ngx_http_scgi_cache_purge_handler : NULL; - conf->original_handler = clcf->handler; - clcf->handler = ngx_http_cache_purge_access_handler; - - return NGX_CONF_OK; - } - } -# endif /* NGX_HTTP_SCGI */ - -# if (NGX_HTTP_UWSGI) - ngx_http_cache_purge_merge_conf(&conf->uwsgi, &prev->uwsgi); - - if (conf->uwsgi.enable && clcf->handler != NULL) { - ulcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_uwsgi_module); - - if (ulcf->upstream.upstream || ulcf->uwsgi_lengths) { - conf->conf = &conf->uwsgi; - conf->handler = ulcf->upstream.cache - ? ngx_http_uwsgi_cache_purge_handler : NULL; - conf->original_handler = clcf->handler; - - clcf->handler = ngx_http_cache_purge_access_handler; - - return NGX_CONF_OK; - } - } -# endif /* NGX_HTTP_UWSGI */ - - ngx_conf_merge_ptr_value(conf->conf, prev->conf, NULL); - - if (conf->handler == NULL) { - conf->handler = prev->handler; - } - - if (conf->original_handler == NULL) { - conf->original_handler = prev->original_handler; - } - - return NGX_CONF_OK; -} - -#else /* !NGX_HTTP_CACHE */ - -static ngx_http_module_t ngx_http_cache_purge_module_ctx = { - NULL, /* preconfiguration */ - NULL, /* postconfiguration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - NULL, /* create location configuration */ - NULL, /* merge location configuration */ -}; - -ngx_module_t ngx_http_cache_purge_module = { - NGX_MODULE_V1, - &ngx_http_cache_purge_module_ctx, /* module context */ - NULL, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - -#endif /* NGX_HTTP_CACHE */ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1.t deleted file mode 100644 index fefe9b8..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1.t +++ /dev/null @@ -1,136 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 3 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location ~ /purge(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1_vars.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1_vars.t deleted file mode 100644 index b9da04b..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1_vars.t +++ /dev/null @@ -1,138 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 3 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location ~ /purge(/.*) { - proxy_cache_purge $cache $1$is_args$args; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2.t deleted file mode 100644 index 4c7e19f..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2.t +++ /dev/null @@ -1,349 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 6 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - proxy_cache_purge on; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - if ($uri) { } - } - - location = /etc/passwd { - root /; - } -_EOC_ - -our $config_allowed = <<'_EOC_'; - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -our $config_forbidden = <<'_EOC_'; - proxy_cache_purge PURGE from 1.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 7: purge from cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 8: purge from empty cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -PURGE /proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 9: get from source (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 10: get from cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 11: purge from cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config eval: $::config_forbidden ---- request -PURGE /proxy/passwd ---- error_code: 403 ---- response_headers -Content-Type: text/html ---- response_body_like: 403 Forbidden ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 12: get from cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config eval: $::config_forbidden ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 13: no cache (PURGE allowed) ---- http_config eval: $::http_config ---- config - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 404 ---- response_headers -Content-Type: text/html ---- response_body_like: 404 Not Found ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 14: no cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config - proxy_cache_purge PURGE from 1.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 403 ---- response_headers -Content-Type: text/html ---- response_body_like: 403 Forbidden ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 15: multiple cache purge directives ---- http_config eval: $::http_config ---- config - fastcgi_cache_purge on; - proxy_cache_purge on; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - if ($uri) { } - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2_vars.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2_vars.t deleted file mode 100644 index 08e3e1e..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2_vars.t +++ /dev/null @@ -1,353 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 6 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - proxy_cache_purge on; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - if ($uri) { } - } - - location = /etc/passwd { - root /; - } -_EOC_ - -our $config_allowed = <<'_EOC_'; - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -our $config_forbidden = <<'_EOC_'; - proxy_cache_purge PURGE from 1.0.0.0/8; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 7: purge from cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 8: purge from empty cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -PURGE /proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 9: get from source (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 10: get from cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 11: purge from cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config eval: $::config_forbidden ---- request -PURGE /proxy/passwd ---- error_code: 403 ---- response_headers -Content-Type: text/html ---- response_body_like: 403 Forbidden ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 12: get from cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config eval: $::config_forbidden ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 13: no cache (PURGE allowed) ---- http_config eval: $::http_config ---- config - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 404 ---- response_headers -Content-Type: text/html ---- response_body_like: 404 Not Found ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 14: no cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config - proxy_cache_purge PURGE from 1.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 403 ---- response_headers -Content-Type: text/html ---- response_body_like: 403 Forbidden ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 15: multiple cache purge directives ---- http_config eval: $::http_config ---- config - fastcgi_cache_purge on; - proxy_cache_purge on; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - if ($uri) { } - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy3.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy3.t deleted file mode 100644 index c8d71d9..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy3.t +++ /dev/null @@ -1,140 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => 32; - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - proxy_cache_purge PURGE purge_all from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - } - - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 2: prepare shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - - -=== TEST 3: get from cache passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 4: get from cache shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 5: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/any ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 6: get from empty cache passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 7: get from empty cache shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy4.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy4.t deleted file mode 100644 index e4d2f30..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy4.t +++ /dev/null @@ -1,168 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => 41; - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - } - - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 2: prepare passwd2 ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd2 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 3: prepare shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 4: get from cache passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 5: get from cache passwd2 ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd2 ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 6: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/pass* ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 7: get from empty cache passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 8: get from empty cache passwd2 ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd2 ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 9: get from cache shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/resptype1.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/resptype1.t deleted file mode 100644 index 816c3ff..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/resptype1.t +++ /dev/null @@ -1,245 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 3 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - - cache_purge_response_type json; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location ~ /purge(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - cache_purge_response_type html; - } - - location ~ /purge_json(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - } - - location ~ /purge_xml(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - cache_purge_response_type xml; - } - - location ~ /purge_text(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - cache_purge_response_type text; - } - - - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - -=== TEST 7-prepare: prepare purge ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd?t=7 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - -=== TEST 7: get a JSON response after purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge_json/proxy/passwd?t=7 ---- error_code: 200 ---- response_headers -Content-Type: application/json ---- response_body_like: {\"Key\": \"\/proxy\/passwd\?t=7\" ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - -=== TEST 8-prepare: prepare purge ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd?t=8 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - -=== TEST 8: get a XML response after purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge_xml/proxy/passwd?t=8 ---- error_code: 200 ---- response_headers -Content-Type: text/xml ---- response_body_like: \<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><\!\[CDATA\[\/proxy\/passwd\?t=8\]\]><\/Key> ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - -=== TEST 9-prepare: prepare purge ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd?t=9 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - -=== TEST 9: get a TEXT response after purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge_text/proxy/passwd?t=9 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: Key ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/.gitattributes b/modules_deb/libnginx-mod-http-echo-0.63/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-echo-0.63/.gitignore b/modules_deb/libnginx-mod-http-echo-0.63/.gitignore deleted file mode 100644 index a9948e4..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/.gitignore +++ /dev/null @@ -1,65 +0,0 @@ -.libs -*.swp -*.slo -*.la -*.swo -*.lo -*.mobi -genmobi.sh -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[789] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -t.sh -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -reindex -src/location.h -src/filter.c -src/subrequest.h -src/sleep.h -src/util.c -src/echo.c -src/info.c -src/util.h -src/var.h -src/filter.h -src/sleep.c -src/var.c -src/timer.c -src/module.h -src/echo.h -src/info.h -src/foreach.c -src/location.c -src/timer.h -src/module.c -src/subrequest.c -src/handler.h -src/foreach.h -src/handler.c -nginx -*.html -ctags -t/servroot -all -buildroot/ -go -Changes -build1[0-9] -analyze -Makefile -*.plist diff --git a/modules_deb/libnginx-mod-http-echo-0.63/.travis.yml b/modules_deb/libnginx-mod-http-echo-0.63/.travis.yml deleted file mode 100644 index 7dda358..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -sudo: required -dist: bionic - -os: linux - -language: c - -compiler: - - gcc - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - matrix: - - NGINX_VERSION=1.17.8 - - NGINX_VERSION=1.19.9 - -before_install: - - sudo apt-get install -qq -y cpanminus libgd-dev ca-certificates - - sudo cpanm -v --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1) - -install: - - wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && tar -xzf nginx-${NGINX_VERSION}.tar.gz - - git clone https://github.com/simpl/ngx_devel_kit.git - - git clone https://github.com/openresty/set-misc-nginx-module.git - - git clone https://github.com/openresty/xss-nginx-module.git - - git clone https://github.com/openresty/rds-json-nginx-module.git - - git clone https://github.com/openresty/headers-more-nginx-module.git - - git clone https://github.com/openresty/lua-nginx-module.git - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/nginx-eval-module.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git luajit2 - -script: - - cd luajit2/ - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - - cd nginx-${NGINX_VERSION}/ - - ./configure --without-http_ssi_module --with-debug --with-select_module --with-poll_module --with-http_stub_status_module --with-http_image_filter_module --add-module=../ngx_devel_kit --add-module=../set-misc-nginx-module --add-module=../nginx-eval-module --add-module=../xss-nginx-module --add-module=../rds-json-nginx-module --add-module=../headers-more-nginx-module --add-module=../lua-nginx-module --add-module=.. > build.log 2>&1 || (cat build.log && exit 1) - - make -j2 > build.log 2>&1 || (cat build.log && exit 1) - - export PATH=$PATH:`pwd`/objs - - cd .. - - prove -I. -r t diff --git a/modules_deb/libnginx-mod-http-echo-0.63/LICENSE b/modules_deb/libnginx-mod-http-echo-0.63/LICENSE deleted file mode 100644 index 6feffbf..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (C) 2009-2014, Yichun "agentzh" Zhang . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-echo-0.63/README.markdown b/modules_deb/libnginx-mod-http-echo-0.63/README.markdown deleted file mode 100644 index a6b25e3..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/README.markdown +++ /dev/null @@ -1,1851 +0,0 @@ -Name -==== - -**ngx_echo** - Brings "echo", "sleep", "time", "exec" and more shell-style goodies to Nginx config file. - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Name](#name) -* [Status](#status) -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) -* [Content Handler Directives](#content-handler-directives) - * [echo](#echo) - * [echo_duplicate](#echo_duplicate) - * [echo_flush](#echo_flush) - * [echo_sleep](#echo_sleep) - * [echo_blocking_sleep](#echo_blocking_sleep) - * [echo_reset_timer](#echo_reset_timer) - * [echo_read_request_body](#echo_read_request_body) - * [echo_location_async](#echo_location_async) - * [echo_location](#echo_location) - * [echo_subrequest_async](#echo_subrequest_async) - * [echo_subrequest](#echo_subrequest) - * [echo_foreach_split](#echo_foreach_split) - * [echo_end](#echo_end) - * [echo_request_body](#echo_request_body) - * [echo_exec](#echo_exec) - * [echo_status](#echo_status) -* [Filter Directives](#filter-directives) - * [echo_before_body](#echo_before_body) - * [echo_after_body](#echo_after_body) -* [Variables](#variables) - * [$echo_it](#echo_it) - * [$echo_timer_elapsed](#echo_timer_elapsed) - * [$echo_request_body](#echo_request_body) - * [$echo_request_method](#echo_request_method) - * [$echo_client_request_method](#echo_client_request_method) - * [$echo_client_request_headers](#echo_client_request_headers) - * [$echo_cacheable_request_uri](#echo_cacheable_request_uri) - * [$echo_request_uri](#echo_request_uri) - * [$echo_incr](#echo_incr) - * [$echo_response_status](#echo_response_status) -* [Installation](#installation) -* [Compatibility](#compatibility) -* [Modules that use this module for testing](#modules-that-use-this-module-for-testing) -* [Community](#community) - * [English Mailing List](#english-mailing-list) - * [Chinese Mailing List](#chinese-mailing-list) -* [Report Bugs](#report-bugs) -* [Source Repository](#source-repository) -* [Changes](#changes) -* [Test Suite](#test-suite) -* [TODO](#todo) -* [Getting involved](#getting-involved) -* [Author](#author) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Status -====== - -This module is production ready. - -Version -======= - -This document describes ngx_echo [v0.62](https://github.com/openresty/echo-nginx-module/tags) released on 2 July, 2020. - -Synopsis -======== - -```nginx - - location /hello { - echo "hello, world!"; - } -``` - -```nginx - - location /hello { - echo -n "hello, "; - echo "world!"; - } -``` - -```nginx - - location /timed_hello { - echo_reset_timer; - echo hello world; - echo "'hello world' takes about $echo_timer_elapsed sec."; - echo hiya igor; - echo "'hiya igor' takes about $echo_timer_elapsed sec."; - } -``` - -```nginx - - location /echo_with_sleep { - echo hello; - echo_flush; # ensure the client can see previous output immediately - echo_sleep 2.5; # in sec - echo world; - } -``` - -```nginx - - # in the following example, accessing /echo yields - # hello - # world - # blah - # hiya - # igor - location /echo { - echo_before_body hello; - echo_before_body world; - proxy_pass $scheme://127.0.0.1:$server_port$request_uri/more; - echo_after_body hiya; - echo_after_body igor; - } - location /echo/more { - echo blah; - } -``` - -```nginx - - # the output of /main might be - # hello - # world - # took 0.000 sec for total. - # and the whole request would take about 2 sec to complete. - location /main { - echo_reset_timer; - - # subrequests in parallel - echo_location_async /sub1; - echo_location_async /sub2; - - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 2; - echo hello; - } - location /sub2 { - echo_sleep 1; - echo world; - } -``` - -```nginx - - # the output of /main might be - # hello - # world - # took 3.003 sec for total. - # and the whole request would take about 3 sec to complete. - location /main { - echo_reset_timer; - - # subrequests in series (chained by CPS) - echo_location /sub1; - echo_location /sub2; - - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 2; - echo hello; - } - location /sub2 { - echo_sleep 1; - echo world; - } -``` - -```nginx - - # Accessing /dup gives - # ------ END ------ - location /dup { - echo_duplicate 3 "--"; - echo_duplicate 1 " END "; - echo_duplicate 3 "--"; - echo; - } -``` - -```nginx - - # /bighello will generate 1000,000,000 hello's. - location /bighello { - echo_duplicate 1000_000_000 'hello'; - } -``` - -```nginx - - # echo back the client request - location /echoback { - echo_duplicate 1 $echo_client_request_headers; - echo "\r"; - - echo_read_request_body; - - echo_request_body; - } -``` - -```nginx - - # GET /multi will yields - # querystring: foo=Foo - # method: POST - # body: hi - # content length: 2 - # /// - # querystring: bar=Bar - # method: PUT - # body: hello - # content length: 5 - # /// - location /multi { - echo_subrequest_async POST '/sub' -q 'foo=Foo' -b 'hi'; - echo_subrequest_async PUT '/sub' -q 'bar=Bar' -b 'hello'; - } - location /sub { - echo "querystring: $query_string"; - echo "method: $echo_request_method"; - echo "body: $echo_request_body"; - echo "content length: $http_content_length"; - echo '///'; - } -``` - -```nginx - - # GET /merge?/foo.js&/bar/blah.js&/yui/baz.js will merge the .js resources together - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } -``` - -```nginx - - # accessing /if?val=abc yields the "hit" output - # while /if?val=bcd yields "miss": - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - echo $res; - } - echo $res; - } -``` - -[Back to TOC](#table-of-contents) - -Description -=========== - -This module wraps lots of Nginx internal APIs for streaming input and output, parallel/sequential subrequests, timers and sleeping, as well as various meta data accessing. - -Basically it provides various utilities that help testing and debugging of other modules by trivially emulating different kinds of faked subrequest locations. - -People will also find it useful in real-world applications that need to - -1. serve static contents directly from memory (loading from the Nginx config file). -1. wrap the upstream response with custom header and footer (kinda like the [addition module](http://nginx.org/en/docs/http/ngx_http_addition_module.html) but with contents read directly from the config file and Nginx variables). -1. merge contents of various "Nginx locations" (i.e., subrequests) together in a single main request (using [echo_location](#echo_location) and its friends). - -This is a special dual-role module that can *lazily* serve as a content handler or register itself as an output filter only upon demand. By default, this module does not do anything at all. - -Technically, this module has also demonstrated the following techniques that might be helpful for module writers: - -1. Issue parallel subrequests directly from content handler. -1. Issue chained subrequests directly from content handler, by passing continuation along the subrequest chain. -1. Issue subrequests with all HTTP 1.1 methods and even an optional faked HTTP request body. -1. Interact with the Nginx event model directly from content handler using custom events and timers, and resume the content handler back if necessary. -1. Dual-role module that can (lazily) serve as a content handler or an output filter or both. -1. Nginx config file variable creation and interpolation. -1. Streaming output control using output_chain, flush and its friends. -1. Read client request body from the content handler, and returns back (asynchronously) to the content handler after completion. -1. Use Perl-based declarative [test suite](#test-suite) to drive the development of Nginx C modules. - -[Back to TOC](#table-of-contents) - -Content Handler Directives -========================== - -Use of the following directives register this module to the current Nginx location as a content handler. If you want to use another module, like the [standard proxy module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html), as the content handler, use the [filter directives](#filter-directives) provided by this module. - -All the content handler directives can be mixed together in a single Nginx location and they're supposed to run sequentially just as in the Bash scripting language. - -Every content handler directive supports variable interpolation in its arguments (if any). - -The MIME type set by the [standard default_type directive](http://nginx.org/en/docs/http/ngx_http_core_module.html#default_type) is respected by this module, as in: - -```nginx - - location /hello { - default_type text/plain; - echo hello; - } -``` - -Then on the client side: - -```bash - - $ curl -I 'http://localhost/echo' - HTTP/1.1 200 OK - Server: nginx/0.8.20 - Date: Sat, 17 Oct 2009 03:40:19 GMT - Content-Type: text/plain - Connection: keep-alive -``` - -Since the [v0.22](#v022) release, all of the directives are allowed in the [rewrite module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)'s [if](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if) directive block, for instance: - -```nginx - - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - echo $res; - } - echo $res; - } -``` - -[Back to TOC](#table-of-contents) - -echo ----- -**syntax:** *echo \[options\] <string>...* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Sends arguments joined by spaces, along with a trailing newline, out to the client. - -Note that the data might be buffered by Nginx's underlying buffer. To force the output data flushed immediately, use the [echo_flush](#echo_flush) command just after `echo`, as in - -```nginx - - echo hello world; - echo_flush; -``` - -When no argument is specified, *echo* emits the trailing newline alone, just like the *echo* command in shell. - -Variables may appear in the arguments. An example is - -```nginx - - echo The current request uri is $request_uri; -``` - -where [$request_uri](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_uri) is a variable exposed by the [ngx_http_core_module](http://nginx.org/en/docs/http/ngx_http_core_module.html). - -This command can be used multiple times in a single location configuration, as in - -```nginx - - location /echo { - echo hello; - echo world; - } -``` - -The output on the client side looks like this - -```bash - - $ curl 'http://localhost/echo' - hello - world -``` - -Special characters like newlines (`\n`) and tabs (`\t`) can be escaped using C-style escaping sequences. But a notable exception is the dollar sign (`$`). As of Nginx 0.8.20, there's still no clean way to escape this character. (A work-around might be to use a `$echo_dollor` variable that is always evaluated to the constant `$` character. This feature will possibly be introduced in a future version of this module.) - -As of the echo [v0.28](#v028) release, one can suppress the trailing newline character in the output by using the `-n` option, as in - -```nginx - - location /echo { - echo -n "hello, "; - echo "world"; - } -``` - -Accessing `/echo` gives - -```bash - - $ curl 'http://localhost/echo' - hello, world -``` - -Leading `-n` in variable values won't take effect and will be emitted literally, as in - -```nginx - - location /echo { - set $opt -n; - echo $opt "hello,"; - echo "world"; - } -``` - -This gives the following output - -```bash - - $ curl 'http://localhost/echo' - -n hello, - world -``` - -One can output leading `-n` literals and other options using the special `--` option like this - -```nginx - - location /echo { - echo -- -n is an option; - } -``` - -which yields - -```bash - - $ curl 'http://localhost/echo' - -n is an option -``` - -Use this form when you want to output anything leading with a dash (`-`). - -[Back to TOC](#table-of-contents) - -echo_duplicate --------------- -**syntax:** *echo_duplicate <count> <string>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Outputs duplication of a string indicated by the second argument, using the count specified in the first argument. - -For instance, - -```nginx - - location /dup { - echo_duplicate 3 "abc"; - } -``` - -will lead to the output of `"abcabcabc"`. - -Underscores are allowed in the count number, just like in Perl. For example, to emit 1000,000,000 instances of `"hello, world"`: - -```nginx - - location /many_hellos { - echo_duplicate 1000_000_000 "hello, world"; - } -``` - -The `count` argument could be zero, but not negative. The second `string` argument could be an empty string ("") likewise. - -Unlike the [echo](#echo) directive, no trailing newline is appended to the result. So it's possible to "abuse" this directive as a no-trailing-newline version of [echo](#echo) by using "count" 1, as in - -```nginx - - location /echo_art { - echo_duplicate 2 '---'; - echo_duplicate 1 ' END '; # we don't want a trailing newline here - echo_duplicate 2 '---'; - echo; # we want a trailing newline here... - } -``` - -You get - -```bash - ------ END ------ -``` - -But use of the `-n` option in [echo](#echo) is more appropriate for this purpose. - -This directive was first introduced in [version 0.11](#v011). - -[Back to TOC](#table-of-contents) - -echo_flush ----------- -**syntax:** *echo_flush* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Forces the data potentially buffered by underlying Nginx output filters to send immediately to the client side via socket. - -Note that techically the command just emits a ngx_buf_t object with `flush` slot set to 1, so certain weird third-party output filter module could still block it before it reaches Nginx's (last) write filter. - -This directive does not take any argument. - -Consider the following example: - -```nginx - - location /flush { - echo hello; - - echo_flush; - - echo_sleep 1; - echo world; - } -``` - -Then on the client side, using curl to access `/flush`, you'll see the "hello" line immediately, but only after 1 second, the last "world" line. Without calling `echo_flush` in the example above, you'll most likely see no output until 1 second is elapsed due to the internal buffering of Nginx. - -This directive will fail to flush the output buffer in case of subrequests get involved. Consider the following example: - -```nginx - - location /main { - echo_location_async /sub; - echo hello; - echo_flush; - } - location /sub { - echo_sleep 1; - } -``` - -Then the client won't see "hello" appear even if `echo_flush` has been executed before the subrequest to `/sub` has actually started executing. The outputs of `/main` that are sent *after* [echo_location_async](#echo_location_async) will be postponed and buffered firmly. - -This does *not* apply to outputs sent before the subrequest initiated. For a modified version of the example given above: - -```nginx - - location /main { - echo hello; - echo_flush; - echo_location_async /sub; - } - location /sub { - echo_sleep 1; - } -``` - -The client will immediately see "hello" before `/sub` enters sleeping. - -See also [echo](#echo), [echo_sleep](#echo_sleep), and [echo_location_async](#echo_location_async). - -[Back to TOC](#table-of-contents) - -echo_sleep ----------- -**syntax:** *echo_sleep <seconds>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Sleeps for the time period specified by the argument, which is in seconds. - -This operation is non-blocking on server side, so unlike the [echo_blocking_sleep](#echo_blocking_sleep) directive, it won't block the whole Nginx worker process. - -The period might takes three digits after the decimal point and must be greater than 0.001. - -An example is - -```nginx - - location /echo_after_sleep { - echo_sleep 1.234; - echo resumed!; - } -``` - -Behind the scene, it sets up a per-request "sleep" ngx_event_t object, and adds a timer using that custom event to the Nginx event model and just waits for a timeout on that event. Because the "sleep" event is per-request, this directive can work in parallel subrequests. - -[Back to TOC](#table-of-contents) - -echo_blocking_sleep -------------------- -**syntax:** *echo_blocking_sleep <seconds>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -This is a blocking version of the [echo_sleep](#echo_sleep) directive. - -See the documentation of [echo_sleep](#echo_sleep) for more detail. - -Behind the curtain, it calls the ngx_msleep macro provided by the Nginx core which maps to usleep on POSIX-compliant systems. - -Note that this directive will block the current Nginx worker process completely while being executed, so never use it in production environment. - -[Back to TOC](#table-of-contents) - -echo_reset_timer ----------------- -**syntax:** *echo_reset_timer* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Reset the timer begin time to *now*, i.e., the time when this command is executed during request. - -The timer begin time is default to the starting time of the current request and can be overridden by this directive, potentially multiple times in a single location. For example: - -```nginx - - location /timed_sleep { - echo_sleep 0.03; - echo "$echo_timer_elapsed sec elapsed."; - - echo_reset_timer; - - echo_sleep 0.02; - echo "$echo_timer_elapsed sec elapsed."; - } -``` - -The output on the client side might be - -```bash - - $ curl 'http://localhost/timed_sleep' - 0.032 sec elapsed. - 0.020 sec elapsed. -``` - -The actual figures you get on your side may vary a bit due to your system's current activities. - -Invocation of this directive will force the underlying Nginx timer to get updated to the current system time (regardless the timer resolution specified elsewhere in the config file). Furthermore, references of the [$echo_timer_elapsed](#echo_timer_elapsed) variable will also trigger timer update forcibly. - -See also [echo_sleep](#echo_sleep) and [$echo_timer_elapsed](#echo_timer_elapsed). - -[Back to TOC](#table-of-contents) - -echo_read_request_body ----------------------- -**syntax:** *echo_read_request_body* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Explicitly reads request body so that the [$request_body](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_body) variable will always have non-empty values (unless the body is so big that it has been saved by Nginx to a local temporary file). - -Note that this might not be the original client request body because the current request might be a subrequest with a "artificial" body specified by its parent. - -This directive does not generate any output itself, just like [echo_sleep](#echo_sleep). - -Here's an example for echo'ing back the original HTTP client request (both headers and body are included): - -```nginx - - location /echoback { - echo_duplicate 1 $echo_client_request_headers; - echo "\r"; - echo_read_request_body; - echo $request_body; - } -``` - -The content of `/echoback` looks like this on my side (I was using Perl's LWP utility to access this location on the server): - -```bash - - $ (echo hello; echo world) | lwp-request -m POST 'http://localhost/echoback' - POST /echoback HTTP/1.1 - TE: deflate,gzip;q=0.3 - Connection: TE, close - Host: localhost - User-Agent: lwp-request/5.818 libwww-perl/5.820 - Content-Length: 12 - Content-Type: application/x-www-form-urlencoded - - hello - world -``` - -Because `/echoback` is the main request, [$request_body](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_body) holds the original client request body. - -Before Nginx 0.7.56, it makes no sense to use this directive because [$request_body](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_body) was first introduced in Nginx 0.7.58. - -This directive itself was first introduced in the echo module's [v0.14 release](#v014). - -[Back to TOC](#table-of-contents) - -echo_location_async -------------------- -**syntax:** *echo_location_async <location> [<url_args>]* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Issue GET subrequest to the location specified (first argument) with optional url arguments specified in the second argument. - -As of Nginx 0.8.20, the `location` argument does *not* support named location, due to a limitation in the `ngx_http_subrequest` function. The same is true for its brother, the [echo_location](#echo_location) directive. - -A very simple example is - -```nginx - - location /main { - echo_location_async /sub; - echo world; - } - location /sub { - echo hello; - } -``` - -Accessing `/main` gets - -```bash - - hello - world -``` - -Calling multiple locations in parallel is also possible: - -```nginx - - location /main { - echo_reset_timer; - echo_location_async /sub1; - echo_location_async /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 2; # sleeps 2 sec - echo hello; - } - location /sub2 { - echo_sleep 1; # sleeps 1 sec - echo world; - } -``` - -Accessing `/main` yields - -```bash - - $ time curl 'http://localhost/main' - hello - world - took 0.000 sec for total. - - real 0m2.006s - user 0m0.000s - sys 0m0.004s -``` - -You can see that the main handler `/main` does *not* wait the subrequests `/sub1` and `/sub2` to complete and quickly goes on, hence the "0.000 sec" timing result. The whole request, however takes approximately 2 sec in total to complete because `/sub1` and `/sub2` run in parallel (or "concurrently" to be more accurate). - -If you use [echo_blocking_sleep](#echo_blocking_sleep) in the previous example instead, then you'll get the same output, but with 3 sec total response time, because "blocking sleep" blocks the whole Nginx worker process. - -Locations can also take an optional querystring argument, for instance - -```nginx - - location /main { - echo_location_async /sub 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } -``` - -Accessing `/main` yields - -```bash - - $ curl 'http://localhost/main' - Foo Bar -``` - -Querystrings is *not* allowed to be concatenated onto the `location` argument with "?" directly, for example, `/sub?foo=Foo&bar=Bar` is an invalid location, and shouldn't be fed as the first argument to this directive. - -Technically speaking, this directive is an example that Nginx content handler issues one or more subrequests directly. AFAIK, the [fancyindex module](https://connectical.com/projects/ngx-fancyindex/wiki) also does such kind of things ;) - -Nginx named locations like `@foo` is *not* supported here. - -This directive is logically equivalent to the GET version of [echo_subrequest_async](#echo_subrequest_async). For example, - -```nginx - - echo_location_async /foo 'bar=Bar'; -``` - -is logically equivalent to - -```nginx - - echo_subrequest_async GET /foo -q 'bar=Bar'; -``` - -But calling this directive is slightly faster than calling [echo_subrequest_async](#echo_subrequest_async) using `GET` because we don't have to parse the HTTP method names like `GET` and options like `-q`. - -This directive is first introduced in [version 0.09](#v009) of this module and requires at least Nginx 0.7.46. - -[Back to TOC](#table-of-contents) - -echo_location -------------- -**syntax:** *echo_location <location> [<url_args>]* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Just like the [echo_location_async](#echo_location_async) directive, but `echo_location` issues subrequests *in series* rather than in parallel. That is, the content handler directives following this directive won't be executed until the subrequest issued by this directive completes. - -The final response body is almost always equivalent to the case when [echo_location_async](#echo_location_async) is used instead, only if timing variables is used in the outputs. - -Consider the following example: - -```nginx - - location /main { - echo_reset_timer; - echo_location /sub1; - echo_location /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 2; - echo hello; - } - location /sub2 { - echo_sleep 1; - echo world; - } -``` - -The location `/main` above will take for total 3 sec to complete (compared to 2 sec if [echo_location_async](#echo_location_async) is used instead here). Here's the result in action on my machine: - -```bash - - $ curl 'http://localhost/main' - hello - world - took 3.003 sec for total. - - real 0m3.027s - user 0m0.020s - sys 0m0.004s -``` - -This directive is logically equivalent to the GET version of [echo_subrequest](#echo_subrequest). For example, - -```nginx - - echo_location /foo 'bar=Bar'; -``` - -is logically equivalent to - -```nginx - - echo_subrequest GET /foo -q 'bar=Bar'; -``` - -But calling this directive is slightly faster than calling [echo_subrequest](#echo_subrequest) using `GET` because we don't have to parse the HTTP method names like `GET` and options like `-q`. - -Behind the scene, it creates an `ngx_http_post_subrequest_t` object as a *continuation* and passes it into the `ngx_http_subrequest` function call. Nginx will later reopen this "continuation" in the subrequest's `ngx_http_finalize_request` function call. We resumes the execution of the parent-request's content handler and starts to run the next directive (command) if any. - -Nginx named locations like `@foo` is *not* supported here. - -This directive was first introduced in the [release v0.12](#v012). - -See also [echo_location_async](#echo_location_async) for more details about the meaning of the arguments. - -[Back to TOC](#table-of-contents) - -echo_subrequest_async ---------------------- -**syntax:** *echo_subrequest_async <HTTP_method> <location> [-q <url_args>] [-b <request_body>] [-f <request_body_path>]* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Initiate an asynchronous subrequest using HTTP method, an optional url arguments (or querystring) and an optional request body which can be defined as a string or as a path to a file which contains the body. - -This directive is very much like a generalized version of the [echo_location_async](#echo_location_async) directive. - -Here's a small example demonstrating its usage: - -```nginx - - location /multi { - # body defined as string - echo_subrequest_async POST '/sub' -q 'foo=Foo' -b 'hi'; - # body defined as path to a file, relative to nginx prefix path if not absolute - echo_subrequest_async PUT '/sub' -q 'bar=Bar' -f '/tmp/hello.txt'; - } - location /sub { - echo "querystring: $query_string"; - echo "method: $echo_request_method"; - echo "body: $echo_request_body"; - echo "content length: $http_content_length"; - echo '///'; - } -``` - -Then on the client side: - -```bash - - $ echo -n hello > /tmp/hello.txt - $ curl 'http://localhost/multi' - querystring: foo=Foo - method: POST - body: hi - content length: 2 - /// - querystring: bar=Bar - method: PUT - body: hello - content length: 5 - /// -``` - -Here's more funny example using the standard [proxy module](#httpproxymodule) to handle the subrequest: - -```nginx - - location /main { - echo_subrequest_async POST /sub -b 'hello, world'; - } - location /sub { - proxy_pass $scheme://127.0.0.1:$server_port/proxied; - } - location /proxied { - echo "method: $echo_request_method."; - - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo_read_request_body; - - echo "body: $echo_request_body."; - } -``` - -Then on the client side, we can see that - -```bash - - $ curl 'http://localhost/main' - method: POST. - body: hello, world. -``` - -Nginx named locations like `@foo` is *not* supported here. - -This directive takes several options: - - - -q Specify the URL arguments (or URL querystring) for the subrequest. - - -f Specify the path for the file whose content will be serve as the - subrequest's request body. - - -b Specify the request body data - - -This directive was first introduced in the [release v0.15](#v015). - -The `-f` option to define a file path for the body was introduced in the [release v0.35](#v035). - -See also the [echo_subrequest](#echo_subrequest) and [echo_location_async](#echo_location_async) directives. - -[Back to TOC](#table-of-contents) - -echo_subrequest ---------------- -**syntax:** *echo_subrequest <HTTP_method> <location> [-q <url_args>] [-b <request_body>] [-f <request_body_path>]* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -This is the synchronous version of the [echo_subrequest_async](#echo_subrequest_async) directive. And just like [echo_location](#echo_location), it does not block the Nginx worker process (while [echo_blocking_sleep](#echo_blocking_sleep) does), rather, it uses continuation to pass control along the subrequest chain. - -See [echo_subrequest_async](#echo_subrequest_async) for more details. - -Nginx named locations like `@foo` is *not* supported here. - -This directive was first introduced in the [release v0.15](#v015). - -[Back to TOC](#table-of-contents) - -echo_foreach_split ------------------- -**syntax:** *echo_foreach_split <delimiter> <string>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Split the second argument `string` using the delimiter specified in the first argument, and then iterate through the resulting items. For instance: - -```nginx - - location /loop { - echo_foreach_split ',' $arg_list; - echo "item: $echo_it"; - echo_end; - } -``` - -Accessing /main yields - -```bash - - $ curl 'http://localhost/loop?list=cat,dog,mouse' - item: cat - item: dog - item: mouse -``` - -As seen in the previous example, this directive should always be accompanied by an [echo_end](#echo_end) directive. - -Parallel `echo_foreach_split` loops are allowed, but nested ones are currently forbidden. - -The `delimiter` argument could contain *multiple* arbitrary characters, like - -```nginx - - # this outputs "cat\ndog\nmouse\n" - echo_foreach_split -- '-a-' 'cat-a-dog-a-mouse'; - echo $echo_it; - echo_end; -``` - -Logically speaking, this looping structure is just the `foreach` loop combined with a `split` function call in Perl (using the previous example): - -```perl - - foreach (split ',', $arg_list) { - print "item $_\n"; - } -``` - -People will also find it useful in merging multiple `.js` or `.css` resources into a whole. Here's an example: - -```nginx - - location /merge { - default_type 'text/javascript'; - - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } -``` - -Then accessing /merge to merge the `.js` resources specified in the query string: - -```bash - - $ curl 'http://localhost/merge?/foo/bar.js&/yui/blah.js&/baz.js' -``` - -One can also use third-party Nginx cache module to cache the merged response generated by the `/merge` location in the previous example. - -This directive was first introduced in the [release v0.17](#v017). - -[Back to TOC](#table-of-contents) - -echo_end --------- -**syntax:** *echo_end* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -This directive is used to terminate the body of looping and conditional control structures like [echo_foreach_split](#echo_foreach_split). - -This directive was first introduced in the [release v0.17](#v017). - -[Back to TOC](#table-of-contents) - -echo_request_body ------------------ -**syntax:** *echo_request_body* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Outputs the contents of the request body previous read. - -Behind the scene, it's implemented roughly like this: - -```C - - if (r->request_body && r->request_body->bufs) { - return ngx_http_output_filter(r, r->request_body->bufs); - } -``` - -Unlike the [$echo_request_body](#echo_request_body) and $request_body variables, this directive will show the whole request body even if some parts or all parts of it are saved in temporary files on the disk. - -It is a "no-op" if no request body has been read yet. - -This directive was first introduced in the [release v0.18](#v018). - -See also [echo_read_request_body](#echo_read_request_body) and the [chunkin module](http://github.com/agentzh/chunkin-nginx-module). - -[Back to TOC](#table-of-contents) - -echo_exec ---------- -**syntax:** *echo_exec <location> [<query_string>]* - -**syntax:** *echo_exec <named_location>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Does an internal redirect to the location specified. An optional query string can be specified for normal locations, as in - -```nginx - - location /foo { - echo_exec /bar weight=5; - } - location /bar { - echo $arg_weight; - } -``` - -Or equivalently - -```nginx - - location /foo { - echo_exec /bar?weight=5; - } - location /bar { - echo $arg_weight; - } -``` - -Named locations are also supported. Here's an example: - -```nginx - - location /foo { - echo_exec @bar; - } - location @bar { - # you'll get /foo rather than @bar - # due to a potential bug in nginx. - echo $echo_request_uri; - } -``` - -But query string (if any) will always be ignored for named location redirects due to a limitation in the `ngx_http_named_location` function. - -Never try to echo things before the `echo_exec` directive or you won't see the proper response of the location you want to redirect to. Because any echoing will cause the original location handler to send HTTP headers before the redirection happens. - -Technically speaking, this directive exposes the Nginx internal API functions `ngx_http_internal_redirect` and `ngx_http_named_location`. - -This directive was first introduced in the [v0.21 release](#v021). - -[Back to TOC](#table-of-contents) - -echo_status ------------ -**syntax:** *echo_status <status-num>* - -**default:** *echo_status 200* - -**context:** *location, location if* - -**phase:** *content* - -Specify the default response status code. Default to `200`. This directive is declarative and the relative order with other echo-like directives is not important. - -Here is an example, - -```nginx - - location = /bad { - echo_status 404; - echo "Something is missing..."; - } -``` - -then we get a response like this: - - - HTTP/1.1 404 Not Found - Server: nginx/1.2.1 - Date: Sun, 24 Jun 2012 03:58:18 GMT - Content-Type: text/plain - Transfer-Encoding: chunked - Connection: keep-alive - - Something is missing... - - -This directive was first introduced in the `v0.40` release. - -[Back to TOC](#table-of-contents) - -Filter Directives -================= - -Use of the following directives trigger the filter registration of this module. By default, no filter will be registered by this module. - -Every filter directive supports variable interpolation in its arguments (if any). - -[Back to TOC](#table-of-contents) - -echo_before_body ----------------- -**syntax:** *echo_before_body \[options\] \[argument\]...* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *output filter* - -It's the filter version of the [echo](#echo) directive, and prepends its output to the beginning of the original outputs generated by the underlying content handler. - -An example is - -```nginx - - location /echo { - echo_before_body hello; - proxy_pass $scheme://127.0.0.1:$server_port$request_uri/more; - } - location /echo/more { - echo world - } -``` - -Accessing `/echo` from the client side yields - -```bash - - hello - world -``` - -In the previous sample, we borrow the [standard proxy module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html) to serve as the underlying content handler that generates the "main contents". - -Multiple instances of this filter directive are also allowed, as in: - -```nginx - - location /echo { - echo_before_body hello; - echo_before_body world; - echo !; - } -``` - -On the client side, the output is like - -```bash - - $ curl 'http://localhost/echo' - hello - world - ! -``` - -In this example, we also use the [content handler directives](#content-handler-directives) provided by this module as the underlying content handler. - -This directive also supports the `-n` and `--` options like the [echo](#echo) directive. - -This directive can be mixed with its brother directive [echo_after_body](#echo_after_body). - -[Back to TOC](#table-of-contents) - -echo_after_body ---------------- -**syntax:** *echo_after_body \[argument\]...* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *output filter* - -It's very much like the [echo_before_body](#echo_before_body) directive, but *appends* its output to the end of the original outputs generated by the underlying content handler. - -Here's a simple example: - -```nginx - - location /echo { - echo_after_body hello; - proxy_pass http://127.0.0.1:$server_port$request_uri/more; - } - location /echo/more { - echo world - } -``` - -Accessing `/echo` from the client side yields - - - world - hello - - -Multiple instances are allowed, as in: - -```nginx - - location /echo { - echo_after_body hello; - echo_after_body world; - echo i; - echo say; - } -``` - -The output on the client side while accessing the `/echo` location looks like - - - i - say - hello - world - - -This directive also supports the `-n` and `--` options like the [echo](#echo) directive. - -This directive can be mixed with its brother directive [echo_before_body](#echo_before_body). - -[Back to TOC](#table-of-contents) - -Variables -========= - -[Back to TOC](#table-of-contents) - -$echo_it --------- - -This is a "topic variable" used by [echo_foreach_split](#echo_foreach_split), just like the `$_` variable in Perl. - -[Back to TOC](#table-of-contents) - -$echo_timer_elapsed -------------------- - -This variable holds the seconds elapsed since the start of the current request (might be a subrequest though) or the last invocation of the [echo_reset_timer](#echo_reset_timer) command. - -The timing result takes three digits after the decimal point. - -References of this variable will force the underlying Nginx timer to update to the current system time, regardless the timer resolution settings elsewhere in the config file, just like the [echo_reset_timer](#echo_reset_timer) directive. - -[Back to TOC](#table-of-contents) - -$echo_request_body ------------------- - -Evaluates to the current (sub)request's request body previously read if no part of the body has been saved to a temporary file. To always show the request body even if it's very large, use the [echo_request_body](#echo_request_body) directive. - -[Back to TOC](#table-of-contents) - -$echo_request_method --------------------- - -Evaluates to the HTTP request method of the current request (it can be a subrequest). - -Behind the scene, it just takes the string data stored in `r->method_name`. - -Compare it to the [$echo_client_request_method](#echo_client_request_method) variable. - -At least for Nginx 0.8.20 and older, the [$request_method](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_method) variable provided by the [http core module](http://nginx.org/en/docs/http/ngx_http_core_module.html) is actually doing what our [$echo_client_request_method](#echo_client_request_method) is doing. - -This variable was first introduced in our [v0.15 release](#v015). - -[Back to TOC](#table-of-contents) - -$echo_client_request_method ---------------------------- - -Always evaluates to the main request's HTTP method even if the current request is a subrequest. - -Behind the scene, it just takes the string data stored in `r->main->method_name`. - -Compare it to the [$echo_request_method](#echo_request_method) variable. - -This variable was first introduced in our [v0.15 release](#v015). - -[Back to TOC](#table-of-contents) - -$echo_client_request_headers ----------------------------- - -Evaluates to the original client request's headers. - -Just as the name suggests, it will always take the main request (or the client request) even if it's currently executed in a subrequest. - -A simple example is below: - -```nginx - - location /echoback { - echo "headers are:" - echo $echo_client_request_headers; - } -``` - -Accessing `/echoback` yields - -```bash - - $ curl 'http://localhost/echoback' - headers are - GET /echoback HTTP/1.1 - User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g - Host: localhost:1984 - Accept: */* -``` - -Behind the scene, it recovers `r->main->header_in` (or the large header buffers, if any) on the C level and does not construct the headers itself by traversing parsed results in the request object. - -This varible is always evaluated to an empty value in HTTP/2 requests for now due to the current implementation. - -This variable was first introduced in [version 0.15](#v015). - -[Back to TOC](#table-of-contents) - -$echo_cacheable_request_uri ---------------------------- - -Evaluates to the parsed form of the URI (usually led by `/`) of the current (sub-)request. Unlike the [$echo_request_uri](#echo_request_uri) variable, it is cacheable. - -See [$echo_request_uri](#echo_request_uri) for more details. - -This variable was first introduced in [version 0.17](#v017). - -[Back to TOC](#table-of-contents) - -$echo_request_uri ------------------ - -Evaluates to the parsed form of the URI (usually led by `/`) of the current (sub-)request. Unlike the [$echo_cacheable_request_uri](#echo_cacheable_request_uri) variable, it is *not* cacheable. - -This is quite different from the [$request_uri](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_uri) variable exported by the [ngx_http_core_module](http://nginx.org/en/docs/http/ngx_http_core_module.html), because `$request_uri` is the *unparsed* form of the current request's URI. - -This variable was first introduced in [version 0.17](#v017). - -[Back to TOC](#table-of-contents) - -$echo_incr ----------- - -It is a counter that always generate the current counting number, starting from 1. The counter is always associated with the main request even if it is accessed within a subrequest. - -Consider the following example - -```Nginx - - location /main { - echo "main pre: $echo_incr"; - echo_location_async /sub; - echo_location_async /sub; - echo "main post: $echo_incr"; - } - location /sub { - echo "sub: $echo_incr"; - } -``` - -Accessing `/main` yields - - main pre: 1 - sub: 3 - sub: 4 - main post: 2 - -This directive was first introduced in the [v0.18 release](#v018). - -[Back to TOC](#table-of-contents) - -$echo_response_status ---------------------- - -Evaluates to the status code of the current (sub)request, null if not any. - -Behind the scene, it's just the textual representation of `r->headers_out->status`. - -This directive was first introduced in the [v0.23 release](#v023). - -[Back to TOC](#table-of-contents) - -Installation -============ - -You're recommended to install this module (as well as the Nginx core and many other goodies) via the [OpenResty bundle](http://openresty.org). See [the detailed instructions](http://openresty.org/#Installation) for downloading and installing OpenResty into your system. This is the easiest and most safe way to set things up. - -Alternatively, you can install this module manually with the Nginx source: - -Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.11.2 (see [nginx compatibility](#compatibility)), and then build the source with this module: - -```bash - - $ wget 'http://nginx.org/download/nginx-1.11.2.tar.gz' - $ tar -xzvf nginx-1.11.2.tar.gz - $ cd nginx-1.11.2/ - - # Here we assume you would install you nginx under /opt/nginx/. - $ ./configure --prefix=/opt/nginx \ - --add-module=/path/to/echo-nginx-module - - $ make -j2 - $ make install -``` - -Download the latest version of the release tarball of this module from [echo-nginx-module file list](https://github.com/openresty/echo-nginx-module/tags). - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ngx_http_echo_module.so; -``` - -Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org). - -[Back to TOC](#table-of-contents) - -Compatibility -============= - -The following versions of Nginx should work with this module: - -* **1.16.x** -* **1.15.x** (last tested: 1.15.8) -* **1.14.x** -* **1.13.x** (last tested: 1.13.6) -* **1.12.x** -* **1.11.x** (last tested: 1.11.2) -* **1.10.x** -* **1.9.x** (last tested: 1.9.15) -* **1.8.x** -* **1.7.x** (last tested: 1.7.10) -* **1.6.x** -* **1.5.x** (last tested: 1.5.12) -* **1.4.x** (last tested: 1.4.4) -* **1.3.x** (last tested: 1.3.7) -* **1.2.x** (last tested: 1.2.9) -* **1.1.x** (last tested: 1.1.5) -* **1.0.x** (last tested: 1.0.11) -* **0.9.x** (last tested: 0.9.4) -* **0.8.x** (last tested: 0.8.54) -* **0.7.x >= 0.7.21** (last tested: 0.7.68) - -In particular, - -* the directive [echo_location_async](#echo_location_async) and its brother [echo_subrequest_async](#echo_subrequest_async) do *not* work with **0.7.x < 0.7.46**. -* the [echo_after_body](#echo_after_body) directive does *not* work at all with nginx **< 0.8.7**. -* the [echo_sleep](#echo_sleep) directive cannot be used after [echo_location](#echo_location) or [echo_subrequest](#echo_subrequest) for nginx **< 0.8.11**. - -Earlier versions of Nginx like 0.6.x and 0.5.x will *not* work at all. - -If you find that any particular version of Nginx above 0.7.21 does not work with this module, please consider [reporting a bug](#report-bugs). - -[Back to TOC](#table-of-contents) - -Modules that use this module for testing -======================================== - -The following modules take advantage of this `echo` module in their test suite: - -* The [memc](http://github.com/openresty/memc-nginx-module) module that supports almost the whole memcached TCP protocol. -* The [chunkin](http://github.com/agentzh/chunkin-nginx-module) module that adds HTTP 1.1 chunked input support to Nginx. -* The [headers_more](http://github.com/openresty/headers-more-nginx-module) module that allows you to add, set, and clear input and output headers under the conditions that you specify. -* The `echo` module itself. - -Please mail me other modules that use `echo` in any form and I'll add them to the list above :) - -[Back to TOC](#table-of-contents) - -Community -========= - -[Back to TOC](#table-of-contents) - -English Mailing List --------------------- - -The [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers. - -[Back to TOC](#table-of-contents) - -Chinese Mailing List --------------------- - -The [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers. - -[Back to TOC](#table-of-contents) - -Report Bugs -=========== - -Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to - -1. create a ticket on the [issue tracking interface](https://github.com/openresty/echo-nginx-module/issues) provided by GitHub, -1. or send a bug report, questions, or even patches to the [OpenResty Community](#community). - -[Back to TOC](#table-of-contents) - -Source Repository -================= - -Available on github at [openresty/echo-nginx-module](https://github.com/openresty/echo-nginx-module). - -[Back to TOC](#table-of-contents) - -Changes -======= - -The changes of every release of this module can be obtained from the OpenResty bundle's change logs: - - - -[Back to TOC](#table-of-contents) - -Test Suite -========== - -This module comes with a Perl-driven test suite. The [test cases](https://github.com/openresty/echo-nginx-module/tree/master/t/) are -[declarative](https://github.com/openresty/echo-nginx-module/blob/master/t/echo.t) too. Thanks to the [Test::Nginx](http://search.cpan.org/perldoc?Test::Nginx) module in the Perl world. - -To run it on your side: - -```bash - - $ PATH=/path/to/your/nginx-with-echo-module:$PATH prove -r t -``` - -You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary. - -Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility. - -Some parts of the test suite requires standard modules [proxy](http://nginx.org/en/docs/http/ngx_http_proxy_module.html), [rewrite](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) and [SSI](http://nginx.org/en/docs/http/ngx_http_ssi_module.html) to be enabled as well when building Nginx. - -[Back to TOC](#table-of-contents) - -TODO -==== - -* Fix the [echo_after_body](#echo_after_body) directive in subrequests. -* Add directives *echo_read_client_request_body* and *echo_request_headers*. -* Add new directive *echo_log* to use Nginx's logging facility directly from the config file and specific loglevel can be specified, as in - -```nginx - - echo_log debug "I am being called."; -``` - -* Add support for options `-h` and `-t` to [echo_subrequest_async](#echo_subrequest_async) and [echo_subrequest](#echo_subrequest). For example - -```nginx - - echo_subrequest POST /sub -q 'foo=Foo&bar=Bar' -b 'hello' -t 'text/plan' -h 'X-My-Header: blah blah' -``` - -* Add options to control whether a subrequest should inherit cached variables from its parent request (i.e. the current request that is calling the subrequest in question). Currently none of the subrequests issued by this module inherit the cached variables from the parent request. -* Add new variable *$echo_active_subrequests* to show `r->main->count - 1`. -* Add the *echo_file* and *echo_cached_file* directives. -* Add new varaible *$echo_request_headers* to accompany the existing [$echo_client_request_headers](#echo_client_request_headers) variable. -* Add new directive *echo_foreach*, as in - -```nginx - - echo_foreach 'cat' 'dog' 'mouse'; - echo_location_async "/animals/$echo_it"; - echo_end; -``` - -* Add new directive *echo_foreach_range*, as in - -```nginx - - echo_foreach_range '[1..100]' '[a-zA-z0-9]'; - echo_location_async "/item/$echo_it"; - echo_end; -``` - -* Add new directive *echo_repeat*, as in - -```nginx - - echo_repeat 10 $i { - echo "Page $i"; - echo_location "/path/to/page/$i"; - } -``` - -This is just another way of saying - -```nginx - - echo_foreach_range $i [1..10]; - echo "Page $i"; - echo_location "/path/to/page/$i"; - echo_end; -``` - -Thanks Marcus Clyne for providing this idea. - -* Add new variable $echo_random which always returns a random non-negative integer with the lower/upper limit specified by the new directives `echo_random_min` and `echo_random_max`. For example, - -```nginx - - echo_random_min 10 - echo_random_max 200 - echo "random number: $echo_random"; -``` - -Thanks Marcus Clyne for providing this idea. - -[Back to TOC](#table-of-contents) - -Getting involved -================ - -You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub. - -[Back to TOC](#table-of-contents) - -Author -====== - -Yichun "agentzh" Zhang (章亦春) *<agentzh@gmail.com>*, OpenResty Inc. - -This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well. - -[Back to TOC](#table-of-contents) - -Copyright & License -=================== - -Copyright (c) 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. - -This module is licensed under the terms of the BSD license. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[Back to TOC](#table-of-contents) - -See Also -======== - -* The original [blog post](http://agentzh.blogspot.com/2009/10/hacking-on-nginx-echo-module.html) about this module's initial development. -* The standard [addition filter module](http://nginx.org/en/docs/http/ngx_http_addition_module.html). -* The standard [proxy module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html). -* The [OpenResty](http://openresty.org) bundle. - -[Back to TOC](#table-of-contents) - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/config b/modules_deb/libnginx-mod-http-echo-0.63/config deleted file mode 100644 index 4bf0f00..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/config +++ /dev/null @@ -1,63 +0,0 @@ -ngx_addon_name=ngx_http_echo_module - -ECHO_SRCS=" \ - $ngx_addon_dir/src/ngx_http_echo_module.c \ - $ngx_addon_dir/src/ngx_http_echo_util.c \ - $ngx_addon_dir/src/ngx_http_echo_timer.c \ - $ngx_addon_dir/src/ngx_http_echo_var.c \ - $ngx_addon_dir/src/ngx_http_echo_handler.c \ - $ngx_addon_dir/src/ngx_http_echo_filter.c \ - $ngx_addon_dir/src/ngx_http_echo_sleep.c \ - $ngx_addon_dir/src/ngx_http_echo_location.c \ - $ngx_addon_dir/src/ngx_http_echo_echo.c \ - $ngx_addon_dir/src/ngx_http_echo_request_info.c \ - $ngx_addon_dir/src/ngx_http_echo_subrequest.c \ - $ngx_addon_dir/src/ngx_http_echo_foreach.c \ - " - -ECHO_DEPS=" \ - $ngx_addon_dir/src/ddebug.h \ - $ngx_addon_dir/src/ngx_http_echo_module.h \ - $ngx_addon_dir/src/ngx_http_echo_handler.h \ - $ngx_addon_dir/src/ngx_http_echo_util.h \ - $ngx_addon_dir/src/ngx_http_echo_sleep.h \ - $ngx_addon_dir/src/ngx_http_echo_filter.h \ - $ngx_addon_dir/src/ngx_http_echo_var.h \ - $ngx_addon_dir/src/ngx_http_echo_location.h \ - $ngx_addon_dir/src/ngx_http_echo_echo.h \ - $ngx_addon_dir/src/ngx_http_echo_request_info.h \ - $ngx_addon_dir/src/ngx_http_echo_subrequest.h \ - $ngx_addon_dir/src/ngx_http_echo_foreach.h \ - " - -# nginx 1.17.0+ unconditionally enables the postpone filter -if [ ! -z "$HTTP_POSTPONE" ]; then - # nginx won't have HTTP_POSTPONE_FILTER_MODULE & HTTP_POSTPONE_FILTER_SRCS - # defined since 1.9.11 - if [ -z "$HTTP_POSTPONE_FILTER_MODULE" ]; then - HTTP_POSTPONE_FILTER_MODULE=ngx_http_postpone_filter_module - HTTP_POSTPONE_FILTER_SRCS=src/http/ngx_http_postpone_filter_module.c - fi - - # This module depends upon the postpone filter being activated - if [ "$HTTP_POSTPONE" != YES ]; then - HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_POSTPONE_FILTER_MODULE" - HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS" - HTTP_POSTPONE=YES - fi -fi - -if [ -n "$ngx_module_link" ]; then - ngx_module_type=HTTP_AUX_FILTER - ngx_module_name=$ngx_addon_name - ngx_module_incs= - ngx_module_deps="$ECHO_DEPS" - ngx_module_srcs="$ECHO_SRCS" - ngx_module_libs= - - . auto/module -else - HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ECHO_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ECHO_DEPS" -fi diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/changelog b/modules_deb/libnginx-mod-http-echo-0.63/debian/changelog deleted file mode 100644 index 1e6c923..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/changelog +++ /dev/null @@ -1,53 +0,0 @@ -libnginx-mod-http-echo (1:0.63-7) unstable; urgency=medium - - * d/control: update my email to janmojzis@debian.org - * d/copyright: update my email to janmojzis@debian.org - * d/control: bump Standards-Version: 4.7.2, no changes - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:58 +0200 - -libnginx-mod-http-echo (1:0.63-6) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:26 +0200 - -libnginx-mod-http-echo (1:0.63-5) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:36 +0200 - -libnginx-mod-http-echo (1:0.63-4) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: added - * d/copyright: bump my copyright year - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * d/fix.scanned.copyright: added, fixes upstream author name parsing - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 15:03:42 +0100 - -libnginx-mod-http-echo (1:0.63-3) unstable; urgency=medium - - * No source change upload to unstable. - - -- Jan Mojžíš Fri, 09 Dec 2022 14:36:45 +0100 - -libnginx-mod-http-echo (1:0.63-2) experimental; urgency=medium - - * d/control: added Multi-Arch: foreign - * d/copyright: update, add Igor Sysoev - - -- Jan Mojžíš Mon, 05 Dec 2022 21:14:02 +0100 - -libnginx-mod-http-echo (1:0.63-1) experimental; urgency=medium - - * Initial release. (Closes: 1024153) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:48 +0100 diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/control b/modules_deb/libnginx-mod-http-echo-0.63/debian/control deleted file mode 100644 index e7cfde3..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/control +++ /dev/null @@ -1,36 +0,0 @@ -Source: libnginx-mod-http-echo -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, -Standards-Version: 4.7.2 -Homepage: https://github.com/agentzh/echo-nginx-module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-echo.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-echo -Rules-Requires-Root: no - -Package: libnginx-mod-http-echo -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Bring echo and more shell style goodies to Nginx - Echo module wraps lots of Nginx internal APIs for streaming input and output, - parallel/sequential subrequests, timers and sleeping, as well as various meta - data accessing. - . - Basically it provides various utilities that help testing and debugging of - other modules by trivially emulating different kinds of faked subrequest - locations. - . - People will also find it useful in real-world applications that need to: - . - 1. Serve static contents directly from memory. - 2. Wrap the upstream response with custom header and footer (kinda like the - addition module but with contents read directly from the config file and - Nginx variables). - 3. Merge contents of various "Nginx locations" (i.e., subrequests) together in - a single main request (using echo_location and its friends). diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/copyright b/modules_deb/libnginx-mod-http-echo-0.63/debian/copyright deleted file mode 100644 index 061d047..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/copyright +++ /dev/null @@ -1,71 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: echo-nginx-module -Upstream-Contact: Yichun "agentzh" Zhang -Source: https://github.com/agentzh/echo-nginx-module - -Files: * -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. - 2009-2014, Yichun "agentzh" Zhang . -License: BSD-2-clause - -Files: README.markdown -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: config -Copyright: 2009-2018, Yichun "agentzh" Zhang . -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: src/* -Copyright: 2009-2018, Yichun "agentzh" Zhang . -License: BSD-2-clause - -Files: src/ngx_http_echo_handler.c - src/ngx_http_echo_module.c - src/ngx_http_echo_module.h - src/ngx_http_echo_request_info.c - src/ngx_http_echo_sleep.c - src/ngx_http_echo_subrequest.c - src/ngx_http_echo_util.c - src/ngx_http_echo_util.h -Copyright: Yichun Zhang (agentzh) -License: BSD-2-clause - -Files: t/* -Copyright: 2009-2018, Yichun "agentzh" Zhang . -License: BSD-2-clause - -Files: util/* -Copyright: 2009-2018, Yichun "agentzh" Zhang . -License: BSD-2-clause - -License: BSD-2-clause - All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/fix.scanned.copyright b/modules_deb/libnginx-mod-http-echo-0.63/debian/fix.scanned.copyright deleted file mode 100644 index b25e244..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/fix.scanned.copyright +++ /dev/null @@ -1,2 +0,0 @@ -# fixes upstream author name parsing -! copyright Files:~/.*/ Copyright=~"s/(Zhang)\s\(.*x\{6625\}\)/$1\ (章亦春)/" diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/gbp.conf b/modules_deb/libnginx-mod-http-echo-0.63/debian/gbp.conf deleted file mode 100644 index d9f01a6..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/gbp.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = False -sign-tags = True - -[import-orig] -merge-mode = replace diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/rules b/modules_deb/libnginx-mod-http-echo-0.63/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/source/format b/modules_deb/libnginx-mod-http-echo-0.63/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/control b/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/control deleted file mode 100644 index b95c6ff..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/control +++ /dev/null @@ -1,13 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: helloworld -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/generic b/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/helloworld b/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/helloworld deleted file mode 100644 index c66b2dc..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/helloworld +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - - location /helloworld { - echo "hello world"; - } -} -EOF - -exp="hello world -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/helloworld` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/upstream/metadata b/modules_deb/libnginx-mod-http-echo-0.63/debian/upstream/metadata deleted file mode 100644 index 81ba6ec..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/agentzh/echo-nginx-module/issues -Bug-Submit: https://github.com/agentzh/echo-nginx-module/issues/new -Repository-Browse: https://github.com/agentzh/echo-nginx-module \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/watch b/modules_deb/libnginx-mod-http-echo-0.63/debian/watch deleted file mode 100644 index 55febdb..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/agentzh/echo-nginx-module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ddebug.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ddebug.h deleted file mode 100644 index a92d7a7..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ddebug.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef DDEBUG_H -#define DDEBUG_H - -#include -#include -#include - -#if defined(DDEBUG) && (DDEBUG) - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) fprintf(stderr, "echo *** %s: ", __func__); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__) - -# else - -#include -#include - -#include - -static ngx_inline void -dd(const char * fmt, ...) { -} - -# endif - -# if DDEBUG > 1 - -# define dd_enter() dd_enter_helper(r, __func__) - -static ngx_inline void -dd_enter_helper(ngx_http_request_t *r, const char *func) { - ngx_http_posted_request_t *pr; - - fprintf(stderr, ">enter %s %.*s %.*s?%.*s c:%d m:%p r:%p ar:%p pr:%p", - func, - (int) r->method_name.len, r->method_name.data, - (int) r->uri.len, r->uri.data, - (int) r->args.len, r->args.data, - 0/*(int) r->main->count*/, r->main, - r, r->connection->data, r->parent); - - if (r->posted_requests) { - fprintf(stderr, " posted:"); - - for (pr = r->posted_requests; pr; pr = pr->next) { - fprintf(stderr, "%p,", pr); - } - } - - fprintf(stderr, "\n"); -} - -# else - -# define dd_enter() - -# endif - -#else - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) - -# define dd_enter() - -# else - -#include - -static ngx_inline void -dd(const char * fmt, ...) { -} - -static ngx_inline void -dd_enter() { -} - -# endif - -#endif - -#if defined(DDEBUG) && (DDEBUG) - -#define dd_check_read_event_handler(r) \ - dd("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#define dd_check_write_event_handler(r) \ - dd("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - -#define dd_check_read_event_handler(r) -#define dd_check_write_event_handler(r) - -#endif - -#endif /* DDEBUG_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.c deleted file mode 100644 index f5789f5..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.c +++ /dev/null @@ -1,342 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_echo.h" -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_filter.h" - -#include - -static ngx_buf_t ngx_http_echo_space_buf; - -static ngx_buf_t ngx_http_echo_newline_buf; - - -ngx_int_t -ngx_http_echo_echo_init(ngx_conf_t *cf) -{ - static u_char space_str[] = " "; - static u_char newline_str[] = "\n"; - - dd("global init..."); - - ngx_memzero(&ngx_http_echo_space_buf, sizeof(ngx_buf_t)); - - ngx_http_echo_space_buf.memory = 1; - - ngx_http_echo_space_buf.start = - ngx_http_echo_space_buf.pos = - space_str; - - ngx_http_echo_space_buf.end = - ngx_http_echo_space_buf.last = - space_str + sizeof(space_str) - 1; - - ngx_memzero(&ngx_http_echo_newline_buf, sizeof(ngx_buf_t)); - - ngx_http_echo_newline_buf.memory = 1; - - ngx_http_echo_newline_buf.start = - ngx_http_echo_newline_buf.pos = - newline_str; - - ngx_http_echo_newline_buf.end = - ngx_http_echo_newline_buf.last = - newline_str + sizeof(newline_str) - 1; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_sync(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - ngx_buf_t *buf; - ngx_chain_t *cl = NULL; /* the head of the chain link */ - - buf = ngx_calloc_buf(r->pool); - if (buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - buf->sync = 1; - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - cl->buf = buf; - cl->next = NULL; - - return ngx_http_echo_send_chain_link(r, ctx, cl); -} - - -ngx_int_t -ngx_http_echo_exec_echo(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args, - ngx_flag_t in_filter, ngx_array_t *opts) -{ - ngx_uint_t i; - - ngx_buf_t *space_buf; - ngx_buf_t *newline_buf; - ngx_buf_t *buf; - - ngx_str_t *computed_arg; - ngx_str_t *computed_arg_elts; - ngx_str_t *opt; - - ngx_chain_t *cl = NULL; /* the head of the chain link */ - ngx_chain_t **ll = &cl; /* always point to the address of the last link */ - - dd_enter(); - - if (computed_args == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - computed_arg_elts = computed_args->elts; - for (i = 0; i < computed_args->nelts; i++) { - computed_arg = &computed_arg_elts[i]; - - if (computed_arg->len == 0) { - buf = NULL; - - } else { - buf = ngx_calloc_buf(r->pool); - if (buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - buf->start = buf->pos = computed_arg->data; - buf->last = buf->end = computed_arg->data + - computed_arg->len; - - buf->memory = 1; - } - - if (cl == NULL) { - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - cl->buf = buf; - cl->next = NULL; - ll = &cl->next; - - } else { - /* append a space first */ - *ll = ngx_alloc_chain_link(r->pool); - - if (*ll == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - space_buf = ngx_calloc_buf(r->pool); - - if (space_buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* nginx clears buf flags at the end of each request handling, - * so we have to make a clone here. */ - *space_buf = ngx_http_echo_space_buf; - - (*ll)->buf = space_buf; - (*ll)->next = NULL; - - ll = &(*ll)->next; - - /* then append the buf only if it's non-empty */ - if (buf) { - *ll = ngx_alloc_chain_link(r->pool); - if (*ll == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - (*ll)->buf = buf; - (*ll)->next = NULL; - - ll = &(*ll)->next; - } - } - } /* end for */ - - if (cl && cl->buf == NULL) { - cl = cl->next; - } - - if (opts && opts->nelts > 0) { - opt = opts->elts; - /* FIXME handle other unrecognized options here */ - if (opt[0].len == 1 && opt[0].data[0] == 'n') { - goto done; - } - } - - /* append the newline character */ - - newline_buf = ngx_calloc_buf(r->pool); - - if (newline_buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - *newline_buf = ngx_http_echo_newline_buf; - - if (cl == NULL) { - cl = ngx_alloc_chain_link(r->pool); - - if (cl == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - cl->buf = newline_buf; - cl->next = NULL; - /* ll = &cl->next; */ - - } else { - *ll = ngx_alloc_chain_link(r->pool); - - if (*ll == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - (*ll)->buf = newline_buf; - (*ll)->next = NULL; - /* ll = &(*ll)->next; */ - } - -done: - - if (cl == NULL || cl->buf == NULL) { - return NGX_OK; - } - - if (in_filter) { - return ngx_http_echo_next_body_filter(r, cl); - } - - return ngx_http_echo_send_chain_link(r, ctx, cl); -} - - -ngx_int_t -ngx_http_echo_exec_echo_flush(ngx_http_request_t *r, ngx_http_echo_ctx_t *ctx) -{ - return ngx_http_send_special(r, NGX_HTTP_FLUSH); -} - - -ngx_int_t -ngx_http_echo_exec_echo_request_body(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - ngx_buf_t *b; - ngx_chain_t *out, *cl, **ll; - - if (r->request_body == NULL || r->request_body->bufs == NULL) { - return NGX_OK; - } - - out = NULL; - ll = &out; - - for (cl = r->request_body->bufs; cl; cl = cl->next) { - if (ngx_buf_special(cl->buf)) { - /* we do not want to create zero-size bufs */ - continue; - } - - *ll = ngx_alloc_chain_link(r->pool); - if (*ll == NULL) { - return NGX_ERROR; - } - - b = ngx_alloc_buf(r->pool); - if (b == NULL) { - return NGX_ERROR; - } - - (*ll)->buf = b; - (*ll)->next = NULL; - - ngx_memcpy(b, cl->buf, sizeof(ngx_buf_t)); - b->tag = (ngx_buf_tag_t) &ngx_http_echo_exec_echo_request_body; - b->last_buf = 0; - b->last_in_chain = 0; - - ll = &(*ll)->next; - } - - if (out == NULL) { - return NGX_OK; - } - - return ngx_http_echo_send_chain_link(r, ctx, out); -} - - -ngx_int_t -ngx_http_echo_exec_echo_duplicate(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_str_t *computed_arg; - ngx_str_t *computed_arg_elts; - ssize_t i, count; - ngx_str_t *str; - u_char *p; - ngx_int_t rc; - ngx_buf_t *buf; - ngx_chain_t *cl; - - dd_enter(); - - computed_arg_elts = computed_args->elts; - - computed_arg = &computed_arg_elts[0]; - - count = ngx_http_echo_atosz(computed_arg->data, computed_arg->len); - - if (count == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "invalid size specified: \"%V\"", computed_arg); - - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - str = &computed_arg_elts[1]; - - if (count == 0 || str->len == 0) { - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - return NGX_OK; - } - - buf = ngx_create_temp_buf(r->pool, count * str->len); - if (buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - p = buf->pos; - for (i = 0; i < count; i++) { - p = ngx_copy(p, str->data, str->len); - } - buf->last = p; - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - cl->next = NULL; - cl->buf = buf; - - return ngx_http_echo_send_chain_link(r, ctx, cl); -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.h deleted file mode 100644 index 896f1ed..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef ECHO_ECHO_H -#define ECHO_ECHO_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_echo_init(ngx_conf_t *cf); - -ngx_int_t ngx_http_echo_exec_echo_sync(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_exec_echo(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args, - ngx_flag_t in_filter, ngx_array_t *opts); - -ngx_int_t ngx_http_echo_exec_echo_request_body(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_exec_echo_flush(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_exec_echo_duplicate(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -#endif /* ECHO_ECHO_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.c deleted file mode 100644 index 689b52e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.c +++ /dev/null @@ -1,282 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_filter.h" -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_echo.h" - -#include - - - -ngx_http_output_header_filter_pt ngx_http_echo_next_header_filter; - -ngx_http_output_body_filter_pt ngx_http_echo_next_body_filter; - -static ngx_int_t ngx_http_echo_header_filter(ngx_http_request_t *r); - -static ngx_int_t ngx_http_echo_body_filter(ngx_http_request_t *r, - ngx_chain_t *in); - -/* filter handlers */ -static ngx_int_t ngx_http_echo_exec_filter_cmds(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *cmds, ngx_uint_t *iterator); - - -static volatile ngx_cycle_t *ngx_http_echo_prev_cycle = NULL; - - -ngx_int_t -ngx_http_echo_filter_init(ngx_conf_t *cf) -{ - int multi_http_blocks; - ngx_http_echo_main_conf_t *emcf; - - emcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_echo_module); - - if (ngx_http_echo_prev_cycle != ngx_cycle) { - ngx_http_echo_prev_cycle = ngx_cycle; - multi_http_blocks = 0; - - } else { - multi_http_blocks = 1; - } - - if (multi_http_blocks || emcf->requires_filter) { - dd("top header filter: %ld", - (unsigned long) ngx_http_top_header_filter); - - ngx_http_echo_next_header_filter = ngx_http_top_header_filter; - ngx_http_top_header_filter = ngx_http_echo_header_filter; - - dd("top body filter: %ld", (unsigned long) ngx_http_top_body_filter); - - ngx_http_echo_next_body_filter = ngx_http_top_body_filter; - ngx_http_top_body_filter = ngx_http_echo_body_filter; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_echo_header_filter(ngx_http_request_t *r) -{ - ngx_http_echo_loc_conf_t *conf; - ngx_http_echo_ctx_t *ctx; - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo header filter, uri \"%V?%V\"", &r->uri, &r->args); - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - /* XXX we should add option to insert contents for responses - * of non-200 status code here... */ - /* - if (r->headers_out.status != NGX_HTTP_OK) { - if (ctx != NULL) { - ctx->skip_filter = 1; - } - return ngx_http_echo_next_header_filter(r); - } - */ - - conf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - if (conf->before_body_cmds == NULL && conf->after_body_cmds == NULL) { - if (ctx != NULL) { - ctx->skip_filter = 1; - } - return ngx_http_echo_next_header_filter(r); - } - - if (ctx == NULL) { - ctx = ngx_http_echo_create_ctx(r); - if (ctx == NULL) { - return NGX_ERROR; - } - - ngx_http_set_ctx(r, ctx, ngx_http_echo_module); - } - - /* enable streaming here (use chunked encoding) */ - ngx_http_clear_content_length(r); - ngx_http_clear_accept_ranges(r); - - return ngx_http_echo_next_header_filter(r); -} - - -static ngx_int_t -ngx_http_echo_body_filter(ngx_http_request_t *r, ngx_chain_t *in) -{ - ngx_http_echo_ctx_t *ctx; - ngx_int_t rc; - ngx_http_echo_loc_conf_t *conf; - unsigned last; - ngx_chain_t *cl; - ngx_buf_t *b; - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo body filter, uri \"%V?%V\"", &r->uri, &r->args); - - if (in == NULL || r->header_only) { - return ngx_http_echo_next_body_filter(r, in); - } - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (ctx == NULL || ctx->skip_filter) { - return ngx_http_echo_next_body_filter(r, in); - } - - conf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - - if (!ctx->before_body_sent) { - ctx->before_body_sent = 1; - - if (conf->before_body_cmds != NULL) { - rc = ngx_http_echo_exec_filter_cmds(r, ctx, conf->before_body_cmds, - &ctx->next_before_body_cmd); - if (rc != NGX_OK) { - return NGX_ERROR; - } - } - } - - if (conf->after_body_cmds == NULL) { - ctx->skip_filter = 1; - return ngx_http_echo_next_body_filter(r, in); - } - - last = 0; - - for (cl = in; cl; cl = cl->next) { - dd("cl %p, special %d", cl, ngx_buf_special(cl->buf)); - - if (cl->buf->last_buf || cl->buf->last_in_chain) { - cl->buf->last_buf = 0; - cl->buf->last_in_chain = 0; - cl->buf->sync = 1; - last = 1; - } - } - - dd("in %p, last %d", in, (int) last); - - if (in) { - rc = ngx_http_echo_next_body_filter(r, in); - -#if 0 - if (rc == NGX_AGAIN) { - return NGX_ERROR; - } -#endif - - dd("next filter returns %d, last %d", (int) rc, (int) last); - - if (rc == NGX_ERROR || rc > NGX_OK || !last) { - return rc; - } - } - - dd("exec filter cmds for after body cmds"); - - rc = ngx_http_echo_exec_filter_cmds(r, ctx, conf->after_body_cmds, - &ctx->next_after_body_cmd); - if (rc == NGX_ERROR || rc > NGX_OK) { - dd("FAILED: exec filter cmds for after body cmds"); - return NGX_ERROR; - } - - ctx->skip_filter = 1; - - dd("after body cmds executed...terminating..."); - - /* XXX we can NOT use - * ngx_http_send_special(r, NGX_HTTP_LAST) here - * because we should bypass the upstream filters. */ - - b = ngx_calloc_buf(r->pool); - if (b == NULL) { - return NGX_ERROR; - } - - if (r == r->main && !r->post_action) { - b->last_buf = 1; - - } else { - b->sync = 1; - b->last_in_chain = 1; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->next = NULL; - cl->buf = b; - - return ngx_http_echo_next_body_filter(r, cl); -} - - -static ngx_int_t -ngx_http_echo_exec_filter_cmds(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *cmds, ngx_uint_t *iterator) -{ - ngx_int_t rc; - ngx_array_t *opts = NULL; - ngx_array_t *computed_args = NULL; - ngx_http_echo_cmd_t *cmd; - ngx_http_echo_cmd_t *cmd_elts; - - for (cmd_elts = cmds->elts; *iterator < cmds->nelts; (*iterator)++) { - cmd = &cmd_elts[*iterator]; - - /* evaluate arguments for the current cmd (if any) */ - if (cmd->args) { - computed_args = ngx_array_create(r->pool, cmd->args->nelts, - sizeof(ngx_str_t)); - if (computed_args == NULL) { - return NGX_ERROR; - } - - opts = ngx_array_create(r->pool, 1, sizeof(ngx_str_t)); - if (opts == NULL) { - return NGX_ERROR; - } - - rc = ngx_http_echo_eval_cmd_args(r, cmd, computed_args, opts); - - if (rc != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "Failed to evaluate arguments for " - "the directive."); - return rc; - } - } - - /* do command dispatch based on the opcode */ - switch (cmd->opcode) { - case echo_opcode_echo_before_body: - case echo_opcode_echo_after_body: - dd("exec echo_before_body or echo_after_body..."); - - rc = ngx_http_echo_exec_echo(r, ctx, computed_args, - 1 /* in filter */, opts); - - if (rc == NGX_ERROR || rc > NGX_OK) { - return rc; - } - - break; - default: - break; - } - } - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.h deleted file mode 100644 index ea5115d..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef ECHO_FILTER_H -#define ECHO_FILTER_H - -#include "ngx_http_echo_module.h" - - -extern ngx_http_output_header_filter_pt ngx_http_echo_next_header_filter; - -extern ngx_http_output_body_filter_pt ngx_http_echo_next_body_filter; - - -ngx_int_t ngx_http_echo_filter_init (ngx_conf_t *cf); - -#endif /* ECHO_FILTER_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.c deleted file mode 100644 index a4a2b54..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.c +++ /dev/null @@ -1,183 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_foreach.h" -#include "ngx_http_echo_util.h" - -#include - - -ngx_int_t -ngx_http_echo_it_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - ngx_http_echo_ctx_t *ctx; - ngx_uint_t i; - ngx_array_t *choices; - ngx_str_t *choice_elts, *choice; - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (ctx && ctx->foreach != NULL) { - - choices = ctx->foreach->choices; - i = ctx->foreach->next_choice; - - if (i < choices->nelts) { - choice_elts = choices->elts; - choice = &choice_elts[i]; - - v->len = choice->len; - v->data = choice->data; - v->valid = 1; - v->no_cacheable = 1; - v->not_found = 0; - - return NGX_OK; - } - } - - v->not_found = 1; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_foreach_split(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_http_echo_loc_conf_t *elcf; - ngx_str_t *delimiter, *compound; - u_char *pos, *last, *end; - ngx_str_t *choice; - ngx_str_t *computed_arg_elts; - ngx_array_t *cmds; - ngx_http_echo_cmd_t *cmd; - ngx_http_echo_cmd_t *cmd_elts; - - if (ctx->foreach != NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "Nested echo_foreach not supported yet."); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (computed_args->nelts < 2) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "echo_foreach should take at least two arguments. " - "(if your delimiter starts with \"-\", preceding it " - "with a \"--\".)"); - - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - computed_arg_elts = computed_args->elts; - - compound = &computed_arg_elts[1]; - - dd("HEY coumpound len: %u", (int) compound->len); - - ctx->foreach = ngx_palloc(r->pool, sizeof(ngx_http_echo_foreach_ctx_t)); - - if (ctx->foreach == NULL) { - return NGX_ERROR; - } - - ctx->foreach->cmd_index = ctx->next_handler_cmd; - - ctx->foreach->next_choice = 0; - - ctx->foreach->choices = ngx_array_create(r->pool, 10, sizeof(ngx_str_t)); - if (ctx->foreach->choices == NULL) { - return NGX_ERROR; - } - - delimiter = &computed_arg_elts[0]; - - pos = compound->data; - end = compound->data + compound->len; - - while ((last = ngx_http_echo_strlstrn(pos, end, delimiter->data, - delimiter->len - 1)) != NULL) - { - dd("entered the loop"); - - if (last == pos) { - dd("!!! len == 0"); - pos = last + delimiter->len; - continue; - } - - choice = ngx_array_push(ctx->foreach->choices); - if (choice == NULL) { - return NGX_ERROR; - } - - choice->data = pos; - choice->len = last - pos; - pos = last + delimiter->len; - } - - if (pos < end) { - choice = ngx_array_push(ctx->foreach->choices); - if (choice == NULL) { - return NGX_ERROR; - } - - choice->data = pos; - choice->len = end - pos; - } - - if (ctx->foreach->choices->nelts == 0) { - /* skip the foreach body entirely */ - elcf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - cmds = elcf->handler_cmds; - cmd_elts = cmds->elts; - for (/* void */; ctx->next_handler_cmd < cmds->nelts; - ctx->next_handler_cmd++) - { - cmd = &cmd_elts[ctx->next_handler_cmd + 1]; - if (cmd->opcode == echo_opcode_echo_end) { - return NGX_OK; - } - } - - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_end(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - if (ctx->foreach == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "Found a echo_end that has no corresponding echo_foreach " - "before it."); - return NGX_ERROR; - } - - ctx->foreach->next_choice++; - - if (ctx->foreach->next_choice >= ctx->foreach->choices->nelts) { - /* TODO We need to explicitly free the foreach ctx from - * the pool */ - ctx->foreach = NULL; - - return NGX_OK; - } - - dd("echo_end: ++ next_choice (total: %u): %u", - (unsigned) ctx->foreach->choices->nelts, - (unsigned) ctx->foreach->next_choice); - - /* the main handler dispatcher loop will increment - * ctx->next_handler_cmd for us anyway. */ - ctx->next_handler_cmd = ctx->foreach->cmd_index; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.h deleted file mode 100644 index 49592f4..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ECHO_FOREACH_H -#define ECHO_FOREACH_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_exec_echo_foreach_split(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_echo_end(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_it_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -#endif /* ECHO_FOREACH_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.c deleted file mode 100644 index 120c8b0..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.c +++ /dev/null @@ -1,433 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_filter.h" -#include "ngx_http_echo_handler.h" -#include "ngx_http_echo_echo.h" -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_sleep.h" -#include "ngx_http_echo_var.h" -#include "ngx_http_echo_timer.h" -#include "ngx_http_echo_location.h" -#include "ngx_http_echo_subrequest.h" -#include "ngx_http_echo_request_info.h" -#include "ngx_http_echo_foreach.h" - -#include -#include - - -void -ngx_http_echo_wev_handler(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_http_echo_ctx_t *ctx; - - dd("wev handler"); - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (ctx == NULL) { - ngx_http_finalize_request(r, NGX_ERROR); - return; - } - - dd("waiting: %d, done: %d", (int) ctx->waiting, (int) ctx->done); - - if (ctx->waiting && ! ctx->done) { - - if (r == r->connection->data && r->postponed) { - - if (r->postponed->request) { - r->connection->data = r->postponed->request; - -#if defined(nginx_version) && nginx_version >= 8012 - ngx_http_post_request(r->postponed->request, NULL); -#else - ngx_http_post_request(r->postponed->request); -#endif - - } else { - ngx_http_echo_flush_postponed_outputs(r); - } - } - - return; - } - - ctx->done = 0; - - ctx->next_handler_cmd++; - - rc = ngx_http_echo_run_cmds(r); - - dd("rc: %d", (int) rc); - - if (rc == NGX_ERROR || rc == NGX_DONE) { - ngx_http_finalize_request(r, rc); - return; - } - - if (rc == NGX_AGAIN) { - dd("mark busy %d for %.*s", (int) ctx->next_handler_cmd, - (int) r->uri.len, - r->uri.data); - - ctx->waiting = 1; - ctx->done = 0; - - } else { - dd("mark ready %d", (int) ctx->next_handler_cmd); - ctx->waiting = 0; - ctx->done = 1; - - dd("finalizing with rc %d", (int) rc); - - dd("finalize request %.*s with %d", (int) r->uri.len, r->uri.data, - (int) rc); - - ngx_http_finalize_request(r, rc); - } -} - - -ngx_int_t -ngx_http_echo_handler(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_http_echo_ctx_t *ctx; - - dd("subrequest in memory: %d", (int) r->subrequest_in_memory); - - rc = ngx_http_echo_run_cmds(r); - - dd("run cmds returned %d", (int) rc); - - if (rc == NGX_ERROR - || rc == NGX_OK - || rc == NGX_DONE - || rc == NGX_DECLINED) - { - return rc; - } - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { - if (ctx && r->header_sent) { - return NGX_ERROR; - } - - return rc; - } - - /* rc == NGX_AGAIN */ - -#if defined(nginx_version) && nginx_version >= 8011 - r->main->count++; -#endif - - dd("%d", r->connection->destroyed); - dd("%d", r->done); - - if (ctx) { - dd("mark busy %d for %.*s", (int) ctx->next_handler_cmd, - (int) r->uri.len, - r->uri.data); - - ctx->waiting = 1; - ctx->done = 0; - } - - return NGX_DONE; -} - - -ngx_int_t -ngx_http_echo_run_cmds(ngx_http_request_t *r) -{ - ngx_http_echo_loc_conf_t *elcf; - ngx_http_echo_ctx_t *ctx; - ngx_int_t rc; - ngx_array_t *cmds; - ngx_array_t *computed_args = NULL; - ngx_http_echo_cmd_t *cmd; - ngx_http_echo_cmd_t *cmd_elts; - ngx_array_t *opts = NULL; - - elcf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - cmds = elcf->handler_cmds; - if (cmds == NULL) { - return NGX_DECLINED; - } - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - if (ctx == NULL) { - ctx = ngx_http_echo_create_ctx(r); - if (ctx == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ngx_http_set_ctx(r, ctx, ngx_http_echo_module); - } - - dd("exec handler: %.*s: %i", (int) r->uri.len, r->uri.data, - (int) ctx->next_handler_cmd); - - cmd_elts = cmds->elts; - - for (; ctx->next_handler_cmd < cmds->nelts; ctx->next_handler_cmd++) { - - cmd = &cmd_elts[ctx->next_handler_cmd]; - - /* evaluate arguments for the current cmd (if any) */ - if (cmd->args) { - computed_args = ngx_array_create(r->pool, cmd->args->nelts, - sizeof(ngx_str_t)); - - if (computed_args == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - opts = ngx_array_create(r->pool, 1, sizeof(ngx_str_t)); - - if (opts == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - rc = ngx_http_echo_eval_cmd_args(r, cmd, computed_args, opts); - if (rc != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "Failed to evaluate arguments for " - "the directive."); - return rc; - } - } - - if (computed_args == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* do command dispatch based on the opcode */ - - switch (cmd->opcode) { - - case echo_opcode_echo_sync: - rc = ngx_http_echo_exec_echo_sync(r, ctx); - break; - - case echo_opcode_echo: - /* XXX moved the following code to a separate - * function */ - dd("found echo opcode"); - rc = ngx_http_echo_exec_echo(r, ctx, computed_args, - 0 /* in filter */, opts); - break; - - case echo_opcode_echo_request_body: - rc = ngx_http_echo_exec_echo_request_body(r, ctx); - break; - - case echo_opcode_echo_location_async: - if (!r->request_body) { - /* we require reading the request body before doing - * subrequests */ - - ctx->next_handler_cmd--; /* re-run the current cmd */ - goto read_request_body; - } - - dd("found opcode echo location async..."); - rc = ngx_http_echo_exec_echo_location_async(r, ctx, - computed_args); - break; - - case echo_opcode_echo_location: - if (!r->request_body) { - /* we require reading the request body before doing - * subrequests */ - - ctx->next_handler_cmd--; /* re-run the current cmd */ - goto read_request_body; - } - - return ngx_http_echo_exec_echo_location(r, ctx, computed_args); - - case echo_opcode_echo_subrequest_async: - if (!r->request_body) { - /* we require reading the request body before doing - * subrequests */ - - ctx->next_handler_cmd--; /* re-run the current cmd */ - goto read_request_body; - } - - dd("found opcode echo subrequest async..."); - rc = ngx_http_echo_exec_echo_subrequest_async(r, ctx, - computed_args); - break; - - case echo_opcode_echo_subrequest: - if (!r->request_body) { - /* we require reading the request body before doing - * subrequests */ - - ctx->next_handler_cmd--; /* re-run the current cmd */ - goto read_request_body; - } - - return ngx_http_echo_exec_echo_subrequest(r, ctx, computed_args); - - case echo_opcode_echo_sleep: - return ngx_http_echo_exec_echo_sleep(r, ctx, computed_args); - - case echo_opcode_echo_flush: - rc = ngx_http_echo_exec_echo_flush(r, ctx); - break; - - case echo_opcode_echo_blocking_sleep: - rc = ngx_http_echo_exec_echo_blocking_sleep(r, ctx, - computed_args); - break; - - case echo_opcode_echo_reset_timer: - rc = ngx_http_echo_exec_echo_reset_timer(r, ctx); - break; - - case echo_opcode_echo_duplicate: - rc = ngx_http_echo_exec_echo_duplicate(r, ctx, computed_args); - break; - - case echo_opcode_echo_read_request_body: - -read_request_body: - - ctx->wait_read_request_body = 0; - - rc = ngx_http_echo_exec_echo_read_request_body(r, ctx); - - if (rc == NGX_ERROR) { - return NGX_ERROR; - } - - if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { -#if (nginx_version >= 8011 && nginx_version < 1002006) \ - || (nginx_version >= 1003000 && nginx_version < 1003009) - r->main->count--; -#endif - return rc; - } - -#if nginx_version >= 8011 - r->main->count--; -#endif - dd("read request body: %d", (int) rc); - - if (rc == NGX_OK) { - continue; - } - - /* rc == NGX_AGAIN */ - ctx->wait_read_request_body = 1; - return NGX_AGAIN; - - case echo_opcode_echo_foreach_split: - rc = ngx_http_echo_exec_echo_foreach_split(r, ctx, computed_args); - break; - - case echo_opcode_echo_end: - rc = ngx_http_echo_exec_echo_end(r, ctx); - break; - - case echo_opcode_echo_exec: - dd("echo_exec"); - return ngx_http_echo_exec_exec(r, ctx, computed_args); - - default: - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unknown opcode: %d", cmd->opcode); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE) { - return rc; - } - } - - rc = ngx_http_echo_send_chain_link(r, ctx, NULL /* indicate LAST */); - - if (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE) { - return rc; - } - - if (!r->request_body) { - if (ngx_http_discard_request_body(r) != NGX_OK) { - return NGX_ERROR; - } - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_post_subrequest(ngx_http_request_t *r, - void *data, ngx_int_t rc) -{ - ngx_http_echo_ctx_t *ctx = data; - ngx_http_request_t *pr; - ngx_http_echo_ctx_t *pr_ctx; - - dd("echo post_subrequest: %.*s", (int) r->uri.len, r->uri.data); - - if (ctx->run_post_subrequest) { - dd("already run post_subrequest: %p: %.*s", ctx, - (int) r->uri.len, r->uri.data); - - return rc; - } - - dd("setting run_post_subrequest to 1 for %p for %.*s", ctx, - (int) r->uri.len, r->uri.data); - - ctx->run_post_subrequest = 1; - - pr = r->parent; - - pr_ctx = ngx_http_get_module_ctx(pr, ngx_http_echo_module); - if (pr_ctx == NULL) { - return NGX_ERROR; - } - - dd("mark ready %d", (int) pr_ctx->next_handler_cmd); - - pr_ctx->waiting = 0; - pr_ctx->done = 1; - - pr->write_event_handler = ngx_http_echo_wev_handler; - - /* work-around issues in nginx's event module */ - - if (r != r->connection->data - && r->postponed - && (r->main->posted_requests == NULL - || r->main->posted_requests->request != pr)) - { -#if defined(nginx_version) && nginx_version >= 8012 - ngx_http_post_request(pr, NULL); -#else - ngx_http_post_request(pr); -#endif - } - - return rc; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.h deleted file mode 100644 index afc0666..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ECHO_HANDLER_H -#define ECHO_HANDLER_H - -#include "ngx_http_echo_module.h" - - -void ngx_http_echo_wev_handler(ngx_http_request_t *r); - -ngx_int_t ngx_http_echo_handler(ngx_http_request_t *r); - -ngx_int_t ngx_http_echo_run_cmds(ngx_http_request_t *r); - -ngx_int_t ngx_http_echo_post_subrequest(ngx_http_request_t *r, - void *data, ngx_int_t rc); - - -#endif /* ECHO_HANDLER_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.c deleted file mode 100644 index 820e504..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.c +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_location.h" -#include "ngx_http_echo_handler.h" - -#include - - -static ngx_int_t ngx_http_echo_adjust_subrequest(ngx_http_request_t *sr); - - -ngx_int_t -ngx_http_echo_exec_echo_location_async(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_int_t rc; - ngx_http_request_t *sr; /* subrequest object */ - ngx_str_t *computed_arg_elts; - ngx_str_t location; - ngx_str_t *url_args; - ngx_str_t args; - ngx_uint_t flags = 0; - - dd_enter(); - - computed_arg_elts = computed_args->elts; - - location = computed_arg_elts[0]; - - if (location.len == 0) { - return NGX_ERROR; - } - - if (computed_args->nelts > 1) { - url_args = &computed_arg_elts[1]; - } else { - url_args = NULL; - } - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, &location, &args, &flags) != NGX_OK) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_location_async sees unsafe uri: \"%V\"", - &location); - return NGX_ERROR; - } - - if (args.len > 0 && url_args == NULL) { - url_args = &args; - } - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - rc = ngx_http_subrequest(r, &location, url_args, &sr, NULL, 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - rc = ngx_http_echo_adjust_subrequest(sr); - if (rc != NGX_OK) { - return NGX_ERROR; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_location(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_int_t rc; - ngx_http_request_t *sr; /* subrequest object */ - ngx_str_t *computed_arg_elts; - ngx_str_t location; - ngx_str_t *url_args; - ngx_http_post_subrequest_t *psr; - ngx_str_t args; - ngx_uint_t flags = 0; - ngx_http_echo_ctx_t *sr_ctx; - - if (computed_args == NULL) { - return NGX_ERROR; - } - - computed_arg_elts = computed_args->elts; - - location = computed_arg_elts[0]; - - if (location.len == 0) { - return NGX_ERROR; - } - - if (computed_args->nelts > 1) { - url_args = &computed_arg_elts[1]; - - } else { - url_args = NULL; - } - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, &location, &args, &flags) != NGX_OK) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_location sees unsafe uri: \"%V\"", - &location); - return NGX_ERROR; - } - - if (args.len > 0 && url_args == NULL) { - url_args = &args; - } - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - sr_ctx = ngx_http_echo_create_ctx(r); - - psr = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t)); - if (psr == NULL) { - return NGX_ERROR; - } - - psr->handler = ngx_http_echo_post_subrequest; - psr->data = sr_ctx; - - rc = ngx_http_subrequest(r, &location, url_args, &sr, psr, 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - rc = ngx_http_echo_adjust_subrequest(sr); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - return NGX_AGAIN; -} - - -static ngx_int_t -ngx_http_echo_adjust_subrequest(ngx_http_request_t *sr) -{ - ngx_http_core_main_conf_t *cmcf; - ngx_http_request_t *r; - - /* we do not inherit the parent request's variables */ - cmcf = ngx_http_get_module_main_conf(sr, ngx_http_core_module); - - r = sr->parent; - - sr->header_in = r->header_in; - - /* XXX work-around a bug in ngx_http_subrequest */ - if (r->headers_in.headers.last == &r->headers_in.headers.part) { - sr->headers_in.headers.last = &sr->headers_in.headers.part; - } - - sr->variables = ngx_pcalloc(sr->pool, cmcf->variables.nelts - * sizeof(ngx_http_variable_value_t)); - - if (sr->variables == NULL) { - return NGX_ERROR; - } - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.h deleted file mode 100644 index 6bc0e03..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef ECHO_LOCATION_H -#define ECHO_LOCATION_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_exec_echo_location_async(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_echo_location(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -#endif /* ECHO_LOCATION_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.c deleted file mode 100644 index 8d736d7..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.c +++ /dev/null @@ -1,682 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_handler.h" -#include "ngx_http_echo_filter.h" -#include "ngx_http_echo_echo.h" -#include "ngx_http_echo_request_info.h" -#include "ngx_http_echo_var.h" -#include "ngx_http_echo_util.h" - - -#include -#include -#include - - -/* config init handler */ -static void *ngx_http_echo_create_loc_conf(ngx_conf_t *cf); -static char *ngx_http_echo_merge_loc_conf(ngx_conf_t *cf, void *parent, - void *child); -static void *ngx_http_echo_create_main_conf(ngx_conf_t *cf); -static ngx_int_t ngx_http_echo_post_config(ngx_conf_t *cf); - -/* config directive handlers */ -static char *ngx_http_echo_echo(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_echo_echo_request_body(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_sleep(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_echo_echo_flush(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_echo_echo_blocking_sleep(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_reset_timer(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_before_body(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_after_body(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_location_async(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_location(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_subrequest_async(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_subrequest(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_duplicate(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_read_request_body(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_foreach_split(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_end(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_abort_parent(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_exec(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_helper(ngx_http_echo_opcode_t opcode, - ngx_http_echo_cmd_category_t cat, - ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - - -static ngx_http_module_t ngx_http_echo_module_ctx = { - NULL, /* preconfiguration */ - ngx_http_echo_post_config, /* postconfiguration */ - - ngx_http_echo_create_main_conf, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_echo_create_loc_conf, /* create location configuration */ - ngx_http_echo_merge_loc_conf /* merge location configuration */ -}; - - -static ngx_command_t ngx_http_echo_commands[] = { - - { ngx_string("echo"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_ANY, - ngx_http_echo_echo, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_request_body"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_request_body, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_sleep"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_echo_echo_sleep, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_flush"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_flush, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_blocking_sleep"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_echo_echo_blocking_sleep, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_reset_timer"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_reset_timer, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_before_body"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_ANY, - ngx_http_echo_echo_before_body, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, before_body_cmds), - NULL }, - - { ngx_string("echo_after_body"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_ANY, - ngx_http_echo_echo_after_body, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, after_body_cmds), - NULL }, - - { ngx_string("echo_location_async"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ngx_http_echo_echo_location_async, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_location"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ngx_http_echo_echo_location, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_subrequest_async"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_2MORE, - ngx_http_echo_echo_subrequest_async, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_subrequest"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_2MORE, - ngx_http_echo_echo_subrequest, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_duplicate"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_2MORE, - ngx_http_echo_echo_duplicate, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_read_request_body"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_read_request_body, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_foreach_split"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_2MORE, - ngx_http_echo_echo_foreach_split, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_end"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_end, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_abort_parent"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_abort_parent, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_exec"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ngx_http_echo_echo_exec, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_status"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_conf_set_num_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, status), - NULL }, - - ngx_null_command -}; - - -ngx_module_t ngx_http_echo_module = { - NGX_MODULE_V1, - &ngx_http_echo_module_ctx, /* module context */ - ngx_http_echo_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static void * -ngx_http_echo_create_loc_conf(ngx_conf_t *cf) -{ - ngx_http_echo_loc_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_echo_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* set by ngx_pcalloc - * conf->handler_cmds = NULL - * conf->before_body_cmds = NULL - * conf->after_body_cmds = NULL - * conf->seen_leading_output = 0 - * conf->seen_trailing_output = 0 - */ - - conf->status = NGX_CONF_UNSET; - - return conf; -} - - -static char * -ngx_http_echo_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) -{ - ngx_http_echo_loc_conf_t *prev = parent; - ngx_http_echo_loc_conf_t *conf = child; - - if (conf->handler_cmds == NULL) { - conf->handler_cmds = prev->handler_cmds; - conf->seen_leading_output = prev->seen_leading_output; - } - - if (conf->before_body_cmds == NULL) { - conf->before_body_cmds = prev->before_body_cmds; - } - - if (conf->after_body_cmds == NULL) { - conf->after_body_cmds = prev->after_body_cmds; - } - - ngx_conf_merge_value(conf->status, prev->status, 200); - - return NGX_CONF_OK; -} - - -static char * -ngx_http_echo_helper(ngx_http_echo_opcode_t opcode, - ngx_http_echo_cmd_category_t cat, - ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *raw_args; - ngx_uint_t i, n; - ngx_array_t **args_ptr; - ngx_array_t **cmds_ptr; - ngx_http_echo_cmd_t *echo_cmd; - ngx_http_core_loc_conf_t *clcf; - ngx_http_script_compile_t sc; - ngx_http_echo_main_conf_t *emcf; - ngx_http_echo_arg_template_t *arg; - - emcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_echo_module); - - /* cmds_ptr points to ngx_http_echo_loc_conf_t's - * handler_cmds, before_body_cmds, or after_body_cmds - * array, depending on the actual offset */ - cmds_ptr = (ngx_array_t **) (((u_char *) conf) + cmd->offset); - - if (*cmds_ptr == NULL) { - *cmds_ptr = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_echo_cmd_t)); - - if (*cmds_ptr == NULL) { - return NGX_CONF_ERROR; - } - - if (cat == echo_handler_cmd) { - dd("registering the content handler"); - /* register the content handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, - ngx_http_core_module); - - dd("registering the content handler (2)"); - clcf->handler = ngx_http_echo_handler; - - } else { - dd("filter used = 1"); - emcf->requires_filter = 1; - } - } - - echo_cmd = ngx_array_push(*cmds_ptr); - - if (echo_cmd == NULL) { - return NGX_CONF_ERROR; - } - - echo_cmd->opcode = opcode; - - args_ptr = &echo_cmd->args; - *args_ptr = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_echo_arg_template_t)); - - if (*args_ptr == NULL) { - return NGX_CONF_ERROR; - } - - raw_args = cf->args->elts; - - /* we skip the first arg and start from the second */ - - for (i = 1 ; i < cf->args->nelts; i++) { - arg = ngx_array_push(*args_ptr); - - if (arg == NULL) { - return NGX_CONF_ERROR; - } - - arg->raw_value = raw_args[i]; - - dd("found raw arg %s", raw_args[i].data); - - arg->lengths = NULL; - arg->values = NULL; - - n = ngx_http_script_variables_count(&arg->raw_value); - - if (n > 0) { - ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); - - sc.cf = cf; - sc.source = &arg->raw_value; - sc.lengths = &arg->lengths; - sc.values = &arg->values; - sc.variables = n; - sc.complete_lengths = 1; - sc.complete_values = 1; - - if (ngx_http_script_compile(&sc) != NGX_OK) { - return NGX_CONF_ERROR; - } - } - } /* end for */ - - return NGX_CONF_OK; -} - - -static char * -ngx_http_echo_echo(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - } - - dd("in echo_echo..."); - return ngx_http_echo_helper(echo_opcode_echo, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_request_body(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - } - - dd("in echo_echo_request_body..."); - return ngx_http_echo_helper(echo_opcode_echo_request_body, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_sleep(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - dd("in echo_sleep..."); - return ngx_http_echo_helper(echo_opcode_echo_sleep, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_flush(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - } - - dd("in echo_flush..."); - return ngx_http_echo_helper(echo_opcode_echo_flush, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_blocking_sleep(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - dd("in echo_blocking_sleep..."); - return ngx_http_echo_helper(echo_opcode_echo_blocking_sleep, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_reset_timer(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_reset_timer, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_before_body(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - dd("processing echo_before_body directive..."); - return ngx_http_echo_helper(echo_opcode_echo_before_body, echo_filter_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_after_body(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_after_body, echo_filter_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_location_async(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - char *ret; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - - ret = ngx_http_echo_helper(echo_opcode_echo_sync, echo_handler_cmd, - cf, cmd, conf); - - if (ret != NGX_CONF_OK) { - return ret; - } - } - - return ngx_http_echo_helper(echo_opcode_echo_location_async, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_location(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - char *ret; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - - ret = ngx_http_echo_helper(echo_opcode_echo_sync, echo_handler_cmd, - cf, cmd, conf); - - if (ret != NGX_CONF_OK) { - return ret; - } - } - - return ngx_http_echo_helper(echo_opcode_echo_location, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_subrequest_async(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - char *ret; - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - - ret = ngx_http_echo_helper(echo_opcode_echo_sync, echo_handler_cmd, - cf, cmd, conf); - - if (ret != NGX_CONF_OK) { - return ret; - } - } - - return ngx_http_echo_helper(echo_opcode_echo_subrequest_async, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_subrequest(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - char *ret; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - - ret = ngx_http_echo_helper(echo_opcode_echo_sync, echo_handler_cmd, - cf, cmd, conf); - - if (ret != NGX_CONF_OK) { - return ret; - } - } - - return ngx_http_echo_helper(echo_opcode_echo_subrequest, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_duplicate(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - } - - return ngx_http_echo_helper(echo_opcode_echo_duplicate, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_read_request_body(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_read_request_body, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_foreach_split(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_foreach_split, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_end(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_end, echo_handler_cmd, cf, - cmd, conf); -} - - -static char * -ngx_http_echo_echo_abort_parent(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_abort_parent, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_exec(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_exec, echo_handler_cmd, - cf, cmd, conf); -} - - -static void * -ngx_http_echo_create_main_conf(ngx_conf_t *cf) -{ -#if nginx_version >= 1011011 - ngx_pool_cleanup_t *cln; -#endif - ngx_http_echo_main_conf_t *emcf; - - emcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_echo_main_conf_t)); - if (emcf == NULL) { - return NULL; - } - - /* set by ngx_pcalloc: - * hmcf->requires_filter = 0; - */ - -#if nginx_version >= 1011011 - cln = ngx_pool_cleanup_add(cf->pool, 0); - if (cln == NULL) { - return NULL; - } - - cln->data = emcf; - cln->handler = ngx_http_echo_request_headers_cleanup; -#endif - - return emcf; -} - - -static ngx_int_t -ngx_http_echo_post_config(ngx_conf_t *cf) -{ - ngx_int_t rc; - - rc = ngx_http_echo_filter_init(cf); - if (rc != NGX_OK) { - return rc; - } - - rc = ngx_http_echo_echo_init(cf); - if (rc != NGX_OK) { - return rc; - } - - ngx_http_echo_content_length_hash = - ngx_http_echo_hash_literal("content-length"); - - return ngx_http_echo_add_variables(cf); -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.h deleted file mode 100644 index ce0a305..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.h +++ /dev/null @@ -1,151 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_ECHO_MODULE_H -#define NGX_HTTP_ECHO_MODULE_H - - -#include -#include -#include - - -extern ngx_module_t ngx_http_echo_module; - - -/* config directive's opcode */ -typedef enum { - echo_opcode_echo_sync, - echo_opcode_echo, - echo_opcode_echo_request_body, - echo_opcode_echo_sleep, - echo_opcode_echo_flush, - echo_opcode_echo_blocking_sleep, - echo_opcode_echo_reset_timer, - echo_opcode_echo_before_body, - echo_opcode_echo_after_body, - echo_opcode_echo_location_async, - echo_opcode_echo_location, - echo_opcode_echo_subrequest_async, - echo_opcode_echo_subrequest, - echo_opcode_echo_duplicate, - echo_opcode_echo_read_request_body, - echo_opcode_echo_foreach_split, - echo_opcode_echo_end, - echo_opcode_echo_abort_parent, - echo_opcode_echo_exec -} ngx_http_echo_opcode_t; - - -/* all the various config directives (or commands) are - * divided into two categories: "handler commands", - * and "filter commands". For instance, the "echo" - * directive is a handler command while - * "echo_before_body" is a filter one. */ -typedef enum { - echo_handler_cmd, - echo_filter_cmd - -} ngx_http_echo_cmd_category_t; - - -/* compiled form of a config directive argument's value */ -typedef struct { - /* holds the raw string of the argument value */ - ngx_str_t raw_value; - - /* fields "lengths" and "values" are set by - * the function ngx_http_script_compile, - * iff the argument value indeed contains - * nginx variables like "$foo" */ - ngx_array_t *lengths; - ngx_array_t *values; - -} ngx_http_echo_arg_template_t; - - -/* represent a config directive (or command) like "echo". */ -typedef struct { - ngx_http_echo_opcode_t opcode; - - /* each argument is of type echo_arg_template_t: */ - ngx_array_t *args; -} ngx_http_echo_cmd_t; - - -/* location config struct */ -typedef struct { - /* elements of the following arrays are of type - * ngx_http_echo_cmd_t */ - ngx_array_t *handler_cmds; - ngx_array_t *before_body_cmds; - ngx_array_t *after_body_cmds; - - unsigned seen_leading_output; - - ngx_int_t status; -} ngx_http_echo_loc_conf_t; - - -typedef struct { - ngx_int_t requires_filter; -#if nginx_version >= 1011011 - ngx_buf_t **busy_buf_ptrs; - ngx_int_t busy_buf_ptr_count; -#endif -} ngx_http_echo_main_conf_t; - - -typedef struct { - ngx_array_t *choices; /* items after splitting */ - ngx_uint_t next_choice; /* current item index */ - ngx_uint_t cmd_index; /* cmd index for the echo_foreach direcitve */ -} ngx_http_echo_foreach_ctx_t; - - -/* context struct in the request handling cycle, holding - * the current states of the command evaluator */ -typedef struct { - /* index of the next handler command in - * ngx_http_echo_loc_conf_t's "handler_cmds" array. */ - ngx_uint_t next_handler_cmd; - - /* index of the next before-body filter command in - * ngx_http_echo_loc_conf_t's "before_body_cmds" array. */ - ngx_uint_t next_before_body_cmd; - - /* index of the next after-body filter command in - * ngx_http_echo_loc_conf_t's "after_body_cmds" array. */ - ngx_uint_t next_after_body_cmd; - - ngx_http_echo_foreach_ctx_t *foreach; - - ngx_time_t timer_begin; - - ngx_event_t sleep; - - ngx_uint_t counter; - - unsigned before_body_sent:1; - unsigned skip_filter:1; - - unsigned wait_read_request_body:1; - - unsigned waiting:1; - unsigned done:1; - - unsigned run_post_subrequest:1; - unsigned header_sent:1; /* r->header_sent is not sufficient - * because special header filters like - * ngx_http_image_filter_module's may - * intercept the whole header filter chain - * leaving r->header_sent unset. So we - * should always test both flags. */ - -} ngx_http_echo_ctx_t; - - -#endif /* NGX_HTTP_ECHO_MODULE_H */ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.c deleted file mode 100644 index 7dd3683..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.c +++ /dev/null @@ -1,522 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_request_info.h" -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_handler.h" - -#include - - -static void ngx_http_echo_post_read_request_body(ngx_http_request_t *r); -#if nginx_version >= 1011011 -void ngx_http_echo_request_headers_cleanup(void *data); -#endif - - -ngx_int_t -ngx_http_echo_exec_echo_read_request_body(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - return ngx_http_read_client_request_body(r, - ngx_http_echo_post_read_request_body); -} - - -static void -ngx_http_echo_post_read_request_body(ngx_http_request_t *r) -{ - ngx_http_echo_ctx_t *ctx; - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - dd("wait read request body %d", (int) ctx->wait_read_request_body); - - if (ctx->wait_read_request_body) { - ctx->waiting = 0; - ctx->done = 1; - - r->write_event_handler = ngx_http_echo_wev_handler; - - ngx_http_echo_wev_handler(r); - } -} - - -/* this function's implementation is borrowed from nginx 0.8.20 - * and modified a bit to work with subrequests. - * Copyrighted (C) by Igor Sysoev */ -ngx_int_t -ngx_http_echo_request_method_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - if (r->method_name.data) { - v->len = r->method_name.len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - v->data = r->method_name.data; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -/* this function's implementation is borrowed from nginx 0.8.20 - * and modified a bit to work with subrequests. - * Copyrighted (C) by Igor Sysoev */ -ngx_int_t -ngx_http_echo_client_request_method_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - if (r->main->method_name.data) { - v->len = r->main->method_name.len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - v->data = r->main->method_name.data; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -/* this function's implementation is borrowed from nginx 0.8.20 - * and modified a bit to work with subrequests. - * Copyrighted (C) by Igor Sysoev */ -ngx_int_t -ngx_http_echo_request_body_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - u_char *p; - size_t len; - ngx_buf_t *b; - ngx_chain_t *cl; - ngx_chain_t *in; - - if (r->request_body == NULL - || r->request_body->bufs == NULL - || r->request_body->temp_file) - { - v->not_found = 1; - - return NGX_OK; - } - - in = r->request_body->bufs; - - len = 0; - for (cl = in; cl; cl = cl->next) { - b = cl->buf; - - if (!ngx_buf_in_memory(b)) { - if (b->in_file) { - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "variable echo_request_body sees in-file only " - "buffers and discard the whole body data"); - - v->not_found = 1; - - return NGX_OK; - } - - } else { - len += b->last - b->pos; - } - } - - p = ngx_pnalloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - v->data = p; - - for (cl = in; cl; cl = cl->next) { - b = cl->buf; - - if (ngx_buf_in_memory(b)) { - p = ngx_copy(p, b->pos, b->last - b->pos); - } - } - - if (p - v->data != (ssize_t) len) { - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "variable echo_request_body: buffer error"); - - v->not_found = 1; - - return NGX_OK; - } - - v->len = len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_client_request_headers_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - int line_break_len; - size_t size; - u_char *p, *last, *pos; - ngx_int_t i, j; - ngx_buf_t *b, *first = NULL; - unsigned found; -#if nginx_version >= 1011011 - ngx_buf_t **bb; - ngx_chain_t *cl; - ngx_http_echo_main_conf_t *emcf; -#endif - ngx_connection_t *c; - ngx_http_request_t *mr; - ngx_http_connection_t *hc; - - mr = r->main; - hc = r->main->http_connection; - c = mr->connection; - -#if (NGX_HTTP_V2) - /* TODO */ - if (mr->stream) { - v->not_found = 1; - return NGX_OK; - } -#endif - -#if nginx_version >= 1011011 - emcf = ngx_http_get_module_main_conf(r, ngx_http_echo_module); -#endif - - size = 0; - b = c->buffer; - - if (mr->request_line.data[mr->request_line.len] == CR) { - line_break_len = 2; - - } else { - line_break_len = 1; - } - - if (mr->request_line.data >= b->start - && mr->request_line.data + mr->request_line.len + line_break_len - <= b->pos) - { - first = b; - size += b->pos - mr->request_line.data; - } - - if (hc->nbusy) { - b = NULL; - -#if nginx_version >= 1011011 - if (hc->nbusy > emcf->busy_buf_ptr_count) { - if (emcf->busy_buf_ptrs) { - ngx_free(emcf->busy_buf_ptrs); - } - - emcf->busy_buf_ptrs = ngx_alloc(hc->nbusy * sizeof(ngx_buf_t *), - r->connection->log); - - if (emcf->busy_buf_ptrs == NULL) { - return NGX_ERROR; - } - - emcf->busy_buf_ptr_count = hc->nbusy; - } - - bb = emcf->busy_buf_ptrs; - for (cl = hc->busy; cl; cl = cl->next) { - *bb++ = cl->buf; - } - - bb = emcf->busy_buf_ptrs; - for (i = hc->nbusy; i > 0; i--) { - b = bb[i - 1]; -#else - for (i = 0; i < hc->nbusy; i++) { - b = hc->busy[i]; -#endif - - if (first == NULL) { - if (mr->request_line.data >= b->pos - || mr->request_line.data + mr->request_line.len - + line_break_len <= b->start) - { - continue; - } - - dd("found first at %d", (int) i); - first = b; - } - - size += b->pos - b->start; - } - } - - - size++; /* plus the null terminator, as required by the later - ngx_strstr() call */ - - v->data = ngx_palloc(r->pool, size); - if (v->data == NULL) { - return NGX_ERROR; - } - - last = v->data; - - b = c->buffer; - found = 0; - - if (first == b) { - found = 1; - pos = b->pos; - - last = ngx_copy(v->data, mr->request_line.data, - pos - mr->request_line.data); - - if (b != mr->header_in) { - /* skip truncated header entries (if any) */ - while (last > v->data && last[-1] != LF) { - last--; - } - } - - i = 0; - for (p = v->data; p != last; p++) { - if (*p == '\0') { - i++; - if (p + 1 != last && *(p + 1) == LF) { - *p = CR; - - } else if (i % 2 == 1) { - *p = ':'; - - } else { - *p = LF; - } - } - } - } - - if (hc->nbusy) { - -#if nginx_version >= 1011011 - bb = emcf->busy_buf_ptrs; - for (i = hc->nbusy; i > 0; i--) { - b = bb[i - 1]; -#else - for (i = 0; i < hc->nbusy; i++) { - b = hc->busy[i]; -#endif - - if (!found) { - if (b != first) { - continue; - } - - dd("found first"); - found = 1; - } - - p = last; - - pos = b->pos; - - if (b == first) { - dd("request line: %.*s", (int) mr->request_line.len, - mr->request_line.data); - - last = ngx_copy(last, - mr->request_line.data, - pos - mr->request_line.data); - - } else { - last = ngx_copy(last, b->start, pos - b->start); - } - -#if 1 - /* skip truncated header entries (if any) */ - while (last > p && last[-1] != LF) { - last--; - } -#endif - - j = 0; - for (; p != last; p++) { - if (*p == '\0') { - j++; - if (p + 1 == last) { - /* XXX this should not happen */ - dd("found string end!!"); - - } else if (*(p + 1) == LF) { - *p = CR; - - } else if (j % 2 == 1) { - *p = ':'; - - } else { - *p = LF; - } - } - } - - if (b == mr->header_in) { - break; - } - } - } - - *last++ = '\0'; - - if (last - v->data > (ssize_t) size) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "buffer error when evaluating " - "$echo_client__request_headers: \"%V\"", - (ngx_int_t) (last - v->data - size)); - - return NGX_ERROR; - } - - /* strip the leading part (if any) of the request body in our header. - * the first part of the request body could slip in because nginx core's - * ngx_http_request_body_length_filter and etc can move r->header_in->pos - * in case that some of the body data has been preread into r->header_in. - */ - - if ((p = (u_char *) ngx_strstr(v->data, CRLF CRLF)) != NULL) { - last = p + sizeof(CRLF CRLF) - 1; - - } else if ((p = (u_char *) ngx_strstr(v->data, CRLF "\n")) != NULL) { - last = p + sizeof(CRLF "\n") - 1; - - } else if ((p = (u_char *) ngx_strstr(v->data, "\n" CRLF)) != NULL) { - last = p + sizeof("\n" CRLF) - 1; - - } else { - for (p = last - 1; p - v->data >= 2; p--) { - if (p[0] == LF && p[-1] == CR) { - p[-1] = LF; - last = p + 1; - break; - } - - if (p[0] == LF && p[-1] == LF) { - last = p + 1; - break; - } - } - } - - v->len = last - v->data; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_cacheable_request_uri_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - if (r->uri.len) { - v->len = r->uri.len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - v->data = r->uri.data; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_request_uri_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - if (r->uri.len) { - v->len = r->uri.len; - v->valid = 1; - v->no_cacheable = 1; - v->not_found = 0; - v->data = r->uri.data; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_response_status_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - u_char *p; - - if (r->headers_out.status) { - dd("headers out status: %d", (int) r->headers_out.status); - - p = ngx_palloc(r->pool, NGX_INT_T_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - v->len = ngx_sprintf(p, "%ui", r->headers_out.status) - p; - v->data = p; - - v->valid = 1; - v->no_cacheable = 1; - v->not_found = 0; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -#if nginx_version >= 1011011 -void -ngx_http_echo_request_headers_cleanup(void *data) -{ - ngx_http_echo_main_conf_t *emcf; - - emcf = (ngx_http_echo_main_conf_t *) data; - - if (emcf->busy_buf_ptrs) { - ngx_free(emcf->busy_buf_ptrs); - emcf->busy_buf_ptrs = NULL; - } -} -#endif - -/* vi:set ft=c ts=4 sw=4 et fdm=marker: */ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.h deleted file mode 100644 index aa5730b..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ECHO_REQUEST_INFO_H -#define ECHO_REQUEST_INFO_H - - -#include "ngx_http_echo_module.h" - - -ngx_int_t ngx_http_echo_exec_echo_read_request_body( - ngx_http_request_t *r, ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_request_method_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_client_request_method_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_request_body_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_client_request_headers_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_cacheable_request_uri_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_request_uri_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_response_status_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -#if nginx_version >= 1011011 -void ngx_http_echo_request_headers_cleanup(void *data); -#endif - -#endif /* ECHO_REQUEST_INFO_H */ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.c deleted file mode 100644 index c96fa5a..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.c +++ /dev/null @@ -1,208 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_sleep.h" -#include "ngx_http_echo_handler.h" - -#include -#include - - -/* event handler for echo_sleep */ - -static void ngx_http_echo_post_sleep(ngx_http_request_t *r); -static void ngx_http_echo_sleep_cleanup(void *data); - - -ngx_int_t -ngx_http_echo_exec_echo_sleep(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_str_t *computed_arg; - ngx_str_t *computed_arg_elts; - ngx_int_t delay; /* in msec */ - ngx_http_cleanup_t *cln; - - computed_arg_elts = computed_args->elts; - computed_arg = &computed_arg_elts[0]; - - delay = ngx_atofp(computed_arg->data, computed_arg->len, 3); - - if (delay == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "invalid sleep duration \"%V\"", &computed_arg_elts[0]); - - return NGX_HTTP_BAD_REQUEST; - } - - dd("adding timer with delay %lu ms, r:%.*s", (unsigned long) delay, - (int) r->uri.len, r->uri.data); - - ngx_add_timer(&ctx->sleep, (ngx_msec_t) delay); - - /* we don't check broken downstream connections - * ourselves so even if the client shuts down - * the connection prematurely, nginx will still - * go on waiting for our timers to get properly - * expired. However, we'd still register a - * cleanup handler for completeness. */ - - cln = ngx_http_cleanup_add(r, 0); - if (cln == NULL) { - return NGX_ERROR; - } - - cln->handler = ngx_http_echo_sleep_cleanup; - cln->data = r; - - return NGX_AGAIN; -} - - -static void -ngx_http_echo_post_sleep(ngx_http_request_t *r) -{ - ngx_http_echo_ctx_t *ctx; - /* ngx_int_t rc; */ - - dd("post sleep, r:%.*s", (int) r->uri.len, r->uri.data); - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (ctx == NULL) { - return; - } - - ctx->waiting = 0; - ctx->done = 1; - - dd("sleep: after get module ctx"); - - dd("timed out? %d", ctx->sleep.timedout); - dd("timer set? %d", ctx->sleep.timer_set); - - if (!ctx->sleep.timedout) { - dd("HERE reached!"); - return; - } - - ctx->sleep.timedout = 0; - - if (ctx->sleep.timer_set) { - dd("deleting timer for echo_sleep"); - - ngx_del_timer(&ctx->sleep); - } - - /* r->write_event_handler = ngx_http_request_empty_handler; */ - - ngx_http_echo_wev_handler(r); -} - - -void -ngx_http_echo_sleep_event_handler(ngx_event_t *ev) -{ - ngx_connection_t *c; - ngx_http_request_t *r; - ngx_http_log_ctx_t *ctx; - - r = ev->data; - c = r->connection; - - if (c->destroyed) { - return; - } - - if (c->error) { - ngx_http_finalize_request(r, NGX_ERROR); - return; - } - - ctx = c->log->data; - ctx->current_request = r; - - /* XXX when r->done == 1 we should do cleaning immediately - * and delete our timer and then quit. */ - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, - "echo sleep event handler: \"%V?%V\"", &r->uri, &r->args); - - /* - if (r->done) { - return; - } - */ - - ngx_http_echo_post_sleep(r); - -#if defined(nginx_version) - - dd("before run posted requests"); - - ngx_http_run_posted_requests(c); - - dd("after run posted requests"); - -#endif -} - - -ngx_int_t -ngx_http_echo_exec_echo_blocking_sleep(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_str_t *computed_arg; - ngx_str_t *computed_arg_elts; - ngx_int_t delay; /* in msec */ - - computed_arg_elts = computed_args->elts; - computed_arg = &computed_arg_elts[0]; - - delay = ngx_atofp(computed_arg->data, computed_arg->len, 3); - - if (delay == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "invalid sleep duration \"%V\"", &computed_arg_elts[0]); - return NGX_HTTP_BAD_REQUEST; - } - - dd("blocking delay: %lu ms", (unsigned long) delay); - - ngx_msleep((ngx_msec_t) delay); - - return NGX_OK; -} - - -static void -ngx_http_echo_sleep_cleanup(void *data) -{ - ngx_http_request_t *r = data; - ngx_http_echo_ctx_t *ctx; - - dd("echo sleep cleanup"); - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - if (ctx == NULL) { - return; - } - - if (ctx->sleep.timer_set) { - dd("cleanup: deleting timer for echo_sleep"); - - ngx_del_timer(&ctx->sleep); - return; - } - - dd("cleanup: timer not set"); -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.h deleted file mode 100644 index 8bb70c3..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ECHO_SLEEP_H -#define ECHO_SLEEP_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_exec_echo_sleep( - ngx_http_request_t *r, ngx_http_echo_ctx_t *ctx, - ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_echo_blocking_sleep(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -void ngx_http_echo_sleep_event_handler(ngx_event_t *ev); - -#endif /* ECHO_SLEEP_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.c deleted file mode 100644 index 0980d58..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.c +++ /dev/null @@ -1,791 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_subrequest.h" -#include "ngx_http_echo_handler.h" -#include - - -#define ngx_http_echo_method_name(m) { sizeof(m) - 1, (u_char *) m " " } - - -ngx_str_t ngx_http_echo_content_length_header_key = - ngx_string("Content-Length"); - -ngx_str_t ngx_http_echo_get_method = ngx_http_echo_method_name("GET"); -ngx_str_t ngx_http_echo_put_method = ngx_http_echo_method_name("PUT"); -ngx_str_t ngx_http_echo_post_method = ngx_http_echo_method_name("POST"); -ngx_str_t ngx_http_echo_head_method = ngx_http_echo_method_name("HEAD"); -ngx_str_t ngx_http_echo_copy_method = ngx_http_echo_method_name("COPY"); -ngx_str_t ngx_http_echo_move_method = ngx_http_echo_method_name("MOVE"); -ngx_str_t ngx_http_echo_lock_method = ngx_http_echo_method_name("LOCK"); -ngx_str_t ngx_http_echo_mkcol_method = ngx_http_echo_method_name("MKCOL"); -ngx_str_t ngx_http_echo_trace_method = ngx_http_echo_method_name("TRACE"); -ngx_str_t ngx_http_echo_delete_method = ngx_http_echo_method_name("DELETE"); -ngx_str_t ngx_http_echo_unlock_method = ngx_http_echo_method_name("UNLOCK"); -ngx_str_t ngx_http_echo_options_method = ngx_http_echo_method_name("OPTIONS"); -ngx_str_t ngx_http_echo_propfind_method = - ngx_http_echo_method_name("PROPFIND"); -ngx_str_t ngx_http_echo_proppatch_method = - ngx_http_echo_method_name("PROPPATCH"); - - -typedef struct ngx_http_echo_subrequest_s { - ngx_uint_t method; - ngx_str_t *method_name; - ngx_str_t *location; - ngx_str_t *query_string; - ssize_t content_length_n; - ngx_http_request_body_t *request_body; -} ngx_http_echo_subrequest_t; - - -static ngx_int_t ngx_http_echo_parse_method_name(ngx_str_t **method_name_ptr); -static ngx_int_t ngx_http_echo_adjust_subrequest(ngx_http_request_t *sr, - ngx_http_echo_subrequest_t *parsed_sr); -static ngx_int_t ngx_http_echo_parse_subrequest_spec(ngx_http_request_t *r, - ngx_array_t *computed_args, ngx_http_echo_subrequest_t **parsed_sr_ptr); -static ngx_int_t ngx_http_echo_set_content_length_header(ngx_http_request_t *r, - off_t len); - - -ngx_int_t -ngx_http_echo_exec_echo_subrequest_async(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_int_t rc; - ngx_http_echo_subrequest_t *parsed_sr; - ngx_http_request_t *sr; /* subrequest object */ - ngx_str_t args; - ngx_uint_t flags = 0; - - dd_enter(); - - rc = ngx_http_echo_parse_subrequest_spec(r, computed_args, &parsed_sr); - if (rc != NGX_OK) { - return rc; - } - - dd("location: %.*s", - (int) parsed_sr->location->len, - parsed_sr->location->data); - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, parsed_sr->location, &args, &flags) - != NGX_OK) - { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_subrequest_async sees unsafe uri: \"%V\"", - parsed_sr->location); - return NGX_ERROR; - } - - if (args.len > 0 && parsed_sr->query_string == NULL) { - parsed_sr->query_string = &args; - } - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - rc = ngx_http_subrequest(r, parsed_sr->location, parsed_sr->query_string, - &sr, NULL, 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - rc = ngx_http_echo_adjust_subrequest(sr, parsed_sr); - - if (rc != NGX_OK) { - return rc; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_subrequest(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_int_t rc; - ngx_http_request_t *sr; /* subrequest object */ - ngx_http_post_subrequest_t *psr; - ngx_http_echo_subrequest_t *parsed_sr; - ngx_str_t args; - ngx_uint_t flags = 0; - ngx_http_echo_ctx_t *sr_ctx; - - dd_enter(); - - rc = ngx_http_echo_parse_subrequest_spec(r, computed_args, &parsed_sr); - if (rc != NGX_OK) { - return rc; - } - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, parsed_sr->location, &args, &flags) - != NGX_OK) - { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_subrequest sees unsafe uri: \"%V\"", - parsed_sr->location); - return NGX_ERROR; - } - - if (args.len > 0 && parsed_sr->query_string == NULL) { - parsed_sr->query_string = &args; - } - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - sr_ctx = ngx_http_echo_create_ctx(r); - - /* set by ngx_http_echo_create_ctx - * sr_ctx->run_post_subrequest = 0 - */ - - dd("creating sr ctx for %.*s: %p", (int) parsed_sr->location->len, - parsed_sr->location->data, sr_ctx); - - psr = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t)); - - if (psr == NULL) { - return NGX_ERROR; - } - - psr->handler = ngx_http_echo_post_subrequest; - psr->data = sr_ctx; - - rc = ngx_http_subrequest(r, parsed_sr->location, parsed_sr->query_string, - &sr, psr, 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - sr_ctx->sleep.data = sr; - - ngx_http_set_ctx(sr, sr_ctx, ngx_http_echo_module); - - rc = ngx_http_echo_adjust_subrequest(sr, parsed_sr); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - return NGX_AGAIN; -} - - -static ngx_int_t -ngx_http_echo_parse_subrequest_spec(ngx_http_request_t *r, - ngx_array_t *computed_args, ngx_http_echo_subrequest_t **parsed_sr_ptr) -{ - ngx_str_t *computed_arg_elts, *arg; - ngx_str_t **to_write = NULL; - ngx_str_t *method_name; - ngx_str_t *body_str = NULL; - ngx_str_t *body_file = NULL; - ngx_uint_t i; - ngx_flag_t expecting_opt; - ngx_http_request_body_t *rb = NULL; - ngx_buf_t *b; - ngx_http_echo_subrequest_t *parsed_sr; - ngx_open_file_info_t of; - ngx_http_core_loc_conf_t *clcf; - size_t len; - - *parsed_sr_ptr = ngx_pcalloc(r->pool, sizeof(ngx_http_echo_subrequest_t)); - if (*parsed_sr_ptr == NULL) { - return NGX_ERROR; - } - - parsed_sr = *parsed_sr_ptr; - computed_arg_elts = computed_args->elts; - method_name = &computed_arg_elts[0]; - parsed_sr->location = &computed_arg_elts[1]; - - if (parsed_sr->location->len == 0) { - return NGX_ERROR; - } - - expecting_opt = 1; - - for (i = 2; i < computed_args->nelts; i++) { - arg = &computed_arg_elts[i]; - - if (!expecting_opt) { - if (to_write == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "echo_subrequest_async: to_write should NOT be NULL"); - return NGX_ERROR; - } - - *to_write = arg; - to_write = NULL; - - expecting_opt = 1; - - continue; - } - - if (arg->len == 2) { - if (ngx_strncmp("-q", arg->data, arg->len) == 0) { - to_write = &parsed_sr->query_string; - expecting_opt = 0; - continue; - } - - if (ngx_strncmp("-b", arg->data, arg->len) == 0) { - to_write = &body_str; - expecting_opt = 0; - continue; - } - - if (ngx_strncmp("-f", arg->data, arg->len) == 0) { - dd("found option -f"); - to_write = &body_file; - expecting_opt = 0; - continue; - } - } - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unknown option for echo_subrequest*: %V", arg); - - return NGX_ERROR; - } - - if (body_str != NULL && body_str->len) { - rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t)); - - if (rb == NULL) { - return NGX_ERROR; - } - - parsed_sr->content_length_n = body_str->len; - - b = ngx_calloc_buf(r->pool); - if (b == NULL) { - return NGX_ERROR; - } - - b->temporary = 1; - /* b->memory = 1; */ - b->start = b->pos = body_str->data; - b->end = b->last = body_str->data + body_str->len; - - rb->bufs = ngx_alloc_chain_link(r->pool); - if (rb->bufs == NULL) { - return NGX_ERROR; - } - - rb->bufs->buf = b; - rb->bufs->next = NULL; - - rb->buf = b; - - } else if (body_file != NULL && body_file->len) { - - dd("body_file defined %.*s", (int) body_file->len, body_file->data); - - body_file->data = ngx_http_echo_rebase_path(r->pool, body_file->data, - body_file->len, &len); - - if (body_file->data == NULL) { - return NGX_ERROR; - } - - body_file->len = len; - - dd("after rebase, the path becomes %.*s", (int) body_file->len, - body_file->data); - - rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t)); - if (rb == NULL) { - return NGX_ERROR; - } - - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - ngx_memzero(&of, sizeof(ngx_open_file_info_t)); - -#if defined(nginx_version) && nginx_version >= 8018 - of.read_ahead = clcf->read_ahead; -#endif - - of.directio = clcf->directio; - of.valid = clcf->open_file_cache_valid; - of.min_uses = clcf->open_file_cache_min_uses; - of.errors = clcf->open_file_cache_errors; - of.events = clcf->open_file_cache_events; - - if (ngx_open_cached_file(clcf->open_file_cache, body_file, &of, r->pool) - != NGX_OK) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, - "%s \"%V\" failed", - of.failed, body_file); - - return NGX_ERROR; - } - - dd("file content size: %d", (int) of.size); - - parsed_sr->content_length_n = (ssize_t) of.size; - - b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); - if (b == NULL) { - return NGX_ERROR; - } - - b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t)); - if (b->file == NULL) { - return NGX_ERROR; - } - - b->file_pos = 0; - b->file_last = of.size; - - b->in_file = b->file_last ? 1: 0; - -#if 0 - b->last_buf = (r == r->main) ? 1: 0; - b->last_in_chain = 1; -#endif - - b->file->fd = of.fd; - b->file->name = *body_file; - b->file->log = r->connection->log; - b->file->directio = of.is_directio; - - rb->bufs = ngx_alloc_chain_link(r->pool); - if (rb->bufs == NULL) { - return NGX_ERROR; - } - - rb->bufs->buf = b; - rb->bufs->next = NULL; - rb->buf = b; - } - - parsed_sr->request_body = rb; - - parsed_sr->method = ngx_http_echo_parse_method_name(&method_name); - parsed_sr->method_name = method_name; - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_echo_adjust_subrequest(ngx_http_request_t *sr, - ngx_http_echo_subrequest_t *parsed_sr) -{ - ngx_http_core_main_conf_t *cmcf; - ngx_http_request_t *r; - ngx_http_request_body_t *body; - ngx_int_t rc; - - sr->method = parsed_sr->method; - sr->method_name = *(parsed_sr->method_name); - - if (sr->method == NGX_HTTP_HEAD) { - sr->header_only = 1; - } - - r = sr->parent; - - sr->header_in = r->header_in; - - /* XXX work-around a bug in ngx_http_subrequest */ - if (r->headers_in.headers.last == &r->headers_in.headers.part) { - sr->headers_in.headers.last = &sr->headers_in.headers.part; - } - - /* we do not inherit the parent request's variables */ - cmcf = ngx_http_get_module_main_conf(sr, ngx_http_core_module); - sr->variables = ngx_pcalloc(sr->pool, cmcf->variables.nelts - * sizeof(ngx_http_variable_value_t)); - - if (sr->variables == NULL) { - return NGX_ERROR; - } - - body = parsed_sr->request_body; - if (body) { - sr->request_body = body; - - rc = ngx_http_echo_set_content_length_header(sr, body->buf ? - ngx_buf_size(body->buf) - : 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - } - - dd("subrequest body: %p", sr->request_body); - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_echo_parse_method_name(ngx_str_t **method_name_ptr) -{ - const ngx_str_t *method_name = *method_name_ptr; - - switch (method_name->len) { - case 3: - if (ngx_http_echo_strcmp_const(method_name->data, "GET") == 0) { - *method_name_ptr = &ngx_http_echo_get_method; - return NGX_HTTP_GET; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "PUT") == 0) { - *method_name_ptr = &ngx_http_echo_put_method; - return NGX_HTTP_PUT; - } - - return NGX_HTTP_UNKNOWN; - - case 4: - if (ngx_http_echo_strcmp_const(method_name->data, "POST") == 0) { - *method_name_ptr = &ngx_http_echo_post_method; - return NGX_HTTP_POST; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "HEAD") == 0) { - *method_name_ptr = &ngx_http_echo_head_method; - return NGX_HTTP_HEAD; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "COPY") == 0) { - *method_name_ptr = &ngx_http_echo_copy_method; - return NGX_HTTP_COPY; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "MOVE") == 0) { - *method_name_ptr = &ngx_http_echo_move_method; - return NGX_HTTP_MOVE; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "LOCK") == 0) { - *method_name_ptr = &ngx_http_echo_lock_method; - return NGX_HTTP_LOCK; - } - - return NGX_HTTP_UNKNOWN; - - case 5: - if (ngx_http_echo_strcmp_const(method_name->data, "MKCOL") == 0) { - *method_name_ptr = &ngx_http_echo_mkcol_method; - return NGX_HTTP_MKCOL; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "TRACE") == 0) { - *method_name_ptr = &ngx_http_echo_trace_method; - return NGX_HTTP_TRACE; - } - - return NGX_HTTP_UNKNOWN; - - case 6: - if (ngx_http_echo_strcmp_const(method_name->data, "DELETE") == 0) { - *method_name_ptr = &ngx_http_echo_delete_method; - return NGX_HTTP_DELETE; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "UNLOCK") == 0) { - *method_name_ptr = &ngx_http_echo_unlock_method; - return NGX_HTTP_UNLOCK; - } - - return NGX_HTTP_UNKNOWN; - - case 7: - if (ngx_http_echo_strcmp_const(method_name->data, "OPTIONS") == 0) { - *method_name_ptr = &ngx_http_echo_options_method; - return NGX_HTTP_OPTIONS; - } - - return NGX_HTTP_UNKNOWN; - - case 8: - if (ngx_http_echo_strcmp_const(method_name->data, "PROPFIND") == 0) { - *method_name_ptr = &ngx_http_echo_propfind_method; - return NGX_HTTP_PROPFIND; - } - - return NGX_HTTP_UNKNOWN; - - case 9: - if (ngx_http_echo_strcmp_const(method_name->data, "PROPPATCH") == 0) { - *method_name_ptr = &ngx_http_echo_proppatch_method; - return NGX_HTTP_PROPPATCH; - } - - return NGX_HTTP_UNKNOWN; - - default: - return NGX_HTTP_UNKNOWN; - } -} - - -/* XXX extermely evil and not working yet */ -ngx_int_t -ngx_http_echo_exec_abort_parent(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ -#if 0 - ngx_http_postponed_request_t *pr, *ppr; - ngx_http_request_t *saved_data = NULL; - ngx_chain_t *out = NULL; - /* ngx_int_t rc; */ - - dd("aborting parent..."); - - if (r == r->main || r->parent == NULL) { - return NGX_OK; - } - - if (r->parent->postponed) { - dd("Found parent->postponed..."); - - saved_data = r->connection->data; - ppr = NULL; - for (pr = r->parent->postponed; pr->next; pr = pr->next) { - if (pr->request == NULL) { - continue; - } - - if (pr->request == r) { - /* r->parent->postponed->next = pr; */ - dd("found the current subrequest"); - out = pr->out; - continue; - } - - /* r->connection->data = pr->request; */ - dd("finalizing the subrequest..."); - ngx_http_upstream_create(pr->request); - pr->request->upstream = NULL; - - if (ppr == NULL) { - r->parent->postponed = pr->next; - ppr = pr->next; - } else { - ppr->next = pr->next; - ppr = pr->next; - } - } - } - - r->parent->postponed->next = NULL; - - /* - r->connection->data = r->parent; - r->connection->buffered = 0; - - if (out != NULL) { - dd("trying to send more stuffs for the parent"); - ngx_http_output_filter(r->parent, out); - } - */ - - /* ngx_http_send_special(r->parent, NGX_HTTP_LAST); */ - - if (saved_data) { - r->connection->data = saved_data; - } - - dd("terminating the parent request"); - - return ngx_http_echo_send_chain_link(r, ctx, NULL /* indicate LAST */); - - /* ngx_http_upstream_create(r); */ - - /* ngx_http_finalize_request(r->parent, NGX_ERROR); */ -#endif - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_exec(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_str_t *uri; - ngx_str_t *user_args; - ngx_str_t args; - ngx_uint_t flags = 0; - ngx_str_t *computed_arg; - - computed_arg = computed_args->elts; - - uri = &computed_arg[0]; - - if (uri->len == 0) { - return NGX_HTTP_BAD_REQUEST; - } - - if (computed_args->nelts > 1) { - user_args = &computed_arg[1]; - - } else { - user_args = NULL; - } - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_exec sees unsafe uri: \"%V\"", - uri); - return NGX_ERROR; - } - - if (args.len > 0 && user_args == NULL) { - user_args = &args; - } - - r->write_event_handler = ngx_http_request_empty_handler; - - if (uri->data[0] == '@') { - - if (user_args && user_args->len > 0) { - ngx_log_error(NGX_LOG_WARN, r->connection->log, 0, - "querystring %V ignored when exec'ing named " - "location %V", user_args, uri); - } - -#if 1 - /* clear the modules contexts */ - ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); -#endif - - dd("named location: %.*s, c:%d", (int) uri->len, uri->data, - (int) r->main->count); - - return ngx_http_named_location(r, uri); - } - - return ngx_http_internal_redirect(r, uri, user_args); -} - - -static ngx_int_t -ngx_http_echo_set_content_length_header(ngx_http_request_t *r, off_t len) -{ - ngx_table_elt_t *h, *header; - u_char *p; - ngx_list_part_t *part; - ngx_http_request_t *pr; - ngx_uint_t i; - - r->headers_in.content_length_n = len; - - if (ngx_list_init(&r->headers_in.headers, r->pool, 20, - sizeof(ngx_table_elt_t)) - != NGX_OK) - { - return NGX_ERROR; - } - - h = ngx_list_push(&r->headers_in.headers); - if (h == NULL) { - return NGX_ERROR; - } - - h->key = ngx_http_echo_content_length_header_key; - h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); - if (h->lowcase_key == NULL) { - return NGX_ERROR; - } - - ngx_strlow(h->lowcase_key, h->key.data, h->key.len); - - r->headers_in.content_length = h; - - p = ngx_palloc(r->pool, NGX_OFF_T_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - h->value.data = p; - - h->value.len = ngx_sprintf(h->value.data, "%O", len) - h->value.data; - - h->hash = ngx_http_echo_content_length_hash; - - dd("r content length: %.*s", - (int) r->headers_in.content_length->value.len, - r->headers_in.content_length->value.data); - - pr = r->parent; - - if (pr == NULL) { - return NGX_OK; - } - - /* forward the parent request's all other request headers */ - - part = &pr->headers_in.headers.part; - header = part->elts; - - for (i = 0; /* void */; i++) { - - if (i >= part->nelts) { - if (part->next == NULL) { - break; - } - - part = part->next; - header = part->elts; - i = 0; - } - - if (header[i].key.len == sizeof("Content-Length") - 1 - && ngx_strncasecmp(header[i].key.data, (u_char *) "Content-Length", - sizeof("Content-Length") - 1) - == 0) - { - continue; - } - - h = ngx_list_push(&r->headers_in.headers); - if (h == NULL) { - return NGX_ERROR; - } - - *h = header[i]; - } - - /* XXX maybe we should set those built-in header slot in - * ngx_http_headers_in_t too? */ - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.h deleted file mode 100644 index 61c0a04..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef ECHO_SUBREQUEST_H -#define ECHO_SUBREQUEST_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_exec_echo_subrequest(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_echo_subrequest_async(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_abort_parent(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_exec_exec(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -#endif /* ECHO_SUBREQUEST_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.c deleted file mode 100644 index e2777ee..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.c +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif - -#include "ddebug.h" - -#include "ngx_http_echo_timer.h" -#include "ngx_http_echo_util.h" - -#include -#include -#include - - -ngx_int_t -ngx_http_echo_timer_elapsed_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - ngx_http_echo_ctx_t *ctx; - ngx_msec_int_t ms; - u_char *p; - ngx_time_t *tp; - size_t size; - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - if (ctx == NULL) { - ctx = ngx_http_echo_create_ctx(r); - if (ctx == NULL) { - return NGX_ERROR; - } - - ngx_http_set_ctx(r, ctx, ngx_http_echo_module); - } - - if (ctx->timer_begin.sec == 0) { - ctx->timer_begin.sec = r->start_sec; - ctx->timer_begin.msec = (ngx_msec_t) r->start_msec; - } - - /* force the ngx timer to update */ - -#if (nginx_version >= 8035) || (nginx_version < 8000 && nginx_version >= 7066) - ngx_time_update(); -#else - ngx_time_update(0, 0); -#endif - - tp = ngx_timeofday(); - - dd("old sec msec: %ld %d\n", (long) ctx->timer_begin.sec, - (int) ctx->timer_begin.msec); - - dd("new sec msec: %ld %d\n", (long) tp->sec, (int) tp->msec); - - ms = (ngx_msec_int_t) - ((tp->sec - ctx->timer_begin.sec) * 1000 + - (tp->msec - ctx->timer_begin.msec)); - ms = (ms >= 0) ? ms : 0; - - size = sizeof("-9223372036854775808.000") - 1; - - p = ngx_palloc(r->pool, size); - if (p == NULL) { - return NGX_ERROR; - } - - v->len = ngx_snprintf(p, size, "%T.%03M", ms / 1000, ms % 1000) - p; - v->data = p; - - v->valid = 1; - v->no_cacheable = 1; - v->not_found = 0; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_reset_timer(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - dd("Exec timer..."); - - /* force the ngx timer to update */ - -#if (nginx_version >= 8035) || (nginx_version < 8000 && nginx_version >= 7066) - ngx_time_update(); -#else - ngx_time_update(0, 0); -#endif - - ctx->timer_begin = *ngx_timeofday(); - return NGX_OK; -} - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.h deleted file mode 100644 index b6e7ff3..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef ECHO_TIMER_H -#define ECHO_TIMER_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_timer_elapsed_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_exec_echo_reset_timer(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -#endif /* ECHO_TIMER_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.c deleted file mode 100644 index fed0587..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.c +++ /dev/null @@ -1,302 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_sleep.h" - - -ngx_uint_t ngx_http_echo_content_length_hash = 0; - - -ngx_http_echo_ctx_t * -ngx_http_echo_create_ctx(ngx_http_request_t *r) -{ - ngx_http_echo_ctx_t *ctx; - - ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_echo_ctx_t)); - if (ctx == NULL) { - return NULL; - } - - ctx->sleep.handler = ngx_http_echo_sleep_event_handler; - ctx->sleep.data = r; - ctx->sleep.log = r->connection->log; - - return ctx; -} - - -ngx_int_t -ngx_http_echo_eval_cmd_args(ngx_http_request_t *r, - ngx_http_echo_cmd_t *cmd, ngx_array_t *computed_args, - ngx_array_t *opts) -{ - unsigned expecting_opts = 1; - ngx_uint_t i; - ngx_array_t *args = cmd->args; - ngx_str_t *arg, *raw, *opt; - ngx_http_echo_arg_template_t *value; - - value = args->elts; - - for (i = 0; i < args->nelts; i++) { - raw = &value[i].raw_value; - - if (value[i].lengths == NULL && raw->len > 0) { - if (expecting_opts) { - if (raw->len == 1 || raw->data[0] != '-') { - expecting_opts = 0; - - } else if (raw->data[1] == '-') { - expecting_opts = 0; - continue; - - } else { - opt = ngx_array_push(opts); - if (opt == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - opt->len = raw->len - 1; - opt->data = raw->data + 1; - - dd("pushing opt: %.*s", (int) opt->len, opt->data); - - continue; - } - } - - } else { - expecting_opts = 0; - } - - arg = ngx_array_push(computed_args); - if (arg == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (value[i].lengths == NULL) { /* does not contain vars */ - dd("Using raw value \"%.*s\"", (int) raw->len, raw->data); - *arg = *raw; - - } else { - if (ngx_http_script_run(r, arg, value[i].lengths->elts, - 0, value[i].values->elts) - == NULL) - { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - } - - dd("pushed arg: %.*s", (int) arg->len, arg->data); - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_send_chain_link(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_chain_t *in) -{ - ngx_int_t rc; - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - if (in == NULL) { - -#if defined(nginx_version) && nginx_version <= 8004 - - /* earlier versions of nginx does not allow subrequests - to send last_buf themselves */ - if (r != r->main) { - return NGX_OK; - } - -#endif - - rc = ngx_http_send_special(r, NGX_HTTP_LAST); - if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { - return rc; - } - - return NGX_OK; - } - - /* FIXME we should udpate chains to recycle chain links and bufs */ - return ngx_http_output_filter(r, in); -} - - -ngx_int_t -ngx_http_echo_send_header_if_needed(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - ngx_int_t rc; - ngx_http_echo_loc_conf_t *elcf; - - if (!r->header_sent && !ctx->header_sent) { - elcf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - - r->headers_out.status = (ngx_uint_t) elcf->status; - - if (ngx_http_set_content_type(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ngx_http_clear_content_length(r); - ngx_http_clear_accept_ranges(r); - - rc = ngx_http_send_header(r); - ctx->header_sent = 1; - return rc; - } - - return NGX_OK; -} - - -ssize_t -ngx_http_echo_atosz(u_char *line, size_t n) -{ - ssize_t value; - - if (n == 0) { - return NGX_ERROR; - } - - for (value = 0; n--; line++) { - if (*line == '_') { /* we ignore undercores */ - continue; - } - - if (*line < '0' || *line > '9') { - return NGX_ERROR; - } - - value = value * 10 + (*line - '0'); - } - - if (value < 0) { - return NGX_ERROR; - } - - return value; -} - - -/* Modified from the ngx_strlcasestrn function in ngx_string.h - * Copyright (C) by Igor Sysoev */ -u_char * -ngx_http_echo_strlstrn(u_char *s1, u_char *last, u_char *s2, size_t n) -{ - ngx_uint_t c1, c2; - - c2 = (ngx_uint_t) *s2++; - last -= n; - - do { - do { - if (s1 >= last) { - return NULL; - } - - c1 = (ngx_uint_t) *s1++; - - } while (c1 != c2); - - } while (ngx_strncmp(s1, s2, n) != 0); - - return --s1; -} - - -ngx_int_t -ngx_http_echo_post_request_at_head(ngx_http_request_t *r, - ngx_http_posted_request_t *pr) -{ - dd_enter(); - - if (pr == NULL) { - pr = ngx_palloc(r->pool, sizeof(ngx_http_posted_request_t)); - if (pr == NULL) { - return NGX_ERROR; - } - } - - pr->request = r; - pr->next = r->main->posted_requests; - r->main->posted_requests = pr; - - return NGX_OK; -} - - -u_char * -ngx_http_echo_rebase_path(ngx_pool_t *pool, u_char *src, size_t osize, - size_t *nsize) -{ - u_char *p, *dst; - - if (osize == 0) { - return NULL; - } - - if (src[0] == '/') { - /* being an absolute path already, just add a trailing '\0' */ - *nsize = osize; - - dst = ngx_palloc(pool, *nsize + 1); - if (dst == NULL) { - *nsize = 0; - return NULL; - } - - p = ngx_copy(dst, src, osize); - *p = '\0'; - - return dst; - } - - *nsize = ngx_cycle->prefix.len + osize; - - dst = ngx_palloc(pool, *nsize + 1); - if (dst == NULL) { - *nsize = 0; - return NULL; - } - - p = ngx_copy(dst, ngx_cycle->prefix.data, ngx_cycle->prefix.len); - p = ngx_copy(p, src, osize); - - *p = '\0'; - - return dst; -} - - -ngx_int_t -ngx_http_echo_flush_postponed_outputs(ngx_http_request_t *r) -{ - if (r == r->connection->data && r->postponed) { - /* notify the downstream postpone filter to flush the postponed - * outputs of the current request */ - return ngx_http_output_filter(r, NULL); - } - - /* do nothing */ - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.h deleted file mode 100644 index d620d09..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.h +++ /dev/null @@ -1,58 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_ECHO_UTIL_H -#define NGX_HTTP_ECHO_UTIL_H - - -#include "ngx_http_echo_module.h" - - -#define ngx_http_echo_strcmp_const(a, b) \ - ngx_strncmp(a, b, sizeof(b) - 1) - - -#define ngx_http_echo_hash_literal(s) \ - ngx_http_echo_hash_str((u_char *) s, sizeof(s) - 1) - - -static ngx_inline ngx_uint_t -ngx_http_echo_hash_str(u_char *src, size_t n) -{ - ngx_uint_t key; - - key = 0; - - while (n--) { - key = ngx_hash(key, *src); - src++; - } - - return key; -} - - -extern ngx_uint_t ngx_http_echo_content_length_hash; - - -ngx_http_echo_ctx_t *ngx_http_echo_create_ctx(ngx_http_request_t *r); -ngx_int_t ngx_http_echo_eval_cmd_args(ngx_http_request_t *r, - ngx_http_echo_cmd_t *cmd, ngx_array_t *computed_args, - ngx_array_t *opts); -ngx_int_t ngx_http_echo_send_header_if_needed(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); -ngx_int_t ngx_http_echo_send_chain_link(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_chain_t *cl); -ssize_t ngx_http_echo_atosz(u_char *line, size_t n); -u_char *ngx_http_echo_strlstrn(u_char *s1, u_char *last, u_char *s2, size_t n); -ngx_int_t ngx_http_echo_post_request_at_head(ngx_http_request_t *r, - ngx_http_posted_request_t *pr); -u_char *ngx_http_echo_rebase_path(ngx_pool_t *pool, u_char *src, size_t osize, - size_t *nsize); -ngx_int_t ngx_http_echo_flush_postponed_outputs(ngx_http_request_t *r); - - -#endif /* NGX_HTTP_ECHO_UTIL_H */ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.c deleted file mode 100644 index 138a510..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.c +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_var.h" -#include "ngx_http_echo_timer.h" -#include "ngx_http_echo_request_info.h" -#include "ngx_http_echo_foreach.h" - - -static ngx_int_t ngx_http_echo_incr_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - - -static ngx_http_variable_t ngx_http_echo_variables[] = { - - { ngx_string("echo_timer_elapsed"), NULL, - ngx_http_echo_timer_elapsed_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_request_method"), NULL, - ngx_http_echo_request_method_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_cacheable_request_uri"), NULL, - ngx_http_echo_cacheable_request_uri_variable, 0, - 0, 0 }, - - { ngx_string("echo_request_uri"), NULL, - ngx_http_echo_request_uri_variable, 0, - 0, 0 }, - - { ngx_string("echo_client_request_method"), NULL, - ngx_http_echo_client_request_method_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_request_body"), NULL, - ngx_http_echo_request_body_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_client_request_headers"), NULL, - ngx_http_echo_client_request_headers_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_it"), NULL, - ngx_http_echo_it_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_incr"), NULL, - ngx_http_echo_incr_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_response_status"), NULL, - ngx_http_echo_response_status_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_null_string, NULL, NULL, 0, 0, 0 } -}; - - -ngx_int_t -ngx_http_echo_add_variables(ngx_conf_t *cf) -{ - ngx_http_variable_t *var, *v; - - for (v = ngx_http_echo_variables; v->name.len; v++) { - var = ngx_http_add_variable(cf, &v->name, v->flags); - if (var == NULL) { - return NGX_ERROR; - } - - var->get_handler = v->get_handler; - var->data = v->data; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_echo_incr_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - ngx_http_echo_ctx_t *ctx; - u_char *p; - - ctx = ngx_http_get_module_ctx(r->main, ngx_http_echo_module); - - if (ctx == NULL) { - return NGX_ERROR; - } - - ctx->counter++; - - p = ngx_palloc(r->pool, NGX_INT_T_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - v->len = ngx_sprintf(p, "%ui", ctx->counter) - p; - v->data = p; - - v->valid = 1; - v->not_found = 0; - v->no_cacheable = 1; - - return NGX_OK; -} - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.h deleted file mode 100644 index 8b24e02..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef ECHO_VAR_H -#define ECHO_VAR_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_add_variables(ngx_conf_t *cf); - -#endif /* ECHO_VAR_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/abort-parent.t b/modules_deb/libnginx-mod-http-echo-0.63/t/abort-parent.t deleted file mode 100644 index 6137607..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/abort-parent.t +++ /dev/null @@ -1,63 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::LWP skip_all => - 'not working at all'; - -plan tests => 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /abort { - echo hello; - echo_flush; - echo_location_async '/foo'; - echo_location_async '/bar'; - echo_location_async '/baz'; - echo world; - echo_flush; - } - - location /proxy { - proxy_pass "http://127.0.0.1:$server_port/sleep?$query_string"; - } - - location /sleep { - echo_sleep $arg_sleep; - echo $arg_echo; - echo_flush; - } - - location /foo { - echo_location '/proxy?sleep=1&echo=foo'; - #echo_flush; - echo_abort_parent; - } - - location /bar { - proxy_pass 'http://127.0.0.1:$server_port/sleep_bar'; - } - - location /baz { - proxy_pass 'http://127.0.0.1:$server_port/sleep_baz'; - } - - location /sleep_bar { - echo_sleep 2; - echo bar; - } - - location /sleep_baz { - echo_sleep 3; - echo baz; - } ---- request - GET /abort ---- response_body -hello -bar - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/blocking-sleep.t b/modules_deb/libnginx-mod-http-echo-0.63/t/blocking-sleep.t deleted file mode 100644 index 0bdc6cc..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/blocking-sleep.t +++ /dev/null @@ -1,156 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /echo { - echo_blocking_sleep 1; - } ---- request - GET /echo ---- response_body - - - -=== TEST 2: fractional delay ---- config - location /echo { - echo_blocking_sleep 0.01; - } ---- request - GET /echo ---- response_body - - - -=== TEST 3: leading echo ---- config - location /echo { - echo before...; - echo_blocking_sleep 0.01; - } ---- request - GET /echo ---- response_body -before... - - - -=== TEST 4: trailing echo ---- config - location /echo { - echo_blocking_sleep 0.01; - echo after...; - } ---- request - GET /echo ---- response_body -after... - - - -=== TEST 5: two echos around sleep ---- config - location /echo { - echo before...; - echo_blocking_sleep 0.01; - echo after...; - } ---- request - GET /echo ---- response_body -before... -after... - - - -=== TEST 6: interleaving sleep and echo ---- config - location /echo { - echo 1; - echo_blocking_sleep 0.01; - echo 2; - echo_blocking_sleep 0.01; - } ---- request - GET /echo ---- response_body -1 -2 - - - -=== TEST 7: interleaving sleep and echo with echo at the end... ---- config - location /echo { - echo 1; - echo_blocking_sleep 0.01; - echo 2; - echo_blocking_sleep 0.01; - echo 3; - } ---- request - GET /echo ---- response_body -1 -2 -3 - - - -=== TEST 8: flush before sleep -we didn't really test the actual effect of "echo_flush" here... -merely checks if it croaks if appears. ---- config - location /flush { - echo hi; - echo_flush; - echo_blocking_sleep 0.01; - echo trees; - } ---- request - GET /flush ---- response_body -hi -trees - - - -=== TEST 9: flush does not increment opcode pointer itself ---- config - location /flush { - echo hi; - echo_flush; - echo trees; - } ---- request - GET /flush ---- response_body -hi -trees - - - -=== TEST 10: blocking sleep by variable ---- config - location ~ ^/sleep/(.+) { - echo before...; - echo_blocking_sleep $1; - echo after...; - } ---- request - GET /sleep/0.01 ---- response_body -before... -after... - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-after-body.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo-after-body.t deleted file mode 100644 index 44c4c72..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-after-body.t +++ /dev/null @@ -1,261 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -no_long_string(); -log_level('warn'); - -#master_on(); -#workers(1); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- http_config - postpone_output 1; ---- config - location /echo { - echo_after_body hello; - echo world; - } ---- request - GET /echo ---- response_body -world -hello - - - -=== TEST 2: echo after proxy ---- config - location /echo { - echo_after_body hello; - proxy_pass http://127.0.0.1:$server_port$request_uri/more; - } - location /echo/more { - echo world; - } ---- request - GET /echo ---- response_body -world -hello - - - -=== TEST 3: with variables ---- config - location /echo { - echo_after_body $request_method; - echo world; - } ---- request - GET /echo ---- response_body -world -GET - - - -=== TEST 4: w/o args ---- config - location /echo { - echo_after_body; - echo world; - } ---- request - GET /echo ---- response_body eval -"world\n\n" - - - -=== TEST 5: order is not important ---- config - location /reversed { - echo world; - echo_after_body hello; - } ---- request - GET /reversed ---- response_body -world -hello - - - -=== TEST 6: multiple echo_after_body instances ---- config - location /echo { - echo_after_body hello; - echo_after_body world; - echo !; - } ---- request - GET /echo ---- response_body -! -hello -world - - - -=== TEST 7: multiple echo_after_body instances with multiple echo cmds ---- config - location /echo { - echo_after_body hello; - echo_after_body world; - echo i; - echo say; - } ---- request - GET /echo ---- response_body -i -say -hello -world - - - -=== TEST 8: echo-after-body & echo-before-body ---- config - location /mixed { - echo_before_body hello; - echo_after_body world; - echo_before_body hiya; - echo_after_body igor; - echo ////////; - } ---- request - GET /mixed ---- response_body -hello -hiya -//////// -world -igor - - - -=== TEST 9: echo around proxy ---- config - location /echo { - echo_before_body hello; - echo_before_body world; - #echo $scheme://$host:$server_port$request_uri/more; - proxy_pass $scheme://127.0.0.1:$server_port$request_uri/more; - echo_after_body hiya; - echo_after_body igor; - } - location /echo/more { - echo blah; - } ---- request - GET /echo ---- response_body -hello -world -blah -hiya -igor - - - -=== TEST 10: with $echo_response_status ---- config - location /status { - echo_after_body "status: $echo_response_status"; - return 404; - } ---- request - GET /status ---- response_body_like -.*404 Not Found.* -status: 404$ ---- error_code: 404 - - - -=== TEST 11: in subrequests ---- config - location /main { - echo_location_async /hello; - } - location /hello { - echo_after_body 'world!'; - echo 'hello'; - } ---- request - GET /main ---- response_body -hello -world! - - - -=== TEST 12: echo_after_body + gzip ---- config - gzip on; - gzip_min_length 1; - location /main { - echo_after_body 'world!'; - echo_duplicate 1024 'hello'; - } ---- request - GET /main ---- response_body_like -hello ---- SKIP - - - -=== TEST 13: echo_after_body + proxy output ---- config - #gzip on; - #gzip_min_length 1; - location /main { - echo_after_body 'world'; - proxy_pass http://127.0.0.1:$server_port/foo; - } - location /foo { - echo_duplicate 10 hello; - } ---- request - GET /main ---- response_body_like -^(?:hello){10}world$ - - - -=== TEST 14: in subrequests (we get last_in_chain set properly) ---- config - location /main { - echo_location_async /hello; - } - location /hello { - echo 'hello'; - echo_after_body 'world!'; - body_filter_by_lua ' - local eof = ngx.arg[2] - if eof then - print("lua: eof found in body") - end - '; - } ---- request - GET /main ---- response_body -hello -world! ---- log_level: notice ---- error_log -lua: eof found in body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-before-body.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo-before-body.t deleted file mode 100644 index 1513184..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-before-body.t +++ /dev/null @@ -1,278 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /echo { - echo_before_body hello; - echo world; - } ---- request - GET /echo ---- response_body -hello -world - - - -=== TEST 2: echo before proxy ---- config - location /echo { - echo_before_body hello; - proxy_pass $scheme://127.0.0.1:$server_port$request_uri/more; - } - location /echo/more { - echo world; - } ---- request - GET /echo ---- response_body -hello -world - - - -=== TEST 3: with variables ---- config - location /echo { - echo_before_body $request_method; - echo world; - } ---- request - GET /echo ---- response_body -GET -world - - - -=== TEST 4: w/o args ---- config - location /echo { - echo_before_body; - echo world; - } ---- request - GET /echo ---- response_body eval -"\nworld\n" - - - -=== TEST 5: order is not important ---- config - location /reversed { - echo world; - echo_before_body hello; - } ---- request - GET /reversed ---- response_body -hello -world - - - -=== TEST 6: multiple echo_before_body instances ---- config - location /echo { - echo_before_body hello; - echo_before_body world; - echo !; - } ---- request - GET /echo ---- response_body -hello -world -! - - - -=== TEST 7: multiple echo_before_body instances with multiple echo cmds ---- config - location /echo { - echo_before_body hello; - echo_before_body world; - echo i; - echo say; - } ---- request - GET /echo ---- response_body -hello -world -i -say - - - -=== TEST 8: with $echo_response_status ---- config - location /status { - echo_before_body "status: $echo_response_status"; - return 404; - } ---- request - GET /status ---- response_body_like -status: 404 -.*404 Not Found.*$ ---- error_code: 404 - - - -=== TEST 9: $echo_response_status in echo_before_body in subrequests ---- config - location /main { - echo_location '/status?val=403'; - echo_location '/status?val=500'; - } - location /status { - if ($arg_val = 500) { - echo_before_body "status: $echo_response_status"; - return 500; - break; - } - if ($arg_val = 403) { - echo_before_body "status: $echo_response_status"; - return 403; - break; - } - return 200; - } ---- request - GET /main ---- response_body_like -^status: 403.*?status: 500.*$ - - - -=== TEST 10: echo -n ---- config - location /echo { - echo_before_body -n hello; - echo_before_body -n world; - echo ==; - } ---- request - GET /echo ---- response_body -helloworld== - - - -=== TEST 11: echo a -n ---- config - location /echo { - echo_before_body a -n hello; - echo_before_body b -n world; - echo ==; - } ---- request - GET /echo ---- response_body -a -n hello -b -n world -== - - - -=== TEST 12: -n in a var ---- config - location /echo { - set $opt -n; - echo_before_body $opt hello; - echo_before_body $opt world; - echo ==; - } ---- request - GET /echo ---- response_body --n hello --n world -== - - - -=== TEST 13: -n only ---- config - location /echo { - echo_before_body -n; - echo_before_body -n; - echo ==; - } ---- request - GET /echo ---- response_body -== - - - -=== TEST 14: -n with an empty string ---- config - location /echo { - echo_before_body -n ""; - set $empty ""; - echo_before_body -n $empty; - echo ==; - } ---- request - GET /echo ---- response_body -== - - - -=== TEST 15: -- -n ---- config - location /echo { - echo_before_body -- -n hello; - echo_before_body -- -n world; - echo ==; - } ---- request - GET /echo ---- response_body --n hello --n world -== - - - -=== TEST 16: -n -n ---- config - location /echo { - echo_before_body -n -n hello; - echo_before_body -n -n world; - echo ==; - } ---- request - GET /echo ---- response_body -helloworld== - - - -=== TEST 17: -n -- -n ---- config - location /echo { - echo_before_body -n -- -n hello; - echo_before_body -n -- -n world; - echo ==; - } ---- request - GET /echo ---- response_body --n hello-n world== - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-duplicate.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo-duplicate.t deleted file mode 100644 index 82b6725..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-duplicate.t +++ /dev/null @@ -1,89 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /dup { - echo_duplicate 3 a; - } ---- request - GET /dup ---- response_body: aaa - - - -=== TEST 2: abc abc ---- config - location /dup { - echo_duplicate 2 abc; - } ---- request - GET /dup ---- response_body: abcabc - - - -=== TEST 3: big size with underscores ---- config - location /dup { - echo_duplicate 10_000 A; - } ---- request - GET /dup ---- response_body eval -'A' x 10_000 - - - -=== TEST 4: 0 duplicate 0 empty strings ---- config - location /dup { - echo_duplicate 0 ""; - } ---- request - GET /dup ---- response_body - - - -=== TEST 5: 0 duplicate non-empty strings ---- config - location /dup { - echo_duplicate 0 "abc"; - } ---- request - GET /dup ---- response_body - - - -=== TEST 6: duplication of empty strings ---- config - location /dup { - echo_duplicate 2 ""; - } ---- request - GET /dup ---- response_body - - - -=== TEST 7: sanity (HEAD) ---- config - location /dup { - echo_duplicate 3 a; - } ---- request - HEAD /dup ---- response_body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-timer.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo-timer.t deleted file mode 100644 index 712524d..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-timer.t +++ /dev/null @@ -1,107 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: timer without explicit reset ---- config - location /timer { - echo_sleep 0.03; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.0(2[6-9]|3[0-6]) sec\.$ - - - -=== TEST 2: timer without explicit reset and sleep ---- config - location /timer { - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.00[0-5] sec\.$ - - - -=== TEST 3: timing accumulated sleeps ---- config - location /timer { - echo_sleep 0.03; - echo_sleep 0.02; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.0(4[6-9]|5[0-6]) sec\.$ - - - -=== TEST 4: timer with explicit reset but without sleep ---- config - location /timer { - echo_reset_timer; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.00[0-5] sec\.$ - - - -=== TEST 5: reset timer between sleeps ---- config - location /timer { - echo_sleep 0.02; - echo "elapsed $echo_timer_elapsed sec."; - echo_reset_timer; - echo_sleep 0.03; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.0(1[6-9]|2[0-6]) sec\. -elapsed 0\.0(2[6-9]|3[0-6]) sec\.$ - - - -=== TEST 6: reset timer between blocking sleeps ---- config - location /timer { - echo_blocking_sleep 0.02; - echo "elapsed $echo_timer_elapsed sec."; - echo_reset_timer; - echo_blocking_sleep 0.03; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.0(1[6-9]|2[0-9]) sec\. -elapsed 0\.0(2[6-9]|3[0-6]) sec\.$ - - - -=== TEST 7: timer without explicit reset ---- config - location = /timer { - return 200 "$echo_timer_elapsed"; - } ---- request - GET /timer ---- response_body_like chop -^0(\.0\d*)$ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo.t deleted file mode 100644 index b181259..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo.t +++ /dev/null @@ -1,416 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 6); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /echo { - echo hello; - } ---- request - GET /echo ---- response_body -hello - - - -=== TEST 2: multiple args ---- config - location /echo { - echo say hello world; - } ---- request - GET /echo ---- response_body -say hello world - - - -=== TEST 3: multiple directive instances ---- config - location /echo { - echo say that; - echo hello; - echo world !; - } ---- request - GET /echo ---- response_body -say that -hello -world ! - - - -=== TEST 4: echo without arguments ---- config - location /echo { - echo; - echo; - } ---- request - GET /echo ---- response_body eval -"\n\n" - - - -=== TEST 5: escaped newline ---- config - location /echo { - echo "hello\nworld"; - } ---- request - GET /echo ---- response_body -hello -world - - - -=== TEST 6: escaped tabs and \r and " wihtin "..." ---- config - location /echo { - echo "i say \"hello\tworld\"\r"; - } ---- request - GET /echo ---- response_body eval: "i say \"hello\tworld\"\r\n" - - - -=== TEST 7: escaped tabs and \r and " in single quotes ---- config - location /echo { - echo 'i say \"hello\tworld\"\r'; - } ---- request - GET /echo ---- response_body eval: "i say \"hello\tworld\"\r\n" - - - -=== TEST 8: escaped tabs and \r and " w/o any quotes ---- config - location /echo { - echo i say \"hello\tworld\"\r; - } ---- request - GET /echo ---- response_body eval: "i say \"hello\tworld\"\r\n" - - - -=== TEST 9: escaping $ -As of Nginx 0.8.20, there's still no way to escape the '$' character. ---- config - location /echo { - echo \$; - } ---- request - GET /echo ---- response_body -$ ---- SKIP - - - -=== TEST 10: XSS ---- config - location /blah { - echo_duplicate 1 "$arg_callback("; - echo_location_async "/data?$uri"; - echo_duplicate 1 ")"; - } - location /data { - echo_duplicate 1 '{"dog":"$query_string"}'; - } ---- request - GET /blah/9999999.json?callback=ding1111111 ---- response_body chomp -ding1111111({"dog":"/blah/9999999.json"}) - - - -=== TEST 11: XSS - filter version ---- config - location /blah { - echo_before_body "$arg_callback("; - - echo_duplicate 1 '{"dog":"$uri"}'; - - echo_after_body ")"; - } ---- request - GET /blah/9999999.json?callback=ding1111111 ---- response_body -ding1111111( -{"dog":"/blah/9999999.json"}) - - - -=== TEST 12: if ---- config -location /first { - echo "before"; - echo_location_async /second $request_uri; - echo "after"; -} - -location = /second { - if ($query_string ~ '([^?]+)') { - set $memcached_key $1; # needing this to be keyed on the request_path, not the entire uri - echo $memcached_key; - } -} ---- request - GET /first/9999999.json?callback=ding1111111 ---- response_body -before -/first/9999999.json -after - - - -=== TEST 13: echo -n ---- config - location /echo { - echo -n hello; - echo -n world; - } ---- request - GET /echo ---- response_body chop -helloworld - - - -=== TEST 14: echo a -n ---- config - location /echo { - echo a -n hello; - echo b -n world; - } ---- request - GET /echo ---- response_body -a -n hello -b -n world - - - -=== TEST 15: -n in a var ---- config - location /echo { - set $opt -n; - echo $opt hello; - echo $opt world; - } ---- request - GET /echo ---- response_body --n hello --n world - - - -=== TEST 16: -n only ---- config - location /echo { - echo -n; - echo -n; - } ---- request - GET /echo ---- response_body chop - - - -=== TEST 17: -n with an empty string ---- config - location /echo { - echo -n ""; - set $empty ""; - echo -n $empty; - } ---- request - GET /echo ---- response_body chop - - - -=== TEST 18: -- -n ---- config - location /echo { - echo -- -n hello; - echo -- -n world; - } ---- request - GET /echo ---- response_body --n hello --n world - - - -=== TEST 19: -n -n ---- config - location /echo { - echo -n -n hello; - echo -n -n world; - } ---- request - GET /echo ---- response_body chop -helloworld - - - -=== TEST 20: -n -- -n ---- config - location /echo { - echo -n -- -n hello; - echo -n -- -n world; - } ---- request - GET /echo ---- response_body chop --n hello-n world - - - -=== TEST 21: proxy ---- config - location /main { - proxy_pass http://127.0.0.1:$server_port/echo; - } - location /echo { - echo hello; - echo world; - } ---- request - GET /main ---- response_headers -!Content-Length ---- response_body -hello -world - - - -=== TEST 22: if is evil ---- config - location /test { - set $a 3; - set_by_lua $a ' - if ngx.var.a == "3" then - return 4 - end - '; - echo $a; - } ---- request - GET /test ---- response_body -4 ---- SKIP - - - -=== TEST 23: HEAD ---- config - location /echo { - echo hello; - echo world; - } ---- request - HEAD /echo ---- response_body - - - -=== TEST 24: POST ---- config - location /echo { - echo hello; - echo world; - } ---- pipelined_requests eval -["POST /echo -blah blah", "POST /echo -foo bar baz"] ---- response_body eval -["hello\nworld\n","hello\nworld\n"] - - - -=== TEST 25: POST ---- config - location /echo { - echo_sleep 0.001; - echo hello; - echo world; - } ---- pipelined_requests eval -["POST /echo -blah blah", "POST /echo -foo bar baz"] ---- response_body eval -["hello\nworld\n","hello\nworld\n"] - - - -=== TEST 26: empty arg after -n (github issue #33) ---- config - location = /t { - set $empty ""; - echo -n $empty hello world; - } ---- request - GET /t ---- response_body chop - hello world - - - -=== TEST 27: image filter ---- config - location = /gif { - empty_gif; - } - - location = /t { - default_type image/gif; - image_filter resize 10 10; - set $gif1 ''; - set $gif2 ''; - rewrite_by_lua ' - local res = ngx.location.capture("/gif") - local data = res.body - ngx.var.gif1 = string.sub(data, 1, #data - 1) - ngx.var.gif2 = string.sub(data, #data) - '; - echo -n $gif1; - echo -n $gif2; - } ---- request - GET /t ---- stap -F(ngx_http_image_header_filter) { - println("image header filter") -} ---- stap_out -image header filter ---- response_body_like: . - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/exec.t b/modules_deb/libnginx-mod-http-echo-0.63/t/exec.t deleted file mode 100644 index b7c1308..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/exec.t +++ /dev/null @@ -1,228 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: exec normal location ---- config - location /main { - echo_exec /bar; - echo end; - } - location = /bar { - echo "$echo_request_uri:"; - echo bar; - } ---- request - GET /main ---- response_body -/bar: -bar - - - -=== TEST 2: location with args (inlined in uri) ---- config - location /main { - echo_exec /bar?a=32; - echo end; - } - location /bar { - echo "a: [$arg_a]"; - } ---- request - GET /main ---- response_body -a: [32] - - - -=== TEST 3: location with args (in separate arg) ---- config - location /main { - echo_exec /bar a=56; - echo end; - } - location /bar { - echo "a: [$arg_a]"; - } ---- request - GET /main ---- response_body -a: [56] - - - -=== TEST 4: exec named location ---- config - location /main { - echo_exec @bar; - echo end; - } - location @bar { - echo bar; - } ---- request - GET /main ---- response_body -bar - - - -=== TEST 5: query string ignored for named locations ---- config - location /main { - echo_exec @bar?a=32; - echo end; - } - location @bar { - echo "a: [$arg_a]"; - } ---- request - GET /main ---- response_body -a: [] ---- error_log -querystring a=32 ignored when exec'ing named location @bar - - - -=== TEST 6: query string ignored for named locations ---- config - location /foo { - echo_exec @bar; - } - location @bar { - echo "uri: [$echo_request_uri]"; - } ---- request - GET /foo ---- response_body -uri: [/foo] - - - -=== TEST 7: exec(named location) in subrequests ---- config - location /entry { - echo_location /foo; - echo_sleep 0.001; - echo_location /foo2; - } - location /foo { - echo_exec @bar; - } - location /foo2 { - echo_exec @bar; - } - - location @bar { - proxy_pass http://127.0.0.1:$server_port/bar; - } - location /bar { - echo_sleep 0.01; - echo hello; - } ---- request - GET /entry ---- response_body -hello -hello - - - -=== TEST 8: exec(normal loctions) in subrequests ---- config - location /entry { - echo_location /foo; - echo_sleep 0.001; - echo_location /foo2; - } - location /foo { - echo_exec /baz; - } - location /foo2 { - echo_exec /baz; - } - - location /baz { - proxy_pass http://127.0.0.1:$server_port/bar; - } - location /bar { - echo_sleep 0.01; - echo hello; - } ---- request - GET /entry ---- response_body -hello -hello - - - -=== TEST 9: exec should clear ctx ---- config - location @bar { - echo hello; - echo world; - echo heh; - } - location /foo { - #echo_sleep 0.001; - echo_reset_timer; - echo_exec @bar; - } ---- request - GET /foo ---- response_body -hello -world -heh - - - -=== TEST 10: reset ctx ---- config - location @proxy { - rewrite_by_lua return; - echo hello; - } - location /main { - rewrite_by_lua return; - echo_exec @proxy; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 11: yield before exec ---- config - location @bar { - echo hello; - echo world; - echo heh; - } - location /foo { - echo_sleep 0.001; - echo_exec @bar; - } ---- request - GET /foo ---- response_body -hello -world -heh - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/filter-used.t b/modules_deb/libnginx-mod-http-echo-0.63/t/filter-used.t deleted file mode 100644 index 2835270..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/filter-used.t +++ /dev/null @@ -1,59 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (3 * blocks()); - -no_long_string(); -log_level('warn'); - -#master_on(); -#workers(1); - -run_tests(); - -__DATA__ - -=== TEST 1: filter indeed used ---- http_config - postpone_output 1; ---- config - location /echo { - echo_after_body hello; - echo world; - } ---- request - GET /echo ---- stap -F(ngx_http_echo_header_filter) { - println("echo header filter called") -} ---- stap_out -echo header filter called ---- response_body -world -hello - - - -=== TEST 2: filter not used ---- http_config - postpone_output 1; ---- config - location /echo { - #echo_after_body hello; - echo world; - } ---- request - GET /echo ---- stap -F(ngx_http_echo_header_filter) { - println("echo header filter called") -} ---- stap_out ---- response_body -world - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/foreach-split.t b/modules_deb/libnginx-mod-http-echo-0.63/t/foreach-split.t deleted file mode 100644 index 266a701..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/foreach-split.t +++ /dev/null @@ -1,283 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo_foreach_split '&' $query_string; - echo_location_async $echo_it; - echo '/* end */'; - echo_end; - } - location /sub/1.css { - echo "body { font-size: 12pt; }"; - } - location /sub/2.css { - echo "table { color: 'red'; }"; - } ---- request - GET /main?/sub/1.css&/sub/2.css ---- response_body -body { font-size: 12pt; } -/* end */ -table { color: 'red'; } -/* end */ - - - -=== TEST 2: split in a url argument (echo_location_async) ---- config - location /main_async { - echo_foreach_split ',' $arg_cssfiles; - echo_location_async $echo_it; - echo_end; - } - location /foo.css { - echo foo; - } - location /bar.css { - echo bar; - } - location /baz.css { - echo baz; - } ---- request - GET /main_async?cssfiles=/foo.css,/bar.css,/baz.css ---- response_body -foo -bar -baz - - - -=== TEST 3: split in a url argument (echo_location) ---- config - location /main_sync { - echo_foreach_split ',' $arg_cssfiles; - echo_location $echo_it; - echo_end; - } - location /foo.css { - echo foo; - } - location /bar.css { - echo bar; - } - location /baz.css { - echo baz; - } ---- request - GET /main_sync?cssfiles=/foo.css,/bar.css,/baz.css ---- response_body -foo -bar -baz ---- SKIP - - - -=== TEST 4: empty loop ---- config - location /main { - echo "start"; - echo_foreach_split ',' $arg_cssfiles; - echo_end; - echo "end"; - } ---- request - GET /main?cssfiles=/foo.css,/bar.css,/baz.css ---- response_body -start -end - - - -=== TEST 5: trailing delimiter ---- config - location /main_t { - echo_foreach_split ',' $arg_cssfiles; - echo_location_async $echo_it; - echo_end; - } - location /foo.css { - echo foo; - } ---- request - GET /main_t?cssfiles=/foo.css, ---- response_body -foo - - - -=== TEST 6: multi-char delimiter ---- config - location /main_sleep { - echo_foreach_split '-a-' $arg_list; - echo $echo_it; - echo_end; - } ---- request - GET /main_sleep?list=foo-a-bar-a-baz ---- error_code: 500 ---- response_body_like: 500 Internal Server Error - - - -=== TEST 7: multi-char delimiter (the right way) ---- config - location /main_sleep { - echo_foreach_split -- '-a-' $arg_list; - echo $echo_it; - echo_end; - } ---- request - GET /main_sleep?list=foo-a-bar-a-baz ---- response_body -foo -bar -baz - - - -=== TEST 8: loop with sleep ---- config - location /main_sleep { - echo_foreach_split '-' $arg_list; - echo_sleep 0.001; - echo $echo_it; - echo_end; - } ---- request - GET /main_sleep?list=foo-a-bar-A-baz ---- response_body -foo -a -bar -A -baz - - - -=== TEST 9: empty ---- config - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } ---- request - GET /merge ---- response_body - - - -=== TEST 10: single & ---- config - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } ---- request - GET /merge?& ---- response_body - - - -=== TEST 11: pure &'s ---- config - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } ---- request - GET /merge?&&& ---- response_body - - - -=== TEST 12: pure & and spaces -TODO: needs to uri_decode $echo_it... ---- config - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } ---- request - GET /merge?&%20&%20& ---- response_body ---- SKIP - - - -=== TEST 13: multiple foreach_split ---- config - location /multi { - echo_foreach_split '&' $query_string; - echo [$echo_it]; - echo_end; - - echo '...'; - - echo_foreach_split '-' $query_string; - echo [$echo_it]; - echo_end; - } ---- request - GET /multi?a-b&c-d ---- response_body -[a-b] -[c-d] -... -[a] -[b&c] -[d] - - - -=== TEST 14: github issue #2: setting a variable from $echo_it results to crashing ---- config -location = /getFile { - set $filelist "a,b,c"; - echo_foreach_split ',' $filelist; - set $file $echo_it; - echo_subrequest GET '/getFile2' -q 'sha256=$file'; - echo_end; -} - -location = /getFile2 { - echo "sha256: $arg_sha256"; -} ---- request - GET /getFile ---- response_body -sha256: -sha256: -sha256: - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/gzip.t b/modules_deb/libnginx-mod-http-echo-0.63/t/gzip.t deleted file mode 100644 index 61eb4f6..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/gzip.t +++ /dev/null @@ -1,31 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /gzip { - gzip on; - gzip_min_length 10; - gzip_types text/plain; - - echo_duplicate 1000 hello; - } ---- request - GET /gzip ---- more_headers -Accept-Encoding: gzip ---- response_headers -Content-Encoding: gzip ---- timeout: 20 diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/if.t b/modules_deb/libnginx-mod-http-echo-0.63/t/if.t deleted file mode 100644 index 054ec43..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/if.t +++ /dev/null @@ -1,150 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity (hit) ---- config - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - echo $res; - } - echo $res; - } ---- request - GET /if?val=abc ---- response_body -hit - - - -=== TEST 2: sanity (miss) ---- config - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - echo $res; - } - echo $res; - } ---- request - GET /if?val=bcd ---- response_body -miss - - - -=== TEST 3: proxy in if (hit) ---- config - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - proxy_pass $scheme://127.0.0.1:$server_port/foo?res=$res; - } - proxy_pass $scheme://127.0.0.1:$server_port/foo?res=$res; - } - location /foo { - echo "res = $arg_res"; - } ---- request - GET /if?val=abc ---- response_body -res = hit - - - -=== TEST 4: proxy in if (miss) ---- config - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - proxy_pass $scheme://127.0.0.1:$server_port/foo?res=$res; - } - proxy_pass $scheme://127.0.0.1:$server_port/foo?res=$res; - } - location /foo { - echo "res = $arg_res"; - } ---- request - GET /if?val=bcd ---- response_body -res = miss - - - -=== TEST 5: if too long url (hit) ---- config - location /foo { - if ($request_uri ~ '.{20,}') { - echo too long; - } - echo ok; - } ---- request - GET /foo?a=12345678901234567890 ---- response_body -too long - - - -=== TEST 6: if too long url (miss) ---- config - location /foo { - if ($request_uri ~ '.{20,}') { - echo too long; - } - echo ok; - } ---- request - GET /foo?a=1234567890 ---- response_body -ok - - - -=== TEST 7: echo should be inherited by if blocks ---- config - location /foo { - if ($uri ~ 'foo') { - } - echo ok; - } ---- request - GET /foo ---- response_body -ok - - - -=== TEST 8: echo_after_body and echo_before_body should be inherited by if blocks ---- config - location /foo { - if ($uri ~ 'foo') { - } - echo_before_body -n 'hello'; - echo_location /comma; - echo_after_body 'world'; - } - - location = /comma { - internal; - echo -n ', '; - } ---- request - GET /foo ---- response_body -hello, world - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/incr.t b/modules_deb/libnginx-mod-http-echo-0.63/t/incr.t deleted file mode 100644 index 8ad6d98..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/incr.t +++ /dev/null @@ -1,32 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo "main pre: $echo_incr"; - echo_location_async /sub; - echo_location_async /sub; - echo "main post: $echo_incr"; - } - location /sub { - echo "sub: $echo_incr"; - } ---- request - GET /main ---- response_body -main pre: 1 -sub: 3 -sub: 4 -main post: 2 - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/location-async.t b/modules_deb/libnginx-mod-http-echo-0.63/t/location-async.t deleted file mode 100644 index 3494516..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/location-async.t +++ /dev/null @@ -1,439 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo_location_async /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 2: trailing echo ---- config - location /main { - echo_location_async /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello -after subrequest - - - -=== TEST 3: leading echo ---- config - location /main { - echo before subrequest; - echo_location_async /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello - - - -=== TEST 4: leading & trailing echo ---- config - location /main { - echo before subrequest; - echo_location_async /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello -after subrequest - - - -=== TEST 5: multiple subrequests ---- config - location /main { - echo before sr 1; - echo_location_async /sub; - echo after sr 1; - echo before sr 2; - echo_location_async /sub; - echo after sr 2; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before sr 1 -hello -after sr 1 -before sr 2 -hello -after sr 2 - - - -=== TEST 6: timed multiple subrequests (blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_location_async /sub1; - echo_location_async /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_blocking_sleep 0.02; - echo hello; - } - location /sub2 { - echo_blocking_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.00[0-5] sec for total\.$ - - - -=== TEST 7: timed multiple subrequests (non-blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_location_async /sub1; - echo_location_async /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 0.02; - echo hello; - } - location /sub2 { - echo_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.00[0-5] sec for total\.$ - - - -=== TEST 8: location with args ---- config - location /main { - echo_location_async /sub 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 9: encoded chars in query strings ---- config - location /main { - echo_location_async /sub 'foo=a%20b&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -a%20b Bar - - - -=== TEST 10: UTF-8 chars in query strings ---- config - location /main { - echo_location_async /sub 'foo=你好'; - } - location /sub { - echo $arg_foo; - } ---- request - GET /main ---- response_body -你好 - - - -=== TEST 11: encoded chars in location url ---- config - location /main { - echo_location_async /sub%31 'foo=Foo&bar=Bar'; - } - location /sub%31 { - echo 'sub%31'; - } - location /sub1 { - echo 'sub1'; - } ---- request - GET /main ---- response_body -sub1 - - - -=== TEST 12: querystring in url ---- config - location /main { - echo_location_async /sub?foo=Foo&bar=Bar; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 13: querystring in url *AND* an explicit querystring ---- config - location /main { - echo_location_async /sub?foo=Foo&bar=Bar blah=Blah; - } - location /sub { - echo $arg_foo $arg_bar $arg_blah; - } ---- request - GET /main ---- response_body - Blah - - - -=== TEST 14: explicit flush in main request -flush won't really flush the buffer... ---- config - location /main_flush { - echo 'pre main'; - echo_location_async /sub; - echo 'post main'; - echo_flush; - } - - location /sub { - echo_sleep 0.02; - echo 'sub'; - } ---- request - GET /main_flush ---- response_body -pre main -sub -post main - - - -=== TEST 15: no varaiable inheritance ---- config - location /main { - echo $echo_cacheable_request_uri; - echo_location_async /sub; - echo_location_async /sub2; - } - location /sub { - echo $echo_cacheable_request_uri; - } - location /sub2 { - echo $echo_cacheable_request_uri; - } - ---- request - GET /main ---- response_body -/main -/sub -/sub2 - - - -=== TEST 16: unsafe uri ---- config - location /unsafe { - echo_location_async '/../foo'; - } ---- request - GET /unsafe ---- stap2 -F(ngx_http_send_header) { - printf("send header on req %p (header sent: %d)\n", $r, $r->header_sent) - print_ubacktrace() -} ---- ignore_response ---- error_log -echo_location_async sees unsafe uri: "/../foo" ---- no_error_log -[error] -[alert] - - - -=== TEST 17: access/deny (access phase handlers skipped in subrequests) ---- config - location /main { - echo_location_async /denied; - } - location /denied { - deny all; - echo No no no; - } ---- request - GET /main ---- error_code: 200 ---- response_body -No no no - - - -=== TEST 18: rewrite is honored. ---- config - location /main { - echo_location_async /rewrite; - } - location /rewrite { - rewrite ^ /foo break; - echo $uri; - } ---- request - GET /main ---- response_body -/foo - - - -=== TEST 19: let subrequest to read the main request's request body ---- SKIP ---- config - location /main { - echo_location_async /sub; - } - location /sub { - echo_read_request_body; - echo_request_body; - } ---- request -POST /main -hello, body! ---- response_body chomp -hello, body! - - - -=== TEST 20: leading subrequest & echo_before_body ---- config - location /main { - echo_before_body hello; - echo_location_async /foo; - } - location /foo { - echo world; - } ---- request - GET /main ---- response_body -hello -world - - - -=== TEST 21: leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_location_async /foo; - } - location /foo { - echo -n world; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world); - - - -=== TEST 22: multiple leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_location_async /foo; - echo_location_async /bar; - } - location /foo { - echo -n world; - } - location /bar { - echo -n ' people'; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world people); - - - -=== TEST 23: sanity (HEAD) ---- config - location /main { - echo_location_async /sub; - echo_location_async /sub; - } - location /sub { - echo hello; - } ---- request - HEAD /main ---- response_body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/location.t b/modules_deb/libnginx-mod-http-echo-0.63/t/location.t deleted file mode 100644 index 48c851e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/location.t +++ /dev/null @@ -1,567 +0,0 @@ -# vi:filetype= - -use lib 'lib'; - -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 2); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -#no_diff(); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo_location /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 2: sanity with proxy in the middle ---- config - location /main { - echo_location /proxy; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 3: trailing echo ---- config - location /main { - echo_location /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello -after subrequest - - - -=== TEST 4: leading echo ---- config - location /main { - echo before subrequest; - echo_location /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello - - - -=== TEST 5: leading & trailing echo ---- config - location /main { - echo before subrequest; - echo_location /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello -after subrequest - - - -=== TEST 6: multiple subrequests ---- config - location /main { - echo before sr 1; - echo_location /sub; - echo after sr 1; - echo before sr 2; - echo_location /sub; - echo after sr 2; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before sr 1 -hello -after sr 1 -before sr 2 -hello -after sr 2 - - - -=== TEST 7: timed multiple subrequests (blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_location /sub1; - echo_location /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_blocking_sleep 0.02; - echo hello; - } - location /sub2 { - echo_blocking_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.0(?:2[5-9]|3[0-6]) sec for total\.$ - - - -=== TEST 8: timed multiple subrequests (non-blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_location /sub1; - echo_location /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 0.02; - echo hello; - } - location /sub2 { - echo_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.0(?:2[5-9]|3[0-6]) sec for total\.$ - - - -=== TEST 9: location with args ---- config - location /main { - echo_location /sub 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 10: chained subrequests ---- config - location /main { - echo 'pre main'; - echo_location /sub; - echo 'post main'; - } - - location /sub { - echo 'pre sub'; - echo_location /subsub; - echo 'post sub'; - } - - location /subsub { - echo 'subsub'; - } ---- request - GET /main ---- response_body -pre main -pre sub -subsub -post sub -post main - - - -=== TEST 11: chained subrequests using named locations -as of 0.8.20, ngx_http_subrequest still does not support -named location. sigh. this case is a TODO. ---- config - location /main { - echo 'pre main'; - echo_location @sub; - echo 'post main'; - } - - location @sub { - echo 'pre sub'; - echo_location @subsub; - echo 'post sub'; - } - - location @subsub { - echo 'subsub'; - } ---- request - GET /main ---- response_body -pre main -pre sub -subsub -post sub -post main ---- SKIP - - - -=== TEST 12: explicit flush in main request ---- config - location /main { - echo 'pre main'; - echo_location /sub; - echo 'post main'; - echo_flush; - } - - location /sub { - echo_sleep 0.02; - echo 'sub'; - } ---- request - GET /main ---- response_body -pre main -sub -post main - - - -=== TEST 13: no varaiable inheritance ---- config - location /main { - echo $echo_cacheable_request_uri; - echo_location /sub; - echo_location /sub2; - } - location /sub { - echo $echo_cacheable_request_uri; - } - location /sub2 { - echo $echo_cacheable_request_uri; - } - ---- request - GET /main ---- response_body -/main -/sub -/sub2 - - - -=== TEST 14: unsafe uri ---- config - location /unsafe { - echo_location '/../foo'; - } ---- request - GET /unsafe ---- ignore_response ---- error_log -echo_location sees unsafe uri: "/../foo" ---- no_error_log -[error] -[alert] - - - -=== TEST 15: querystring in url ---- config - location /main { - echo_location /sub?foo=Foo&bar=Bar; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 16: querystring in url *AND* an explicit querystring ---- config - location /main { - echo_location /sub?foo=Foo&bar=Bar blah=Blah; - } - location /sub { - echo $arg_foo $arg_bar $arg_blah; - } ---- request - GET /main ---- response_body - Blah - - - -=== TEST 17: let subrequest to read the main request's request body ---- SKIP ---- config - location /main { - echo_location /sub; - } - location /sub { - echo_read_request_body; - echo_request_body; - } ---- request -POST /main -hello, body! ---- response_body chomp -hello, body! - - - -=== TEST 18: sleep after location ---- config - location /main { - echo_location /sub; - echo_sleep 0.001; - echo_location /sub; - } - location /sub { - echo_sleep 0.001; - echo sub; - } ---- request - GET /main ---- response_body -sub -sub ---- skip_nginx: 2: < 0.8.11 - - - -=== TEST 19: deep nested echo_location/echo_location_async ---- config - location /main { - echo_location /bar; - echo_location_async /bar; - echo_location_async /bar; - echo_location /group; - echo_location_async /group; - } - - location /group { - echo_location /bar; - echo_location_async /bar; - } - - location /bar { - #echo_sleep 0.001; - echo $echo_incr; - } ---- request -GET /main ---- response_body -1 -2 -3 -4 -5 -6 -7 ---- timeout: 2 - - - -=== TEST 20: deep nested echo_location/echo_location_async (with sleep) ---- config - location /main { - echo_location /bar; - echo_location_async /bar; - echo_location_async /bar; - echo_location /group; - echo_location_async /group; - } - - location /group { - echo_location /baz; - echo_location_async /bah; - } - - location ~ '^/ba[rzh]' { - echo_sleep 0.001; - echo $echo_incr; - } ---- request -GET /main ---- response_body -1 -2 -3 -4 -5 -6 -7 ---- timeout: 2 - - - -=== TEST 21: deep nested echo_location (with sleep) ---- config - location /main { - echo_location /bar; - echo_location /bar; - echo_location /bar; - echo_location /group; - echo_location /group; - } - - location /group { - echo_location /bar; - echo_location /bar; - } - - location /incr { - echo_sleep 0.001; - echo $echo_incr; - } - - location /bar { - proxy_pass $scheme://127.0.0.1:$server_port/incr; - } ---- request -GET /main ---- response_body -1 -1 -1 -1 -1 -1 -1 ---- timeout: 5 ---- no_error_log -[error] - - - -=== TEST 22: leading subrequest & echo_before_body ---- config - location /main { - echo_before_body hello; - echo_location /foo; - } - location /foo { - echo world; - } ---- request - GET /main ---- response_body -hello -world - - - -=== TEST 23: leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_location /foo; - } - location /foo { - echo -n world; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world); - - - -=== TEST 24: multiple leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_location /foo; - echo_location /bar; - } - location /main2 { - content_by_lua ' - local res = ngx.location.capture("/foo") - local res2 = ngx.location.capture("/bar") - ngx.say(res.body) - ngx.say(res2.body) - '; - } - location /foo { - echo -n world; - } - location /bar { - echo -n ' people'; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world people); - - - -=== TEST 25: sanity (HEAD) ---- config - location /main { - echo_location /sub; - echo_location /sub; - } - location /sub { - echo hello; - } ---- request - HEAD /main ---- response_body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/mixed.t b/modules_deb/libnginx-mod-http-echo-0.63/t/mixed.t deleted file mode 100644 index abf2599..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/mixed.t +++ /dev/null @@ -1,82 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: echo before echo_client_request_headers ---- config - location /echo { - echo "headers:"; - echo -n $echo_client_request_headers; - } ---- request - GET /echo ---- response_body eval -"headers: -GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" - - - -=== TEST 2: echo_client_request_headers before echo ---- config - location /echo { - echo -n $echo_client_request_headers; - echo "...these are the headers"; - } ---- request - GET /echo ---- response_body eval -"GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -...these are the headers -" - - - -=== TEST 3: echo & headers & echo ---- config - location /echo { - echo "headers are"; - echo -n $echo_client_request_headers; - echo "...these are the headers"; - } ---- request - GET /echo ---- response_body eval -"headers are -GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -...these are the headers -" - - - -=== TEST 4: mixed with echo_duplicate ---- config - location /mixed { - echo hello; - echo_duplicate 2 ---; - echo_duplicate 1 ' END '; - echo_duplicate 2 ---; - echo; - } ---- request - GET /mixed ---- response_body -hello ------- END ------ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/request-body.t b/modules_deb/libnginx-mod-http-echo-0.63/t/request-body.t deleted file mode 100644 index d467b2e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/request-body.t +++ /dev/null @@ -1,58 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: big client body buffered into temp files ---- config - location /echo { - client_body_buffer_size 1k; - echo_read_request_body; - echo_request_body; - } ---- request eval -"POST /echo -" . 'a' x 4096 . 'end'; ---- response_body eval -'a' x 4096 . 'end' - - - -=== TEST 2: in memory request body (trailing echo) ---- config - location /echo { - client_body_buffer_size 1k; - echo_read_request_body; - echo_request_body; - echo done; - } ---- request -POST /echo -hello world ---- response_body -hello worlddone - - - -=== TEST 3: big client body buffered into temp files (trailing echo) ---- config - location /echo { - client_body_buffer_size 1k; - echo_read_request_body; - echo_request_body; - echo done; - } ---- request eval -"POST /echo -" . 'a' x 4096 . "end\n"; ---- response_body eval -'a' x 4096 . "enddone\n" - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/request-info.t b/modules_deb/libnginx-mod-http-echo-0.63/t/request-info.t deleted file mode 100644 index dd34da4..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/request-info.t +++ /dev/null @@ -1,870 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (3 * blocks() + 14); - -run_tests(); - -__DATA__ - -=== TEST 1: standalone directive ---- config - location /echo { - echo -n $echo_client_request_headers; - } ---- request - GET /echo ---- response_body eval -"GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" ---- no_error_log -[error] - - - -=== TEST 2: multiple instances ---- config - location /echo { - echo -n $echo_client_request_headers; - echo -n $echo_client_request_headers; - } ---- request - GET /echo ---- response_body eval -"GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" ---- no_error_log -[error] - - - -=== TEST 3: does not explicitly request_body ---- config - location /echo { - echo [$echo_request_body]; - } ---- request -POST /echo -body here -heh ---- response_body -[] ---- no_error_log -[error] - - - -=== TEST 4: let proxy read request_body ---- config - location /echo { - echo_before_body [$echo_request_body]; - proxy_pass $scheme://127.0.0.1:$server_port/blah; - } - location /blah { echo_duplicate 0 ''; } ---- request -POST /echo -body here -heh ---- response_body -[body here -heh] ---- no_error_log -[error] - - - -=== TEST 5: use echo_read_request_body to read it! ---- config - location /echo { - echo_read_request_body; - echo [$echo_request_body]; - } ---- request -POST /echo -body here -heh ---- response_body -[body here -heh] ---- no_error_log -[error] - - - -=== TEST 6: how about sleep after that? ---- config - location /echo { - echo_read_request_body; - echo_sleep 0.002; - echo [$echo_request_body]; - } ---- request -POST /echo -body here -heh ---- response_body -[body here -heh] ---- no_error_log -[error] - - - -=== TEST 7: echo back the whole client request ---- config - # echo back the client request - location /echoback { - echo -n $echo_client_request_headers; - echo_read_request_body; - echo $echo_request_body; - } ---- request -POST /echoback -body here -haha ---- response_body eval -"POST /echoback HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 14\r -\r -body here -haha -" ---- no_error_log -[error] - - - -=== TEST 8: echo_request_body ---- config - location /body { - client_body_buffer_size 5; - echo_read_request_body; - echo "[$echo_request_body]"; - echo_request_body; - } ---- request eval -"POST /body -" . ('a' x 2048) . "b" ---- response_body eval -"[]\n" . -('a' x 2048) . "b" ---- no_error_log -[error] - - - -=== TEST 9: $echo_response_status in content handler ---- config - location /status { - echo "status: $echo_response_status"; - } ---- request - GET /status ---- response_body -status: ---- no_error_log -[error] - - - -=== TEST 10: echo_request_body (empty body) ---- config - location /body { - echo_read_request_body; - echo_request_body; - } - location /main { - proxy_pass http://127.0.0.1:$server_port/body; - } ---- request eval -"POST /main" ---- response_body eval -"" ---- no_error_log -[error] - - - -=== TEST 11: small header ---- config - location /t { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -} ---- no_error_log -[error] ---- no_error_log -[error] - - - -=== TEST 12: large header ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -CORE::join "\n", map { "Header$_: value-$_" } 1..512 - ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\n\r\n" - ---- no_error_log -[error] - - - -=== TEST 13: small header, with leading CRLF ---- config - location /t { - echo -n $echo_client_request_headers; - } ---- raw_request eval -"\r\nGET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -} ---- no_error_log -[error] - - - -=== TEST 14: large header, with leading CRLF ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo -n $echo_client_request_headers; - } - ---- raw_request eval -"\r\nGET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -". -(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\n\r\n" - ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\n\r\n" - ---- no_error_log -[error] - - - -=== TEST 15: small header, pipelined ---- config - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /th"] - ---- more_headers -Foo: bar - ---- response_body eval -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -Foo: bar\r -\r -}, qq{GET /th HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar\r -\r -}] ---- no_error_log -[error] - - - -=== TEST 16: large header, pipelined ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /t"] - ---- more_headers eval -CORE::join "\n", map { "Header$_: value-$_" } 1..512 - ---- response_body eval -my $headers = (CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\n\r\n"; - -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -$headers}, -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -$headers}] - ---- no_error_log -[error] - - - -=== TEST 17: small header, multi-line header -multi-line header is not supported since 1.21 ---- config - location /t { - echo -n $echo_client_request_headers; - } ---- raw_request eval -"GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar baz\r - blah\r -\r -" ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar baz\r - blah\r -\r -} ---- no_error_log -[error] ---- skip_nginx -3: >= 1.21.1 - - - -=== TEST 18: large header, multi-line header -multi-line header is not supported since 1.21 ---- config - client_header_buffer_size 10; - large_client_header_buffers 50 567; - location /t { - echo -n $echo_client_request_headers; - } - ---- raw_request eval -my $headers = (CORE::join "\r\n", map { "Header$_: value-$_\r\n hello $_ world blah blah" } 1..512) . "\r\n\r\n"; - -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -$headers} - ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_\r\n hello $_ world blah blah" } 1..512) . "\r\n\r\n" - ---- no_error_log -[error] ---- skip_nginx -3: >= 1.21.1 - - - -=== TEST 19: small header (POST body) ---- config - location /t { - echo_read_request_body; - echo -n $echo_client_request_headers; - } ---- request -POST /t -hello ---- response_body eval -qq{POST /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 20: small header (POST body) - in subrequests (location) ---- config - location /t { - echo -n $echo_client_request_headers; - } - location /main { - echo_location /t; - } - ---- request -POST /main -hello ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 21: large header (POST body) ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo_read_request_body; - echo -n $echo_client_request_headers; - } ---- request -POST /t -hello - ---- more_headers eval -CORE::join"\n", map { "Header$_: value-$_" } 1..512 - ---- response_body eval -qq{POST /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\nContent-Length: 5\r\n\r\n" - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 22: large header (POST body) - in subrequests ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo_read_request_body; - echo -n $echo_client_request_headers; - } - - location /main { - echo_location /t; - } ---- request -POST /main -hello ---- more_headers eval -CORE::join"\n", map { "Header$_: value-$_" } 1..512 - ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\nContent-Length: 5\r\n\r\n" - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 23: raw headers - the default header buffer can hold the request line, but not the header entries ---- config - location /t { - echo_read_request_body; - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\nBah: bah\n"; -$s .= "Accept: */*\n"; -$s .= "Cookie: " . "C" x 1200 . "\n"; -$s ---- response_body eval -"GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -User-Agent: curl\r -Bah: bah\r -Accept: */*\r -Cookie: " . ("C" x 1200) . "\r\n\r\n" ---- no_error_log -[error] - - - -=== TEST 24: small header (POST body) - in subrequests (location_async) ---- config - location /t { - echo -n $echo_client_request_headers; - } - location /main { - echo_location_async /t; - } - ---- request -POST /main -hello ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 25: small header (POST body) - in subrequests (subrequest) ---- config - location /t { - echo -n $echo_client_request_headers; - } - location /main { - echo_subrequest GET /t; - } - ---- request -POST /main -hello ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 26: small header (POST body) - in subrequests (subrequest_async) ---- config - location /t { - echo -n $echo_client_request_headers; - } - location /main { - echo_subrequest_async GET /t; - } - ---- request -POST /main -hello ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 27: ngx_proxy/ngx_fastcgi/etc change r->header_end to point to their own buffers ---- config - location = /t { - proxy_buffering off; - proxy_pass http://127.0.0.1:$server_port/bad; - proxy_intercept_errors on; - error_page 500 = /500; - } - - location = /bad { - return 500; - } - - location = /500 { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- response_body eval -"GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" ---- no_error_log -[error] - - - -=== TEST 28: ngx_proxy/ngx_fastcgi/etc change r->header_end to point to their own buffers (exclusive LF in the request data) ---- config - location = /t { - proxy_buffering off; - proxy_pass http://127.0.0.1:$server_port/bad; - proxy_intercept_errors on; - error_page 500 = /500; - } - - location = /bad { - return 500; - } - - location = /500 { - internal; - echo -n $echo_client_request_headers; - } ---- raw_request eval -"GET /t HTTP/1.1 -Host: localhost -Connection: close -Content-Length: 5 - -hello" ---- response_body eval -"GET /t HTTP/1.1 -Host: localhost -Connection: close -Content-Length: 5 - -" ---- no_error_log -[error] - - - -=== TEST 29: ngx_proxy/ngx_fastcgi/etc change r->header_end to point to their own buffers (mixed LF and CRLF in the request data) ---- config - location = /t { - proxy_buffering off; - proxy_pass http://127.0.0.1:$server_port/bad; - proxy_intercept_errors on; - error_page 500 = /500; - } - - location = /bad { - return 500; - } - - location = /500 { - internal; - echo -n $echo_client_request_headers; - } ---- raw_request eval -"GET /t HTTP/1.1\r -Host: localhost -Connection: close\r -Content-Length: 5\r - -hello" ---- response_body eval -"GET /t HTTP/1.1\r -Host: localhost -Connection: close\r -Content-Length: 5\r - -" ---- no_error_log -[error] - - - -=== TEST 30: ngx_proxy/ngx_fastcgi/etc change r->header_end to point to their own buffers (another way of mixing LF and CRLF in the request data) ---- config - location = /t { - proxy_buffering off; - proxy_pass http://127.0.0.1:$server_port/bad; - proxy_intercept_errors on; - error_page 500 = /500; - } - - location = /bad { - return 500; - } - - location = /500 { - internal; - echo -n $echo_client_request_headers; - } ---- raw_request eval -"GET /t HTTP/1.1\r -Host: localhost -Connection: close\r -Content-Length: 5 -\r -hello" ---- response_body eval -"GET /t HTTP/1.1\r -Host: localhost -Connection: close\r -Content-Length: 5 -\r -" ---- no_error_log -[error] - - - -=== TEST 31: two pipelined requests with large headers ---- config - client_header_buffer_size 10; - large_client_header_buffers 3 5610; - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /t"] ---- more_headers eval -CORE::join "\n", map { "Header$_: value-$_" } 1..585 - ---- response_body eval -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..585) . "\r\n\r\n", -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..585) . "\r\n\r\n", -, -] - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 32: a request with large header and a smaller pipelined request following ---- config - client_header_buffer_size 10; - large_client_header_buffers 2 1921; - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /t"] ---- more_headers eval -[CORE::join("\n", map { "Header$_: value-$_" } 1..170), "Foo: bar\n"] - ---- response_body eval -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..170) . "\r\n\r\n", -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar\r -\r -}, -] - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 33: a request with large header and a smaller pipelined request following ---- config - client_header_buffer_size 10; - large_client_header_buffers 2 1921; - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /t" . ("a" x 512)] ---- more_headers eval -[CORE::join("\n", map { "Header$_: value-$_" } 1..170), "Foo: bar\n"] - ---- response_body eval -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..170) . "\r\n\r\n", -qq{GET /t} . ("a" x 512) . qq{ HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar\r -\r -}, -] - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 34: invalid header line started with whitespace since nginx 1.21.1 ---- config - client_header_buffer_size 10; - large_client_header_buffers 50 567; - location /t { - echo -n $echo_client_request_headers; - } - ---- raw_request eval -my $headers = (CORE::join "\r\n", map { "Header$_: value-$_\r\n hello $_ world blah blah" } 1..512) . "\r\n\r\n"; - -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -$headers} - ---- error_code: 400 ---- no_error_log -[error] ---- skip_nginx -2: < 1.21.1 diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/sleep.t b/modules_deb/libnginx-mod-http-echo-0.63/t/sleep.t deleted file mode 100644 index f8e741e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/sleep.t +++ /dev/null @@ -1,200 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /echo { - echo_sleep 1; - } ---- request - GET /echo ---- response_body - - - -=== TEST 2: fractional delay ---- config - location /echo { - echo_sleep 0.01; - } ---- request - GET /echo ---- response_body - - - -=== TEST 3: leading echo ---- config - location /echo { - echo before...; - echo_sleep 0.01; - } ---- request - GET /echo ---- response_body -before... - - - -=== TEST 4: trailing echo ---- config - location /echo { - echo_sleep 0.01; - echo after...; - } ---- request - GET /echo ---- response_body -after... - - - -=== TEST 5: two echos around sleep ---- config - location /echo { - echo before...; - echo_sleep 0.01; - echo after...; - } ---- request - GET /echo ---- response_body -before... -after... - - - -=== TEST 6: interleaving sleep and echo ---- config - location /echo { - echo 1; - echo_sleep 0.01; - echo 2; - echo_sleep 0.01; - } ---- request - GET /echo ---- response_body -1 -2 - - - -=== TEST 7: interleaving sleep and echo with echo at the end... ---- config - location /echo { - echo 1; - echo_sleep 0.01; - echo 2; - echo_sleep 0.01; - echo 3; - } ---- request - GET /echo ---- response_body -1 -2 -3 - - - -=== TEST 8: flush before sleep -we didn't really test the actual effect of "echo_flush" here... -merely checks if it croaks if appears. ---- config - location /flush { - echo hi; - echo_flush; - echo_sleep 0.01; - echo trees; - } ---- request - GET /flush ---- response_body -hi -trees - - - -=== TEST 9: flush does not increment opcode pointer itself ---- config - location /flush { - echo hi; - echo_flush; - echo trees; - } ---- request - GET /flush ---- response_body -hi -trees - - - -=== TEST 10: sleep through a proxy -this reveals a bug in v0.19 and the bug is fixed in v0.20. ---- config - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/entry'; - } - location /entry { - echo_sleep 0.001; - echo done; - } ---- request - GET /proxy ---- response_body_like -done - - - -=== TEST 11: abnormally quit ---- config - location /quit { - echo before; - echo_flush; - echo_sleep 1; - echo after; - } ---- request - GET /quit ---- response_body -before -after - - - -=== TEST 12: two echos around sleep (HEAD) ---- config - location /echo { - echo before...; - echo_sleep 0.01; - echo after...; - } ---- request - HEAD /echo ---- response_body - - - -=== TEST 13: sleep by variable ---- config - location ~ ^/sleep/(.+) { - echo before...; - echo_sleep $1; - echo after...; - } ---- request - GET /sleep/0.01 ---- response_body -before... -after... - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/status.t b/modules_deb/libnginx-mod-http-echo-0.63/t/status.t deleted file mode 100644 index d97b084..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/status.t +++ /dev/null @@ -1,142 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (2 * blocks()); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: 200 ---- config - location /echo { - echo_status 200; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 200 - - - -=== TEST 2: if location (200) ---- config - location /echo { - set $true 1; - if ($true) { - } - echo_status 200; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 200 - - - -=== TEST 3: 404 ---- config - location /echo { - echo_status 404; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 404 - - - -=== TEST 4: if location (404) ---- config - location /echo { - set $true 1; - if ($true) { - } - echo_status 404; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 404 - - - -=== TEST 5: 500 ---- config - location /echo { - echo_status 500; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 500 - - - -=== TEST 6: if location (500) ---- config - location /echo { - set $true 1; - if ($true) { - } - echo_status 500; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 500 - - - -=== TEST 7: if location (500) no inherit ---- config - location /echo { - set $true 1; - if ($true) { - echo_status 503; - } - echo_status 500; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 503 - - - -=== TEST 8: subrequest ---- config - location /echo { - echo_location /sub; - echo_status 503; - } - - location /sub { - echo blah blah; - } ---- request - GET /echo ---- response_body -blah blah ---- error_code: 503 - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest-async.t b/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest-async.t deleted file mode 100644 index 882b368..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest-async.t +++ /dev/null @@ -1,604 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (blocks() * 2 + 1); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -$ENV{TEST_NGINX_HTML_DIR} = html_dir; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity - GET ---- config - location /main { - echo_subrequest_async GET /sub; - } - location /sub { - echo "sub method: $echo_request_method"; - echo "main method: $echo_client_request_method"; - } ---- request - GET /main ---- response_body -sub method: GET -main method: GET - - - -=== TEST 2: sanity - DELETE ---- config - location /main { - echo_subrequest_async DELETE /sub; - } - location /sub { - echo "sub method: $echo_request_method"; - echo "main method: $echo_client_request_method"; - } ---- request - GET /main ---- response_body -sub method: DELETE -main method: GET - - - -=== TEST 3: trailing echo ---- config - location /main { - echo_subrequest_async GET /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello -after subrequest - - - -=== TEST 4: leading echo ---- config - location /main { - echo before subrequest; - echo_subrequest_async GET /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello - - - -=== TEST 5: leading & trailing echo ---- config - location /main { - echo before subrequest; - echo_subrequest_async GET /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello -after subrequest - - - -=== TEST 6: multiple subrequests ---- config - location /main { - echo before sr 1; - echo_subrequest_async GET /sub; - echo after sr 1; - echo before sr 2; - echo_subrequest_async GET /sub; - echo after sr 2; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before sr 1 -hello -after sr 1 -before sr 2 -hello -after sr 2 - - - -=== TEST 7: timed multiple subrequests (blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_subrequest_async GET /sub1; - echo_subrequest_async GET /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_blocking_sleep 0.02; - echo hello; - } - location /sub2 { - echo_blocking_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.00[0-5] sec for total\.$ - - - -=== TEST 8: timed multiple subrequests (non-blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_subrequest_async GET /sub1; - echo_subrequest_async GET /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 0.02; - echo hello; - } - location /sub2 { - echo_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.00[0-5] sec for total\.$ - - - -=== TEST 9: location with args ---- config - location /main { - echo_subrequest_async GET /sub -q 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 10: encoded chars in query strings ---- config - location /main { - echo_subrequest_async GET /sub -q 'foo=a%20b&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -a%20b Bar - - - -=== TEST 11: UTF-8 chars in query strings ---- config - location /main { - echo_subrequest_async GET /sub -q 'foo=你好'; - } - location /sub { - echo $arg_foo; - } ---- request - GET /main ---- response_body -你好 - - - -=== TEST 12: encoded chars in location url ---- config - location /main { - echo_subrequest_async GET /sub%31 -q 'foo=Foo&bar=Bar'; - } - location /sub%31 { - echo 'sub%31'; - } - location /sub1 { - echo 'sub1'; - } ---- request - GET /main ---- response_body -sub1 - - - -=== TEST 13: querystring in url ---- config - location /main { - echo_subrequest_async GET /sub?foo=Foo&bar=Bar; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 14: querystring in url *AND* an explicit querystring ---- config - location /main { - echo_subrequest_async GET /sub?foo=Foo&bar=Bar -q blah=Blah; - } - location /sub { - echo $arg_foo $arg_bar $arg_blah; - } ---- request - GET /main ---- response_body - Blah - - - -=== TEST 15: explicit flush in main request -flush won't really flush the buffer... ---- config - location /main_flush { - echo 'pre main'; - echo_subrequest_async GET /sub; - echo 'post main'; - echo_flush; - } - - location /sub { - echo_sleep 0.02; - echo 'sub'; - } ---- request - GET /main_flush ---- response_body -pre main -sub -post main - - - -=== TEST 16: POST subrequest with body (with proxy in the middle) and without read body explicitly ---- config - location /main { - echo_subrequest_async POST /proxy -b 'hello, world'; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method."; - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo "sub body: $echo_request_body."; - } ---- request - GET /main ---- response_body -sub method: POST. -sub body: . - - - -=== TEST 17: POST subrequest with body (with proxy in the middle) and read body explicitly ---- config - location /main { - echo_subrequest_async POST /proxy -b 'hello, world'; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method."; - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo_read_request_body; - echo "sub body: $echo_request_body."; - } ---- request - GET /main ---- response_body -sub method: POST. -sub body: hello, world. - - - -=== TEST 18: multiple subrequests ---- config - location /multi { - echo_subrequest_async POST '/sub' -q 'foo=Foo' -b 'hi'; - echo_subrequest_async PUT '/sub' -q 'bar=Bar' -b 'hello'; - } - location /sub { - echo "querystring: $query_string"; - echo "method: $echo_request_method"; - echo "body: $echo_request_body"; - echo "content length: $http_content_length"; - echo '///'; - } ---- request - GET /multi ---- response_body -querystring: foo=Foo -method: POST -body: hi -content length: 2 -/// -querystring: bar=Bar -method: PUT -body: hello -content length: 5 -/// - - - -=== TEST 19: no varaiable inheritance ---- config - location /main { - echo $echo_cacheable_request_uri; - echo_subrequest_async GET /sub; - echo_subrequest_async GET /sub2; - } - location /sub { - echo $echo_cacheable_request_uri; - } - location /sub2 { - echo $echo_cacheable_request_uri; - } - ---- request - GET /main ---- response_body -/main -/sub -/sub2 - - - -=== TEST 20: unsafe uri ---- config - location /unsafe { - echo_subrequest_async GET '/../foo'; - } ---- request - GET /unsafe ---- ignore_response ---- error_log -echo_subrequest_async sees unsafe uri: "/../foo" ---- no_error_log -[error] -[alert] - - - -=== TEST 21: let subrequest to read the main request's request body ---- SKIP ---- config - location /main { - echo_subrequest_async POST /sub; - } - location /sub { - echo_read_request_body; - echo_request_body; - } ---- request -POST /main -hello, body! ---- response_body chomp -hello, body! - - - -=== TEST 22: POST subrequest with file body (relative paths) ---- config - location /main { - echo_subrequest_async POST /sub -f html/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world ---- request - GET /main ---- response_body -sub method: POST -Hello, world - - - -=== TEST 23: POST subrequest with file body (absolute paths) ---- config - location /main { - echo_subrequest_async POST /sub -f $TEST_NGINX_HTML_DIR/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world! -Haha ---- request - GET /main ---- response_body -sub method: POST -Hello, world! -Haha - - - -=== TEST 24: POST subrequest with file body (file not found) ---- config - location /main { - echo_subrequest_async POST /sub -f html/blah/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world ---- request - GET /main ---- ignore_response ---- error_log eval -qr/open\(\) ".*?" failed/ ---- no_error_log -[alert] - - - -=== TEST 25: POST subrequest with file body (absolute paths in vars) ---- config - location /main { - set $path $TEST_NGINX_HTML_DIR/blah.txt; - echo_subrequest_async POST /sub -f $path; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world! -Haha ---- request - GET /main ---- response_body -sub method: POST -Hello, world! -Haha - - - -=== TEST 26: leading subrequest & echo_before_body ---- config - location /main { - echo_before_body hello; - echo_subrequest_async GET /foo; - } - location /foo { - echo world; - } ---- request - GET /main ---- response_body -hello -world - - - -=== TEST 27: leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_subrequest_async GET /foo; - } - location /foo { - echo -n world; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world); - - - -=== TEST 28: multiple leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_subrequest_async GET /foo; - echo_subrequest_async GET /bar; - } - location /foo { - echo -n world; - } - location /bar { - echo -n ' people'; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world people); - - - -=== TEST 29: sanity (HEAD) ---- config - location /main { - echo_subrequest_async GET /sub; - echo_subrequest_async GET /sub; - } - location /sub { - echo hello; - } ---- request - HEAD /main ---- response_body - - - -=== TEST 30: HEAD subrequest ---- config - location /main { - echo_subrequest_async HEAD /sub; - echo_subrequest_async HEAD /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest.t b/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest.t deleted file mode 100644 index 6d965d0..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest.t +++ /dev/null @@ -1,725 +0,0 @@ -# vi:filetype= - -use lib 'lib'; - -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -$ENV{TEST_NGINX_HTML_DIR} = html_dir; -$ENV{TEST_NGINX_CLIENT_PORT} ||= server_port(); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo_subrequest GET /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 2: trailing echo ---- config - location /main { - echo_subrequest GET /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello -after subrequest - - - -=== TEST 3: leading echo ---- config - location /main { - echo before subrequest; - echo_subrequest GET /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello - - - -=== TEST 4: leading & trailing echo ---- config - location /main { - echo before subrequest; - echo_subrequest GET /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello -after subrequest - - - -=== TEST 5: multiple subrequests ---- config - location /main { - echo before sr 1; - echo_subrequest GET /sub; - echo after sr 1; - echo before sr 2; - echo_subrequest GET /sub; - echo after sr 2; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before sr 1 -hello -after sr 1 -before sr 2 -hello -after sr 2 - - - -=== TEST 6: timed multiple subrequests (blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_subrequest GET /sub1; - echo_subrequest GET /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_blocking_sleep 0.02; - echo hello; - } - location /sub2 { - echo_blocking_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.0(?:2[5-9]|3[0-6]) sec for total\.$ - - - -=== TEST 7: timed multiple subrequests (non-blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_subrequest GET /sub1; - echo_subrequest GET /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 0.02; - echo hello; - } - location /sub2 { - echo_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.0(?:2[5-9]|3[0-6]) sec for total\.$ - - - -=== TEST 8: location with args ---- config - location /main { - echo_subrequest GET /sub -q 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 9: chained subrequests ---- config - location /main { - echo 'pre main'; - echo_subrequest GET /sub; - echo 'post main'; - } - - location /sub { - echo 'pre sub'; - echo_subrequest GET /subsub; - echo 'post sub'; - } - - location /subsub { - echo 'subsub'; - } ---- request - GET /main ---- response_body -pre main -pre sub -subsub -post sub -post main - - - -=== TEST 10: chained subrequests using named locations -as of 0.8.20, ngx_http_subrequest still does not support -named location. sigh. this case is a TODO. ---- config - location /main { - echo 'pre main'; - echo_subrequest GET @sub; - echo 'post main'; - } - - location @sub { - echo 'pre sub'; - echo_subrequest GET @subsub; - echo 'post sub'; - } - - location @subsub { - echo 'subsub'; - } ---- request - GET /main ---- response_body -pre main -pre sub -subsub -post sub -post main ---- SKIP - - - -=== TEST 11: explicit flush in main request ---- config - location /main { - echo 'pre main'; - echo_subrequest GET /sub; - echo 'post main'; - echo_flush; - } - - location /sub { - echo_sleep 0.02; - echo 'sub'; - } ---- request - GET /main ---- response_body -pre main -sub -post main - - - -=== TEST 12: DELETE subrequest ---- config - location /main { - echo_subrequest DELETE /sub; - } - location /sub { - echo "sub method: $echo_request_method"; - echo "main method: $echo_client_request_method"; - } ---- request - GET /main ---- response_body -sub method: DELETE -main method: GET - - - -=== TEST 13: DELETE subrequest ---- config - location /main { - echo "main method: $echo_client_request_method"; - echo_subrequest GET /proxy; - echo_subrequest DELETE /proxy; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method"; - } ---- request - GET /main ---- response_body -main method: GET -sub method: GET -sub method: DELETE - - - -=== TEST 14: POST subrequest with body ---- config - location /main { - echo_subrequest POST /sub -b 'hello, world'; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo "sub body: $echo_request_body"; - } ---- request - GET /main ---- response_body -sub method: POST -sub body: hello, world - - - -=== TEST 15: POST subrequest with body (explicitly read the body) ---- config - location /main { - echo_subrequest POST /sub -b 'hello, world'; - } - location /sub { - echo "sub method: $echo_request_method"; - # we call echo_read_client_body explicitly here even - # though it's not necessary. - echo_read_request_body; - echo "sub body: $echo_request_body"; - } ---- request - GET /main ---- response_body -sub method: POST -sub body: hello, world - - - -=== TEST 16: POST subrequest with body (with proxy in the middle) and without read body explicitly ---- config - location /main { - echo_subrequest POST /proxy -b 'hello, world'; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method."; - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo "sub body: $echo_request_body."; - } ---- request - GET /main ---- response_body -sub method: POST. -sub body: . - - - -=== TEST 17: POST subrequest with body (with proxy in the middle) and read body explicitly ---- config - location /main { - echo_subrequest POST /proxy -b 'hello, world'; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method."; - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo_read_request_body; - echo "sub body: $echo_request_body."; - } ---- request - GET /main ---- response_body -sub method: POST. -sub body: hello, world. - - - -=== TEST 18: multiple subrequests ---- config - location /multi { - echo_subrequest POST '/sub' -q 'foo=Foo' -b 'hi'; - echo_subrequest PUT '/sub' -q 'bar=Bar' -b 'hello'; - } - location /sub { - echo "querystring: $query_string"; - echo "method: $echo_request_method"; - echo "body: $echo_request_body"; - echo "content length: $http_content_length"; - echo '///'; - } ---- request - GET /multi ---- response_body -querystring: foo=Foo -method: POST -body: hi -content length: 2 -/// -querystring: bar=Bar -method: PUT -body: hello -content length: 5 -/// - - - -=== TEST 19: unsafe uri ---- config - location /unsafe { - echo_subrequest GET '/../foo'; - } ---- request - GET /unsafe ---- ignore_response ---- error_log -echo_subrequest sees unsafe uri: "/../foo" ---- no_error_log -[error] - - - -=== TEST 20: querystring in url ---- config - location /main { - echo_subrequest GET /sub?foo=Foo&bar=Bar; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 21: querystring in url *AND* an explicit querystring ---- config - location /main { - echo_subrequest GET /sub?foo=Foo&bar=Bar -q blah=Blah; - } - location /sub { - echo $arg_foo $arg_bar $arg_blah; - } ---- request - GET /main ---- response_body - Blah - - - -=== TEST 22: let subrequest to read the main request's request body ---- SKIP ---- config - location /main { - echo_subrequest POST /sub; - } - location /sub { - echo_read_request_body; - echo_request_body; - } ---- request -POST /main -hello, body! ---- response_body chomp -hello, body! - - - -=== TEST 23: deep nested echo_subrequest/echo_subrequest_async ---- config - location /main { - echo_subrequest GET /bar; - echo_subrequest_async GET /bar; - echo_subrequest_async GET /bar; - echo_subrequest GET /group; - echo_subrequest_async GET /group; - } - - location /group { - echo_subrequest GET /bar; - echo_subrequest_async GET /bar; - } - - location /bar { - echo $echo_incr; - } ---- request -GET /main ---- response_body -1 -2 -3 -4 -5 -6 -7 - - - -=== TEST 24: deep nested echo_subrequest/echo_subrequest_async ---- config - location /main { - echo_subrequest GET /bar?a; - echo_subrequest_async GET /bar?b; - echo_subrequest_async GET /bar?c; - echo_subrequest GET /group?a=d&b=e; - echo_subrequest_async GET /group?a=f&b=g; - } - - location /group { - echo_subrequest GET /bar?$arg_a; - echo_subrequest_async GET /bar?$arg_b; - } - - location /bar { - echo -n $query_string; - } ---- request -GET /main ---- response_body: abcdefg ---- timeout: 2 - - - -=== TEST 25: POST subrequest with file body (relative paths) ---- config - location /main { - echo_subrequest POST /sub -f html/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world ---- request - GET /main ---- response_body -sub method: POST -Hello, world - - - -=== TEST 26: POST subrequest with file body (absolute paths) ---- config - location /main { - echo_subrequest POST /sub -f $TEST_NGINX_HTML_DIR/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world! -Haha ---- request - GET /main ---- response_body -sub method: POST -Hello, world! -Haha - - - -=== TEST 27: POST subrequest with file body (file not found) ---- config - location /main { - echo_subrequest POST /sub -f html/blah/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world ---- request - GET /main ---- ignore_response ---- error_log eval -qr/open\(\) ".*?" failed/ ---- no_error_log -[alert] - - - -=== TEST 28: leading subrequest & echo_before_body ---- config - location /main { - echo_before_body hello; - echo_subrequest GET /foo; - } - location /foo { - echo world; - } ---- request - GET /main ---- response_body -hello -world - - - -=== TEST 29: leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_subrequest GET /foo; - } - location /foo { - echo -n world; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world); - - - -=== TEST 30: multiple leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_subrequest GET /foo; - echo_subrequest GET /bar; - } - location /foo { - echo -n world; - } - location /bar { - echo -n ' people'; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world people); - - - -=== TEST 31: sanity (HEAD) ---- config - location /main { - echo_subrequest GET /sub; - echo_subrequest GET /sub; - } - location /sub { - echo hello; - } ---- request - HEAD /main ---- response_body - - - -=== TEST 32: POST subrequest to ngx_proxy ---- config - location /hello { - default_type text/plain; - echo_subrequest POST '/proxy' -q 'foo=Foo&bar=baz' -b 'request_body=test&test=3'; - } - - location /proxy { - proxy_pass http://127.0.0.1:$TEST_NGINX_CLIENT_PORT/sub; - #proxy_pass http://127.0.0.1:1113/sub; - } - - location /sub { - echo_read_request_body; - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo "sub body: $echo_request_body"; - } ---- request - GET /hello ---- response_body -sub method: POST -sub body: request_body=test&test=3 - - - -=== TEST 33: HEAD subrequest ---- config - location /main { - echo_subrequest HEAD /sub; - echo_subrequest HEAD /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body - - - -=== TEST 34: method name as an nginx variable (github issue #34) ---- config - location ~ ^/delay/(?[0-9.]+)/(?.*)$ { - # echo_blocking_sleep $delay; - echo_subrequest '$echo_request_method' '/$originalURL' -q '$args'; - } - - location /api { - echo "args: $args"; - } ---- request - GET /delay/0.343/api/?a=b ---- response_body -args: a=b ---- no_error_log -[error] - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/unused.t b/modules_deb/libnginx-mod-http-echo-0.63/t/unused.t deleted file mode 100644 index f3c6e9e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/unused.t +++ /dev/null @@ -1,119 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (5 * blocks()); - -no_long_string(); -log_level('warn'); - -#master_on(); -#workers(1); - -run_tests(); - -__DATA__ - -=== TEST 1: filters used ---- http_config - postpone_output 1; ---- config - location /echo { - echo world; - echo_after_body hello; - } ---- request - GET /echo?blah ---- response_body -world -hello ---- error_log -echo header filter, uri "/echo?blah" -echo body filter, uri "/echo?blah" ---- no_error_log -[error] ---- log_level: debug - - - -=== TEST 2: filters not used ---- http_config - postpone_output 1; ---- config - location /echo { - echo world; - #echo_after_body hello; - } ---- request - GET /echo?blah ---- response_body -world ---- no_error_log -echo header filter, uri "/echo?blah" -echo body filter, uri "/echo?blah" -[error] ---- log_level: debug - - - -=== TEST 3: (after) filters used (multiple http {} blocks) -This test case won't run with nginx 1.9.3+ since duplicate http {} blocks -have been prohibited since then. ---- SKIP ---- http_config - postpone_output 1; ---- config - location /echo { - echo world; - echo_after_body hello; - } - ---- post_main_config - http { - } - ---- request - GET /echo?blah ---- response_body -world -hello ---- error_log -echo header filter, uri "/echo?blah" -echo body filter, uri "/echo?blah" ---- no_error_log -[error] ---- log_level: debug - - - -=== TEST 4: (before) filters used (multiple http {} blocks) -This test case won't run with nginx 1.9.3+ since duplicate http {} blocks -have been prohibited since then. ---- SKIP ---- http_config - postpone_output 1; ---- config - location /echo { - echo world; - echo_before_body hello; - } - ---- post_main_config - http { - } - ---- request - GET /echo?blah ---- response_body -hello -world ---- error_log -echo header filter, uri "/echo?blah" -echo body filter, uri "/echo?blah" ---- no_error_log -[error] ---- log_level: debug - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/util/build.sh b/modules_deb/libnginx-mod-http-echo-0.63/util/build.sh deleted file mode 100755 index 45949bb..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/util/build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# this file is mostly meant to be used by the author himself. - -root=`pwd` -version=$1 -force=$2 -home=~ - - #--with-cc=gcc46 \ - -ngx-build $force $version \ - --with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB:/usr/local/lib" \ - --with-cc-opt="-DDEBUG_MALLOC" \ - --with-http_stub_status_module \ - --with-http_image_filter_module \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --without-http_upstream_ip_hash_module \ - --without-http_memcached_module \ - --without-http_referer_module \ - --without-http_autoindex_module \ - --without-http_auth_basic_module \ - --without-http_userid_module \ - --add-module=$root/../ndk-nginx-module \ - --add-module=$root/../set-misc-nginx-module \ - --add-module=$root/../eval-nginx-module \ - --add-module=$root/../xss-nginx-module \ - --add-module=$root/../rds-json-nginx-module \ - --add-module=$root/../headers-more-nginx-module \ - --add-module=$root/../lua-nginx-module \ - --add-module=$root $opts \ - --with-http_v2_module \ - --with-select_module \ - --with-poll_module \ - --without-http_ssi_module \ - --with-debug || exit 1 - #--add-module=$root/../lz-session-nginx-module \ - #--add-module=$home/work/ndk \ - #--add-module=$home/work/ndk/examples/http/set_var \ - #--add-module=$root/../eval-nginx-module \ - #--add-module=/home/agentz/work/nginx_eval_module-1.0.1 \ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/util/wiki2pod.pl b/modules_deb/libnginx-mod-http-echo-0.63/util/wiki2pod.pl deleted file mode 100644 index cdd33a2..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/util/wiki2pod.pl +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use bytes; - -my @nl_counts; -my $last_nl_count_level; - -my @bl_counts; -my $last_bl_count_level; - -sub fmt_pos ($) { - (my $s = $_[0]) =~ s{\#(.*)}{/"$1"}; - $s; -} - -sub fmt_mark ($$) { - my ($tag, $s) = @_; - my $max_level = 0; - while ($s =~ /([<>])\1*/g) { - my $level = length $&; - if ($level > $max_level) { - $max_level = $level; - } - } - - my $times = $max_level + 1; - if ($times > 1) { - $s = " $s "; - } - return $tag . ('<' x $times) . $s . ('>' x $times); -} - -print "=encoding utf-8\n\n"; - -while (<>) { - if ($. == 1) { - # strip the leading U+FEFF byte in MS-DOS text files - my $first = ord(substr($_, 0, 1)); - #printf STDERR "0x%x", $first; - #my $second = ord(substr($_, 2, 1)); - #printf STDERR "0x%x", $second; - if ($first == 0xEF) { - substr($_, 0, 1, ''); - #warn "Hit!"; - } - } - s{\[(http[^ \]]+) ([^\]]*)\]}{$2 (L<$1>)}gi; - s{ \[\[ ( [^\]\|]+ ) \| ([^\]]*) \]\] }{"L<$2|" . fmt_pos($1) . ">"}gixe; - s{(.*?)}{fmt_mark('C', $1)}gie; - s{'''(.*?)'''}{fmt_mark('B', $1)}ge; - s{''(.*?)''}{fmt_mark('I', $1)}ge; - if (s{^\s*<[^>]+>\s*$}{}) { - next; - } - - if (/^\s*$/) { - print "\n"; - next; - } - -=begin cmt - - if ($. == 1) { - warn $_; - for my $i (0..length($_) - 1) { - my $chr = substr($_, $i, 1); - warn "chr ord($i): ".ord($chr)." \"$chr\"\n"; - } - } - -=end cmt -=cut - - if (/(=+) (.*) \1$/) { - #warn "HERE! $_" if $. == 1; - my ($level, $title) = (length $1, $2); - collapse_lists(); - - print "\n=head$level $title\n\n"; - } elsif (/^(\#+) (.*)/) { - my ($level, $txt) = (length($1) - 1, $2); - if (defined $last_nl_count_level && $level != $last_nl_count_level) { - print "\n=back\n\n"; - } - $last_nl_count_level = $level; - $nl_counts[$level] ||= 0; - if ($nl_counts[$level] == 0) { - print "\n=over\n\n"; - } - $nl_counts[$level]++; - print "\n=item $nl_counts[$level].\n\n"; - print "$txt\n"; - } elsif (/^(\*+) (.*)/) { - my ($level, $txt) = (length($1) - 1, $2); - if (defined $last_bl_count_level && $level != $last_bl_count_level) { - print "\n=back\n\n"; - } - $last_bl_count_level = $level; - $bl_counts[$level] ||= 0; - if ($bl_counts[$level] == 0) { - print "\n=over\n\n"; - } - $bl_counts[$level]++; - print "\n=item *\n\n"; - print "$txt\n"; - } else { - collapse_lists(); - print; - } -} - -collapse_lists(); - -sub collapse_lists { - while (defined $last_nl_count_level && $last_nl_count_level >= 0) { - print "\n=back\n\n"; - $last_nl_count_level--; - } - undef $last_nl_count_level; - undef @nl_counts; - - while (defined $last_bl_count_level && $last_bl_count_level >= 0) { - print "\n=back\n\n"; - $last_bl_count_level--; - } - undef $last_bl_count_level; - undef @bl_counts; -} - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/valgrind.suppress b/modules_deb/libnginx-mod-http-echo-0.63/valgrind.suppress deleted file mode 100644 index 975415e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/valgrind.suppress +++ /dev/null @@ -1,53 +0,0 @@ -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle - fun:main -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_worker_process_init - fun:ngx_worker_process_cycle -} diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/LICENSE b/modules_deb/libnginx-mod-http-geoip2-3.4/LICENSE deleted file mode 100644 index fdc13a7..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2014, Lee Valentine -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/README.md b/modules_deb/libnginx-mod-http-geoip2-3.4/README.md deleted file mode 100644 index cea0d04..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/README.md +++ /dev/null @@ -1,153 +0,0 @@ -Description -=========== - -**ngx_http_geoip2_module** - creates variables with values from the maxmind geoip2 databases based on the client IP (default) or from a specific variable (supports both IPv4 and IPv6) - -The module now supports nginx streams and can be used in the same way the http module can be used. - -## Installing -First install [libmaxminddb](https://github.com/maxmind/libmaxminddb) as described in its [README.md -file](https://github.com/maxmind/libmaxminddb/blob/main/README.md#installing-from-a-tarball). - -#### Download nginx source -``` -wget http://nginx.org/download/nginx-VERSION.tar.gz -tar zxvf nginx-VERSION.tar.gz -cd nginx-VERSION -``` - -##### To build as a dynamic module (nginx 1.9.11+): -``` -./configure --add-dynamic-module=/path/to/ngx_http_geoip2_module -make -make install -``` - -This will produce ```objs/ngx_http_geoip2_module.so```. It can be copied to your nginx module path manually if you wish. - -Add the following line to your nginx.conf: -``` -load_module modules/ngx_http_geoip2_module.so; -``` - -##### To build as a static module: -``` -./configure --add-module=/path/to/ngx_http_geoip2_module -make -make install -``` - -##### If you need stream support, make sure to compile with stream: -``` -./configure --add-dynamic-module=/path/to/ngx_http_geoip2_module --with-stream -OR -./configure --add-module=/path/to/ngx_http_geoip2_module --with-stream -``` - - -## Download Maxmind GeoLite2 Database (optional) -The free GeoLite2 databases are available from [Maxminds website](http://dev.maxmind.com/geoip/geoip2/geolite2/) (requires signing up) - -## Example Usage: -``` -http { - ... - geoip2 /etc/maxmind-country.mmdb { - auto_reload 5m; - $geoip2_metadata_country_build metadata build_epoch; - $geoip2_data_country_code default=US source=$variable_with_ip country iso_code; - $geoip2_data_country_name country names en; - } - - geoip2 /etc/maxmind-city.mmdb { - $geoip2_data_city_name default=London city names en; - } - .... - - fastcgi_param COUNTRY_CODE $geoip2_data_country_code; - fastcgi_param COUNTRY_NAME $geoip2_data_country_name; - fastcgi_param CITY_NAME $geoip2_data_city_name; - .... -} - -stream { - ... - geoip2 /etc/maxmind-country.mmdb { - $geoip2_data_country_code default=US source=$remote_addr country iso_code; - } - ... -} -``` - -##### Metadata: -Retrieve metadata regarding the geoip database. -``` -$variable_name metadata -``` -Available fields: - - build_epoch: the build timestamp of the maxmind database. - - last_check: the last time the database was checked for changes (when using auto_reload) - - last_change: the last time the database was reloaded (when using auto_reload) - -##### Autoreload (default: disabled): -Enabling auto reload will have nginx check the modification time of the database at the specified -interval and reload it if it has changed. -``` -auto_reload -``` - -##### GeoIP: -``` -$variable_name [default= - "iso_code": - "US" - "names": - { - "de": - "USA" - "en": - "United States" - } - } - } - -$ mmdblookup --file /usr/share/GeoIP/GeoIP2-Country.mmdb --ip 8.8.8.8 country names en - - "United States" -``` - -This translates to: - -``` -$country_name "default=United States" source=$remote_addr country names en -``` - -##### Additional Commands: -These commands works the same as the original ngx_http_geoip_module documented here: http://nginx.org/en/docs/http/ngx_http_geoip_module.html#geoip_proxy. - -However, if you provide the `source=$variable_with_ip` option on a variable, these settings will be ignored for that particular variable. - -``` -geoip2_proxy < cidr > -``` -Defines trusted addresses. When a request comes from a trusted address, an address from the "X-Forwarded-For" request header field will be used instead. - -``` -geoip2_proxy_recursive < on | off > -``` -If recursive search is disabled then instead of the original client address that matches one of the trusted addresses, the last address sent in "X-Forwarded-For" will be used. If recursive search is enabled then instead of the original client address that matches one of the trusted addresses, the last non-trusted address sent in "X-Forwarded-For" will be used. diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/config b/modules_deb/libnginx-mod-http-geoip2-3.4/config deleted file mode 100644 index 48bf15d..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/config +++ /dev/null @@ -1,43 +0,0 @@ -ngx_feature="MaxmindDB library" -ngx_feature_name= -ngx_feature_run=no -ngx_feature_incs="#include " -ngx_feature_libs=-lmaxminddb -ngx_feature_test="MMDB_s mmdb" -. auto/feature - -ngx_addon_name="ngx_geoip2_module" - -if [ $ngx_found = yes ]; then - if test -n "$ngx_module_link"; then - if [ $HTTP != NO ]; then - ngx_module_type=HTTP - ngx_module_name="ngx_http_geoip2_module" - ngx_module_incs= - ngx_module_deps= - ngx_module_srcs="$ngx_addon_dir/ngx_http_geoip2_module.c" - ngx_module_libs="$ngx_feature_libs" - . auto/module - fi - - nginx_version=`awk '/^#define nginx_version / {print $3}' src/core/nginx.h` - if [ $STREAM != NO -a $nginx_version -gt 1011001 ]; then - ngx_module_type=STREAM - ngx_module_name="ngx_stream_geoip2_module" - ngx_module_incs= - ngx_module_deps= - ngx_module_srcs="$ngx_addon_dir/ngx_stream_geoip2_module.c" - ngx_module_libs="$ngx_feature_libs" - . auto/module - fi - else - HTTP_MODULES="$HTTP_MODULES ngx_http_geoip2_module" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_geoip2_module.c" - CORE_LIBS="$CORE_LIBS $ngx_feature_libs" - fi -else - cat << END -$0: error: the geoip2 module requires the maxminddb library. -END - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/changelog b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/changelog deleted file mode 100644 index 0c0f22e..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/changelog +++ /dev/null @@ -1,52 +0,0 @@ -libnginx-mod-http-geoip2 (1:3.4-6) unstable; urgency=medium - - * d/control: update my email to janmojzis@debian.org - * d/copyright: update my email to janmojzis@debian.org - * d/control: bump Standards-Version: 4.7.2, no changes - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:59 +0200 - -libnginx-mod-http-geoip2 (1:3.4-5) unstable; urgency=medium - - * Better usage of dh-sequence-nginx - * d/rules: remove override_dh_auto_configure, override_dh_auto_test - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - * d/control: use Build-Depends libnginx-mod-stream instead of - libnginx-mod-stream (<<1.24.0.1~), libnginx-mod-stream (>=1.24.0) - * d/control: use Build-Depends nginx-dev (>= 1.24.0-2) - * d/control: remove Depends libnginx-mod-stream (<<1.24.0.1~), - libnginx-mod-stream (>=1.24.0) - - -- Jan Mojžíš Wed, 11 Oct 2023 07:37:12 +0200 - -libnginx-mod-http-geoip2 (1:3.4-4) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:38 +0200 - -libnginx-mod-http-geoip2 (1:3.4-3) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: bump my copyright year - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:24 +0100 - -libnginx-mod-http-geoip2 (1:3.4-2) unstable; urgency=medium - - * d/control: added Multi-Arch: foreign - - -- Jan Mojžíš Fri, 09 Dec 2022 12:50:27 +0100 - -libnginx-mod-http-geoip2 (1:3.4-1) experimental; urgency=medium - - * Initial release. (Closes: 1024843) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:51 +0100 diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/control b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/control deleted file mode 100644 index 3ccc4e3..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/control +++ /dev/null @@ -1,41 +0,0 @@ -Source: libnginx-mod-http-geoip2 -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, - libmaxminddb-dev, - libnginx-mod-stream, - nginx-dev (>= 1.24.0-2), -Standards-Version: 4.7.2 -Homepage: https://github.com/leev/ngx_http_geoip2_module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-geoip2.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-geoip2 -Rules-Requires-Root: no - -Package: libnginx-mod-http-geoip2 -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: GeoIP2 HTTP module for Nginx - The ngx_http_geoip2 module creates variables with values depending on the - client IP address, using the precompiled MaxMind GeoIP2 databases. - . - Those variables include country, region, city, latitude, longitude, postal - code, etc. - -Package: libnginx-mod-stream-geoip2 -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: GeoIP2 Stream module for Nginx - The ngx_stream_geoip2 module creates variables with values depending on the - client IP address, using the precompiled MaxMind GeoIP2 databases. - . - Those variables include country, region, city, latitude, longitude, postal - code, etc. diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/copyright b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/copyright deleted file mode 100644 index ab01158..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/copyright +++ /dev/null @@ -1,46 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ngx_http_geoip2_module -Upstream-Contact: Lee Valentine -Source: https://github.com/leev/ngx_http_geoip2_module - -Files: * -Copyright: 2014, Lee Valentine -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: ngx_http_geoip2_module.c -Copyright: Lee Valentine -License: BSD-2-clause - -Files: ngx_stream_geoip2_module.c -Copyright: Lee Valentine - Andrei Belov -License: BSD-2-clause - -License: BSD-2-clause - All rights reserved. - . - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - . - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/gbp.conf b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/gbp.conf deleted file mode 100644 index 38c12c1..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/gbp.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-http-geoip2.install b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-http-geoip2.install deleted file mode 100644 index 2692817..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-http-geoip2.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ngx_http_geoip2_module.so diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-stream-geoip2.install b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-stream-geoip2.install deleted file mode 100644 index 9f45e96..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-stream-geoip2.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ngx_stream_geoip2_module.so diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/rules b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/source/format b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/control b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/control deleted file mode 100644 index ca20b9f..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/control +++ /dev/null @@ -1,6 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/generic b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/upstream/metadata b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/upstream/metadata deleted file mode 100644 index 5f50585..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/leev/ngx_http_geoip2_module/issues -Bug-Submit: https://github.com/leev/ngx_http_geoip2_module/issues/new -Repository-Browse: https://github.com/leev/ngx_http_geoip2_module \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/watch b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/watch deleted file mode 100644 index 04e3a51..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/leev/ngx_http_geoip2_module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_http_geoip2_module.c b/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_http_geoip2_module.c deleted file mode 100644 index 4b3461c..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_http_geoip2_module.c +++ /dev/null @@ -1,803 +0,0 @@ -/* - * Copyright (C) Lee Valentine - * - * Based on nginx's 'ngx_http_geoip_module.c' by Igor Sysoev - */ - - -#include -#include -#include - -#include - - -typedef struct { - MMDB_s mmdb; - MMDB_lookup_result_s result; - time_t last_check; - time_t last_change; - time_t check_interval; -#if (NGX_HAVE_INET6) - uint8_t address[16]; -#else - unsigned long address; -#endif - ngx_queue_t queue; -} ngx_http_geoip2_db_t; - -typedef struct { - ngx_queue_t databases; - ngx_array_t *proxies; - ngx_flag_t proxy_recursive; -} ngx_http_geoip2_conf_t; - -typedef struct { - ngx_http_geoip2_db_t *database; - const char **lookup; - ngx_str_t default_value; - ngx_http_complex_value_t source; -} ngx_http_geoip2_ctx_t; - -typedef struct { - ngx_http_geoip2_db_t *database; - ngx_str_t metavalue; -} ngx_http_geoip2_metadata_t; - - -static ngx_int_t ngx_http_geoip2_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); -static ngx_int_t ngx_http_geoip2_metadata(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); -static void *ngx_http_geoip2_create_conf(ngx_conf_t *cf); -static char *ngx_http_geoip2_init_conf(ngx_conf_t *cf, void *conf); -static char *ngx_http_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, - void *conf); -static char *ngx_http_geoip2_add_variable(ngx_conf_t *cf, ngx_command_t *dummy, - void *conf); -static char *ngx_http_geoip2_add_variable_geodata(ngx_conf_t *cf, - ngx_http_geoip2_db_t *database); -static char *ngx_http_geoip2_add_variable_metadata(ngx_conf_t *cf, - ngx_http_geoip2_db_t *database); -static char *ngx_http_geoip2_proxy(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static ngx_int_t ngx_http_geoip2_cidr_value(ngx_conf_t *cf, ngx_str_t *net, - ngx_cidr_t *cidr); -static void ngx_http_geoip2_cleanup(void *data); -static ngx_int_t ngx_http_geoip2_init(ngx_conf_t *cf); - - -#define FORMAT(fmt, ...) do { \ - p = ngx_palloc(r->pool, NGX_OFF_T_LEN); \ - if (p == NULL) { \ - return NGX_ERROR; \ - } \ - v->len = ngx_sprintf(p, fmt, __VA_ARGS__) - p; \ - v->data = p; \ -} while (0) - -static ngx_command_t ngx_http_geoip2_commands[] = { - - { ngx_string("geoip2"), - NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE1, - ngx_http_geoip2, - NGX_HTTP_MAIN_CONF_OFFSET, - 0, - NULL }, - - { ngx_string("geoip2_proxy"), - NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, - ngx_http_geoip2_proxy, - NGX_HTTP_MAIN_CONF_OFFSET, - 0, - NULL }, - - { ngx_string("geoip2_proxy_recursive"), - NGX_HTTP_MAIN_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_MAIN_CONF_OFFSET, - offsetof(ngx_http_geoip2_conf_t, proxy_recursive), - NULL }, - - ngx_null_command -}; - - -static ngx_http_module_t ngx_http_geoip2_module_ctx = { - NULL, /* preconfiguration */ - ngx_http_geoip2_init, /* postconfiguration */ - - ngx_http_geoip2_create_conf, /* create main configuration */ - ngx_http_geoip2_init_conf, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - NULL, /* create location configuration */ - NULL /* merge location configuration */ -}; - - -ngx_module_t ngx_http_geoip2_module = { - NGX_MODULE_V1, - &ngx_http_geoip2_module_ctx, /* module context */ - ngx_http_geoip2_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static ngx_int_t -ngx_http_geoip2_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) -{ - ngx_http_geoip2_ctx_t *geoip2 = (ngx_http_geoip2_ctx_t *) data; - ngx_http_geoip2_db_t *database = geoip2->database; - int mmdb_error; - MMDB_entry_data_s entry_data; - ngx_http_geoip2_conf_t *gcf; - ngx_addr_t addr; -#if defined(nginx_version) && nginx_version >= 1023000 - ngx_table_elt_t *xfwd; -#else - ngx_array_t *xfwd; -#endif - u_char *p; - ngx_str_t val; - -#if (NGX_HAVE_INET6) - uint8_t address[16], *addressp = address; -#else - unsigned long address; -#endif - - if (geoip2->source.value.len > 0) { - if (ngx_http_complex_value(r, &geoip2->source, &val) != NGX_OK) { - goto not_found; - } - - if (ngx_parse_addr(r->pool, &addr, val.data, val.len) != NGX_OK) { - goto not_found; - } - } else { - gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip2_module); - addr.sockaddr = r->connection->sockaddr; - addr.socklen = r->connection->socklen; - -#if defined(nginx_version) && nginx_version >= 1023000 - xfwd = r->headers_in.x_forwarded_for; - - if (xfwd != NULL && gcf->proxies != NULL) { -#else - xfwd = &r->headers_in.x_forwarded_for; - - if (xfwd->nelts > 0 && gcf->proxies != NULL) { -#endif - (void) ngx_http_get_forwarded_addr(r, &addr, xfwd, NULL, - gcf->proxies, gcf->proxy_recursive); - } - } - - switch (addr.sockaddr->sa_family) { - case AF_INET: -#if (NGX_HAVE_INET6) - ngx_memset(addressp, 0, 12); - ngx_memcpy(addressp + 12, &((struct sockaddr_in *) - addr.sockaddr)->sin_addr.s_addr, 4); - break; - - case AF_INET6: - ngx_memcpy(addressp, &((struct sockaddr_in6 *) - addr.sockaddr)->sin6_addr.s6_addr, 16); -#else - address = ((struct sockaddr_in *)addr.sockaddr)->sin_addr.s_addr; -#endif - break; - - default: - goto not_found; - } - -#if (NGX_HAVE_INET6) - if (ngx_memcmp(&address, &database->address, sizeof(address)) - != 0) { -#else - if (address != database->address) { -#endif - memcpy(&database->address, &address, sizeof(address)); - database->result = MMDB_lookup_sockaddr(&database->mmdb, - addr.sockaddr, &mmdb_error); - - if (mmdb_error != MMDB_SUCCESS) { - goto not_found; - } - } - - if (!database->result.found_entry - || MMDB_aget_value(&database->result.entry, &entry_data, - geoip2->lookup) != MMDB_SUCCESS) { - goto not_found; - } - - if (!entry_data.has_data) { - goto not_found; - } - - switch (entry_data.type) { - case MMDB_DATA_TYPE_BOOLEAN: - FORMAT("%d", entry_data.boolean); - break; - case MMDB_DATA_TYPE_UTF8_STRING: - v->len = entry_data.data_size; - v->data = ngx_pnalloc(r->pool, v->len); - if (v->data == NULL) { - return NGX_ERROR; - } - ngx_memcpy(v->data, (u_char *) entry_data.utf8_string, v->len); - break; - case MMDB_DATA_TYPE_BYTES: - v->len = entry_data.data_size; - v->data = ngx_pnalloc(r->pool, v->len); - if (v->data == NULL) { - return NGX_ERROR; - } - ngx_memcpy(v->data, (u_char *) entry_data.bytes, v->len); - break; - case MMDB_DATA_TYPE_FLOAT: - FORMAT("%.5f", entry_data.float_value); - break; - case MMDB_DATA_TYPE_DOUBLE: - FORMAT("%.5f", entry_data.double_value); - break; - case MMDB_DATA_TYPE_UINT16: - FORMAT("%uD", entry_data.uint16); - break; - case MMDB_DATA_TYPE_UINT32: - FORMAT("%uD", entry_data.uint32); - break; - case MMDB_DATA_TYPE_INT32: - FORMAT("%D", entry_data.int32); - break; - case MMDB_DATA_TYPE_UINT64: - FORMAT("%uL", entry_data.uint64); - break; - case MMDB_DATA_TYPE_UINT128: ; -#if MMDB_UINT128_IS_BYTE_ARRAY - uint8_t *val = (uint8_t *)entry_data.uint128; - FORMAT( "0x%02x%02x%02x%02x%02x%02x%02x%02x" - "%02x%02x%02x%02x%02x%02x%02x%02x", - val[0], val[1], val[2], val[3], - val[4], val[5], val[6], val[7], - val[8], val[9], val[10], val[11], - val[12], val[13], val[14], val[15]); -#else - mmdb_uint128_t val = entry_data.uint128; - FORMAT("0x%016uxL%016uxL", - (uint64_t) (val >> 64), (uint64_t) val); -#endif - break; - default: - goto not_found; - } - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; - -not_found: - if (geoip2->default_value.len > 0) { - v->data = geoip2->default_value.data; - v->len = geoip2->default_value.len; - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_geoip2_metadata(ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) -{ - ngx_http_geoip2_metadata_t *metadata = (ngx_http_geoip2_metadata_t *) data; - ngx_http_geoip2_db_t *database = metadata->database; - u_char *p; - - if (ngx_strncmp(metadata->metavalue.data, "build_epoch", 11) == 0) { - FORMAT("%uL", database->mmdb.metadata.build_epoch); - } else if (ngx_strncmp(metadata->metavalue.data, "last_check", 10) == 0) { - FORMAT("%T", database->last_check); - } else if (ngx_strncmp(metadata->metavalue.data, "last_change", 11) == 0) { - FORMAT("%T", database->last_change); - } else { - v->not_found = 1; - return NGX_OK; - } - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -static void * -ngx_http_geoip2_create_conf(ngx_conf_t *cf) -{ - ngx_pool_cleanup_t *cln; - ngx_http_geoip2_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip2_conf_t)); - if (conf == NULL) { - return NULL; - } - - conf->proxy_recursive = NGX_CONF_UNSET; - - cln = ngx_pool_cleanup_add(cf->pool, 0); - if (cln == NULL) { - return NULL; - } - - ngx_queue_init(&conf->databases); - - cln->handler = ngx_http_geoip2_cleanup; - cln->data = conf; - - return conf; -} - - -static char * -ngx_http_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_geoip2_conf_t *gcf = conf; - ngx_str_t *value; - int status; - ngx_http_geoip2_db_t *database; - char *rv; - ngx_conf_t save; - ngx_queue_t *q; - - value = cf->args->elts; - - if (value[1].data && value[1].data[0] != '/') { - if (ngx_conf_full_name(cf->cycle, &value[1], 0) != NGX_OK) { - return NGX_CONF_ERROR; - } - } - - if (!ngx_queue_empty(&gcf->databases)) { - for (q = ngx_queue_head(&gcf->databases); - q != ngx_queue_sentinel(&gcf->databases); - q = ngx_queue_next(q)) - { - database = ngx_queue_data(q, ngx_http_geoip2_db_t, queue); - if (ngx_strcmp(value[1].data, database->mmdb.filename) == 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "Duplicate GeoIP2 mmdb - %V", &value[1]); - return NGX_CONF_ERROR; - } - } - } - - database = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip2_db_t)); - if (database == NULL) { - return NGX_CONF_ERROR; - } - - ngx_queue_insert_tail(&gcf->databases, &database->queue); - database->last_check = database->last_change = ngx_time(); - - status = MMDB_open((char *) value[1].data, MMDB_MODE_MMAP, &database->mmdb); - - if (status != MMDB_SUCCESS) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "MMDB_open(\"%V\") failed - %s", &value[1], - MMDB_strerror(status)); - return NGX_CONF_ERROR; - } - - save = *cf; - cf->handler = ngx_http_geoip2_parse_config; - cf->handler_conf = (void *) database; - - rv = ngx_conf_parse(cf, NULL); - *cf = save; - return rv; -} - - -static char * -ngx_http_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) -{ - ngx_http_geoip2_db_t *database; - ngx_str_t *value; - time_t interval; - - value = cf->args->elts; - - if (value[0].data[0] == '$') { - return ngx_http_geoip2_add_variable(cf, dummy, conf); - } - - if (value[0].len == 11 - && ngx_strncmp(value[0].data, "auto_reload", 11) == 0) { - if ((int) cf->args->nelts != 2) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid number of arguments for auto_reload"); - return NGX_CONF_ERROR; - } - - interval = ngx_parse_time(&value[1], true); - - if (interval == (time_t) NGX_ERROR) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid interval for auto_reload \"%V\"", - value[1]); - return NGX_CONF_ERROR; - } - - - database = (ngx_http_geoip2_db_t *) conf; - database->check_interval = interval; - return NGX_CONF_OK; - } - - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid setting \"%V\"", &value[0]); - return NGX_CONF_ERROR; -} - - -static char * -ngx_http_geoip2_add_variable(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) -{ - ngx_http_geoip2_db_t *database; - ngx_str_t *value; - int nelts; - - value = cf->args->elts; - - if (value[0].data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid variable name \"%V\"", &value[0]); - return NGX_CONF_ERROR; - } - - value[0].len--; - value[0].data++; - - nelts = (int) cf->args->nelts; - database = (ngx_http_geoip2_db_t *) conf; - - if (nelts > 0 && value[1].len == 8 && ngx_strncmp(value[1].data, "metadata", 8) == 0) { - return ngx_http_geoip2_add_variable_metadata(cf, database); - } - - return ngx_http_geoip2_add_variable_geodata(cf, database); -} - - -static char * -ngx_http_geoip2_add_variable_metadata(ngx_conf_t *cf, ngx_http_geoip2_db_t *database) -{ - ngx_http_geoip2_metadata_t *metadata; - ngx_str_t *value, name; - ngx_http_variable_t *var; - - metadata = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip2_metadata_t)); - if (metadata == NULL) { - return NGX_CONF_ERROR; - } - - value = cf->args->elts; - name = value[0]; - - metadata->database = database; - metadata->metavalue = value[2]; - - var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); - if (var == NULL) { - return NGX_CONF_ERROR; - } - - var->get_handler = ngx_http_geoip2_metadata; - var->data = (uintptr_t) metadata; - - return NGX_CONF_OK; -} - - -static char * -ngx_http_geoip2_add_variable_geodata(ngx_conf_t *cf, ngx_http_geoip2_db_t *database) -{ - ngx_http_geoip2_ctx_t *geoip2; - ngx_http_compile_complex_value_t ccv; - ngx_str_t *value, name, source; - ngx_http_variable_t *var; - int i, nelts, idx; - - geoip2 = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip2_ctx_t)); - if (geoip2 == NULL) { - return NGX_CONF_ERROR; - } - - geoip2->database = database; - ngx_str_null(&source); - - value = cf->args->elts; - name = value[0]; - - nelts = (int) cf->args->nelts; - idx = 1; - - if (nelts > idx) { - for (i = idx; i < nelts; i++) { - if (ngx_strnstr(value[idx].data, "=", value[idx].len) == NULL) { - break; - } - - if (value[idx].len > 8 && ngx_strncmp(value[idx].data, "default=", 8) == 0) { - if (geoip2->default_value.len > 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "default has already been declared for \"$%V\"", &name); - return NGX_CONF_ERROR; - } - - geoip2->default_value.len = value[idx].len - 8; - geoip2->default_value.data = value[idx].data + 8; - } else if (value[idx].len > 7 && ngx_strncmp(value[idx].data, "source=", 7) == 0) { - if (source.len > 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "source has already been declared for \"$%V\"", &name); - return NGX_CONF_ERROR; - } - - source.len = value[idx].len - 7; - source.data = value[idx].data + 7; - - if (source.data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid source variable name \"%V\"", &source); - return NGX_CONF_ERROR; - } - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - ccv.cf = cf; - ccv.value = &source; - ccv.complex_value = &geoip2->source; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "unable to compile \"%V\" for \"$%V\"", &source, &name); - return NGX_CONF_ERROR; - } - } else { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid setting \"%V\" for \"$%V\"", &value[idx], &name); - return NGX_CONF_ERROR; - } - - idx++; - } - } - - var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); - if (var == NULL) { - return NGX_CONF_ERROR; - } - - geoip2->lookup = ngx_pcalloc(cf->pool, sizeof(const char *) * - (cf->args->nelts - (idx - 1))); - - if (geoip2->lookup == NULL) { - return NGX_CONF_ERROR; - } - - for (i = idx; i < nelts; i++) { - geoip2->lookup[i - idx] = (char *) value[i].data; - } - geoip2->lookup[i - idx] = NULL; - - var->get_handler = ngx_http_geoip2_variable; - var->data = (uintptr_t) geoip2; - - return NGX_CONF_OK; -} - - -static char * -ngx_http_geoip2_init_conf(ngx_conf_t *cf, void *conf) -{ - ngx_http_geoip2_conf_t *gcf = conf; - ngx_conf_init_value(gcf->proxy_recursive, 0); - return NGX_CONF_OK; -} - - -static char * -ngx_http_geoip2_proxy(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_geoip2_conf_t *gcf = conf; - ngx_str_t *value; - ngx_cidr_t cidr, *c; - - value = cf->args->elts; - - if (ngx_http_geoip2_cidr_value(cf, &value[1], &cidr) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (gcf->proxies == NULL) { - gcf->proxies = ngx_array_create(cf->pool, 4, sizeof(ngx_cidr_t)); - if (gcf->proxies == NULL) { - return NGX_CONF_ERROR; - } - } - - c = ngx_array_push(gcf->proxies); - if (c == NULL) { - return NGX_CONF_ERROR; - } - - *c = cidr; - - return NGX_CONF_OK; -} - - -static ngx_int_t -ngx_http_geoip2_cidr_value(ngx_conf_t *cf, ngx_str_t *net, ngx_cidr_t *cidr) -{ - ngx_int_t rc; - - if (ngx_strcmp(net->data, "255.255.255.255") == 0) { - cidr->family = AF_INET; - cidr->u.in.addr = 0xffffffff; - cidr->u.in.mask = 0xffffffff; - - return NGX_OK; - } - - rc = ngx_ptocidr(net, cidr); - - if (rc == NGX_ERROR) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid network \"%V\"", net); - return NGX_ERROR; - } - - if (rc == NGX_DONE) { - ngx_conf_log_error(NGX_LOG_WARN, cf, 0, - "low address bits of %V are meaningless", net); - } - - return NGX_OK; -} - - -static void -ngx_http_geoip2_cleanup(void *data) -{ - ngx_http_geoip2_conf_t *gcf = data; - ngx_queue_t *q; - ngx_http_geoip2_db_t *database; - - while (!ngx_queue_empty(&gcf->databases)) { - q = ngx_queue_head(&gcf->databases); - ngx_queue_remove(q); - database = ngx_queue_data(q, ngx_http_geoip2_db_t, queue); - MMDB_close(&database->mmdb); - } -} - - -static ngx_int_t -ngx_http_geoip2_log_handler(ngx_http_request_t *r) -{ - int status; - MMDB_s tmpdb; - ngx_queue_t *q; - ngx_file_info_t fi; - ngx_http_geoip2_db_t *database; - ngx_http_geoip2_conf_t *gcf; - - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "geoip2 http log handler"); - - gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip2_module); - - if (ngx_queue_empty(&gcf->databases)) { - return NGX_OK; - } - - for (q = ngx_queue_head(&gcf->databases); - q != ngx_queue_sentinel(&gcf->databases); - q = ngx_queue_next(q)) - { - database = ngx_queue_data(q, ngx_http_geoip2_db_t, queue); - if (database->check_interval == 0) { - continue; - } - - if ((database->last_check + database->check_interval) - > ngx_time()) - { - continue; - } - - database->last_check = ngx_time(); - - if (ngx_file_info(database->mmdb.filename, &fi) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_EMERG, r->connection->log, ngx_errno, - ngx_file_info_n " \"%s\" failed", - database->mmdb.filename); - - continue; - } - - if (ngx_file_mtime(&fi) <= database->last_change) { - continue; - } - - /* do the reload */ - - ngx_memzero(&tmpdb, sizeof(MMDB_s)); - status = MMDB_open(database->mmdb.filename, MMDB_MODE_MMAP, &tmpdb); - - if (status != MMDB_SUCCESS) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "MMDB_open(\"%s\") failed to reload - %s", - database->mmdb.filename, MMDB_strerror(status)); - - continue; - } - - database->last_change = ngx_file_mtime(&fi); - MMDB_close(&database->mmdb); - database->mmdb = tmpdb; - - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "Reload MMDB \"%s\"", - database->mmdb.filename); - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_geoip2_init(ngx_conf_t *cf) -{ - ngx_http_handler_pt *h; - ngx_http_core_main_conf_t *cmcf; - - cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); - - h = ngx_array_push(&cmcf->phases[NGX_HTTP_LOG_PHASE].handlers); - if (h == NULL) { - return NGX_ERROR; - } - - *h = ngx_http_geoip2_log_handler; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_stream_geoip2_module.c b/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_stream_geoip2_module.c deleted file mode 100644 index eb59082..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_stream_geoip2_module.c +++ /dev/null @@ -1,694 +0,0 @@ -/* - * Copyright (C) Lee Valentine - * Copyright (C) Andrei Belov - * - * Based on nginx's 'ngx_stream_geoip_module.c' by Igor Sysoev - */ - - -#include -#include -#include - -#include - - -typedef struct { - MMDB_s mmdb; - MMDB_lookup_result_s result; - time_t last_check; - time_t last_change; - time_t check_interval; -#if (NGX_HAVE_INET6) - uint8_t address[16]; -#else - unsigned long address; -#endif - ngx_queue_t queue; -} ngx_stream_geoip2_db_t; - -typedef struct { - ngx_queue_t databases; -} ngx_stream_geoip2_conf_t; - -typedef struct { - ngx_stream_geoip2_db_t *database; - const char **lookup; - ngx_str_t default_value; - ngx_stream_complex_value_t source; -} ngx_stream_geoip2_ctx_t; - -typedef struct { - ngx_stream_geoip2_db_t *database; - ngx_str_t metavalue; -} ngx_stream_geoip2_metadata_t; - - -static ngx_int_t ngx_stream_geoip2_variable(ngx_stream_session_t *s, - ngx_stream_variable_value_t *v, uintptr_t data); -static ngx_int_t ngx_stream_geoip2_metadata(ngx_stream_session_t *s, - ngx_stream_variable_value_t *v, uintptr_t data); -static void *ngx_stream_geoip2_create_conf(ngx_conf_t *cf); -static char *ngx_stream_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_stream_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, - void *conf); -static char *ngx_stream_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_stream_geoip2_add_variable(ngx_conf_t *cf, ngx_command_t *dummy, - void *conf); -static char *ngx_stream_geoip2_add_variable_geodata(ngx_conf_t *cf, - ngx_stream_geoip2_db_t *database); -static char *ngx_stream_geoip2_add_variable_metadata(ngx_conf_t *cf, - ngx_stream_geoip2_db_t *database); -static void ngx_stream_geoip2_cleanup(void *data); -static ngx_int_t ngx_stream_geoip2_init(ngx_conf_t *cf); - - -#define FORMAT(fmt, ...) do { \ - p = ngx_palloc(s->connection->pool, NGX_OFF_T_LEN); \ - if (p == NULL) { \ - return NGX_ERROR; \ - } \ - v->len = ngx_sprintf(p, fmt, __VA_ARGS__) - p; \ - v->data = p; \ -} while (0) - -static ngx_command_t ngx_stream_geoip2_commands[] = { - - { ngx_string("geoip2"), - NGX_STREAM_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE1, - ngx_stream_geoip2, - NGX_STREAM_MAIN_CONF_OFFSET, - 0, - NULL }, - - ngx_null_command -}; - - -static ngx_stream_module_t ngx_stream_geoip2_module_ctx = { - NULL, /* preconfiguration */ - ngx_stream_geoip2_init, /* postconfiguration */ - - ngx_stream_geoip2_create_conf, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL /* merge server configuration */ -}; - - -ngx_module_t ngx_stream_geoip2_module = { - NGX_MODULE_V1, - &ngx_stream_geoip2_module_ctx, /* module context */ - ngx_stream_geoip2_commands, /* module directives */ - NGX_STREAM_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static ngx_int_t -ngx_stream_geoip2_variable(ngx_stream_session_t *s, ngx_stream_variable_value_t *v, - uintptr_t data) -{ - int mmdb_error; - u_char *p; - ngx_str_t val; - ngx_addr_t addr; - MMDB_entry_data_s entry_data; - ngx_stream_geoip2_ctx_t *geoip2 = (ngx_stream_geoip2_ctx_t *) data; - ngx_stream_geoip2_db_t *database = geoip2->database; - -#if (NGX_HAVE_INET6) - uint8_t address[16], *addressp = address; -#else - unsigned long address; -#endif - - if (geoip2->source.value.len > 0) { - if (ngx_stream_complex_value(s, &geoip2->source, &val) != NGX_OK) { - goto not_found; - } - - if (ngx_parse_addr(s->connection->pool, &addr, val.data, val.len) != NGX_OK) { - goto not_found; - } - } else { - addr.sockaddr = s->connection->sockaddr; - addr.socklen = s->connection->socklen; - } - - switch (addr.sockaddr->sa_family) { - case AF_INET: -#if (NGX_HAVE_INET6) - ngx_memset(addressp, 0, 12); - ngx_memcpy(addressp + 12, &((struct sockaddr_in *) - addr.sockaddr)->sin_addr.s_addr, 4); - break; - - case AF_INET6: - ngx_memcpy(addressp, &((struct sockaddr_in6 *) - addr.sockaddr)->sin6_addr.s6_addr, 16); -#else - address = ((struct sockaddr_in *)addr.sockaddr)->sin_addr.s_addr; -#endif - break; - - default: - goto not_found; - } - -#if (NGX_HAVE_INET6) - if (ngx_memcmp(&address, &database->address, sizeof(address)) != 0) { -#else - if (address != database->address) { -#endif - memcpy(&database->address, &address, sizeof(address)); - database->result = MMDB_lookup_sockaddr(&database->mmdb, - addr.sockaddr, &mmdb_error); - - if (mmdb_error != MMDB_SUCCESS) { - goto not_found; - } - } - - if (!database->result.found_entry - || MMDB_aget_value(&database->result.entry, &entry_data, geoip2->lookup) - != MMDB_SUCCESS) - { - goto not_found; - } - - if (!entry_data.has_data) { - goto not_found; - } - - switch (entry_data.type) { - case MMDB_DATA_TYPE_BOOLEAN: - FORMAT("%d", entry_data.boolean); - break; - case MMDB_DATA_TYPE_UTF8_STRING: - v->len = entry_data.data_size; - v->data = ngx_pnalloc(s->connection->pool, v->len); - if (v->data == NULL) { - return NGX_ERROR; - } - ngx_memcpy(v->data, (u_char *) entry_data.utf8_string, v->len); - break; - case MMDB_DATA_TYPE_BYTES: - v->len = entry_data.data_size; - v->data = ngx_pnalloc(s->connection->pool, v->len); - if (v->data == NULL) { - return NGX_ERROR; - } - ngx_memcpy(v->data, (u_char *) entry_data.bytes, v->len); - break; - case MMDB_DATA_TYPE_FLOAT: - FORMAT("%.5f", entry_data.float_value); - break; - case MMDB_DATA_TYPE_DOUBLE: - FORMAT("%.5f", entry_data.double_value); - break; - case MMDB_DATA_TYPE_UINT16: - FORMAT("%uD", entry_data.uint16); - break; - case MMDB_DATA_TYPE_UINT32: - FORMAT("%uD", entry_data.uint32); - break; - case MMDB_DATA_TYPE_INT32: - FORMAT("%D", entry_data.int32); - break; - case MMDB_DATA_TYPE_UINT64: - FORMAT("%uL", entry_data.uint64); - break; - case MMDB_DATA_TYPE_UINT128: ; -#if MMDB_UINT128_IS_BYTE_ARRAY - uint8_t *val = (uint8_t *) entry_data.uint128; - FORMAT("0x%02x%02x%02x%02x%02x%02x%02x%02x" - "%02x%02x%02x%02x%02x%02x%02x%02x", - val[0], val[1], val[2], val[3], - val[4], val[5], val[6], val[7], - val[8], val[9], val[10], val[11], - val[12], val[13], val[14], val[15]); -#else - mmdb_uint128_t val = entry_data.uint128; - FORMAT("0x%016uxL%016uxL", - (uint64_t) (val >> 64), (uint64_t) val); -#endif - break; - default: - goto not_found; - } - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; - -not_found: - if (geoip2->default_value.len > 0) { - v->data = geoip2->default_value.data; - v->len = geoip2->default_value.len; - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; - } - - v->not_found = 1; - - return NGX_OK; -} - - -static ngx_int_t -ngx_stream_geoip2_metadata(ngx_stream_session_t *s, ngx_stream_variable_value_t *v, - uintptr_t data) -{ - ngx_stream_geoip2_metadata_t *metadata = (ngx_stream_geoip2_metadata_t *) data; - ngx_stream_geoip2_db_t *database = metadata->database; - u_char *p; - - if (ngx_strncmp(metadata->metavalue.data, "build_epoch", 11) == 0) { - FORMAT("%uL", database->mmdb.metadata.build_epoch); - } else if (ngx_strncmp(metadata->metavalue.data, "last_check", 10) == 0) { - FORMAT("%T", database->last_check); - } else if (ngx_strncmp(metadata->metavalue.data, "last_change", 11) == 0) { - FORMAT("%T", database->last_change); - } else { - v->not_found = 1; - return NGX_OK; - } - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -static void * -ngx_stream_geoip2_create_conf(ngx_conf_t *cf) -{ - ngx_pool_cleanup_t *cln; - ngx_stream_geoip2_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_stream_geoip2_conf_t)); - if (conf == NULL) { - return NULL; - } - - cln = ngx_pool_cleanup_add(cf->pool, 0); - if (cln == NULL) { - return NULL; - } - - ngx_queue_init(&conf->databases); - - cln->handler = ngx_stream_geoip2_cleanup; - cln->data = conf; - - return conf; -} - - -static char * -ngx_stream_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - int status; - char *rv; - ngx_str_t *value; - ngx_conf_t save; - ngx_stream_geoip2_db_t *database; - ngx_stream_geoip2_conf_t *gcf = conf; - ngx_queue_t *q; - - value = cf->args->elts; - - if (value[1].data && value[1].data[0] != '/') { - if (ngx_conf_full_name(cf->cycle, &value[1], 0) != NGX_OK) { - return NGX_CONF_ERROR; - } - } - - if (!ngx_queue_empty(&gcf->databases)) { - for (q = ngx_queue_head(&gcf->databases); - q != ngx_queue_sentinel(&gcf->databases); - q = ngx_queue_next(q)) - { - database = ngx_queue_data(q, ngx_stream_geoip2_db_t, queue); - if (ngx_strcmp(value[1].data, database->mmdb.filename) == 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "Duplicate GeoIP2 mmdb - %V", &value[1]); - return NGX_CONF_ERROR; - } - } - } - - database = ngx_pcalloc(cf->pool, sizeof(ngx_stream_geoip2_db_t)); - if (database == NULL) { - return NGX_CONF_ERROR; - } - - ngx_queue_insert_tail(&gcf->databases, &database->queue); - database->last_check = database->last_change = ngx_time(); - - status = MMDB_open((char *) value[1].data, MMDB_MODE_MMAP, &database->mmdb); - - if (status != MMDB_SUCCESS) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "MMDB_open(\"%V\") failed - %s", &value[1], - MMDB_strerror(status)); - return NGX_CONF_ERROR; - } - - save = *cf; - cf->handler = ngx_stream_geoip2_parse_config; - cf->handler_conf = (void *) database; - - rv = ngx_conf_parse(cf, NULL); - *cf = save; - return rv; -} - - -static char * -ngx_stream_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) -{ - ngx_stream_geoip2_db_t *database; - ngx_str_t *value; - time_t interval; - - value = cf->args->elts; - - if (value[0].data[0] == '$') { - return ngx_stream_geoip2_add_variable(cf, dummy, conf); - } - - if (value[0].len == 11 - && ngx_strncmp(value[0].data, "auto_reload", 11) == 0) { - if ((int) cf->args->nelts != 2) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid number of arguments for auto_reload"); - return NGX_CONF_ERROR; - } - - interval = ngx_parse_time(&value[1], true); - - if (interval == (time_t) NGX_ERROR) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid interval for auto_reload \"%V\"", - value[1]); - return NGX_CONF_ERROR; - } - - - database = (ngx_stream_geoip2_db_t *) conf; - database->check_interval = interval; - return NGX_CONF_OK; - } - - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid setting \"%V\"", &value[0]); - return NGX_CONF_ERROR; -} - - -static char * -ngx_stream_geoip2_add_variable(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) -{ - ngx_stream_geoip2_db_t *database; - ngx_str_t *value; - int nelts; - - value = cf->args->elts; - - if (value[0].data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid variable name \"%V\"", &value[0]); - return NGX_CONF_ERROR; - } - - value[0].len--; - value[0].data++; - - nelts = (int) cf->args->nelts; - database = (ngx_stream_geoip2_db_t *) conf; - - if (nelts > 0 && value[1].len == 8 && ngx_strncmp(value[1].data, "metadata", 8) == 0) { - return ngx_stream_geoip2_add_variable_metadata(cf, database); - } - - return ngx_stream_geoip2_add_variable_geodata(cf, database); -} - - -static char * -ngx_stream_geoip2_add_variable_metadata(ngx_conf_t *cf, ngx_stream_geoip2_db_t *database) -{ - ngx_stream_geoip2_metadata_t *metadata; - ngx_str_t *value, name; - ngx_stream_variable_t *var; - - metadata = ngx_pcalloc(cf->pool, sizeof(ngx_stream_geoip2_metadata_t)); - if (metadata == NULL) { - return NGX_CONF_ERROR; - } - - value = cf->args->elts; - name = value[0]; - - metadata->database = database; - metadata->metavalue = value[2]; - - var = ngx_stream_add_variable(cf, &name, NGX_STREAM_VAR_CHANGEABLE); - if (var == NULL) { - return NGX_CONF_ERROR; - } - - var->get_handler = ngx_stream_geoip2_metadata; - var->data = (uintptr_t) metadata; - - return NGX_CONF_OK; -} - - -static char * -ngx_stream_geoip2_add_variable_geodata(ngx_conf_t *cf, ngx_stream_geoip2_db_t *database) -{ - ngx_stream_geoip2_ctx_t *geoip2; - ngx_stream_compile_complex_value_t ccv; - ngx_str_t *value, name, source; - ngx_stream_variable_t *var; - int i, nelts, idx; - - geoip2 = ngx_pcalloc(cf->pool, sizeof(ngx_stream_geoip2_ctx_t)); - if (geoip2 == NULL) { - return NGX_CONF_ERROR; - } - - geoip2->database = database; - ngx_str_null(&source); - - value = cf->args->elts; - name = value[0]; - - nelts = (int) cf->args->nelts; - idx = 1; - - if (nelts > idx) { - for (i = idx; i < nelts; i++) { - if (ngx_strnstr(value[idx].data, "=", value[idx].len) == NULL) { - break; - } - - if (value[idx].len > 8 && ngx_strncmp(value[idx].data, "default=", 8) == 0) { - if (geoip2->default_value.len > 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "default has already been declared for \"$%V\"", &name); - return NGX_CONF_ERROR; - } - - geoip2->default_value.len = value[idx].len - 8; - geoip2->default_value.data = value[idx].data + 8; - - } else if (value[idx].len > 7 && ngx_strncmp(value[idx].data, "source=", 7) == 0) { - if (source.len > 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "source has already been declared for \"$%V\"", &name); - return NGX_CONF_ERROR; - } - - source.len = value[idx].len - 7; - source.data = value[idx].data + 7; - - if (source.data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid source variable name \"%V\"", &source); - return NGX_CONF_ERROR; - } - - ngx_memzero(&ccv, sizeof(ngx_stream_compile_complex_value_t)); - ccv.cf = cf; - ccv.value = &source; - ccv.complex_value = &geoip2->source; - - if (ngx_stream_compile_complex_value(&ccv) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "unable to compile \"%V\" for \"$%V\"", &source, &name); - return NGX_CONF_ERROR; - } - - } else { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid setting \"%V\" for \"$%V\"", &value[idx], &name); - return NGX_CONF_ERROR; - } - - idx++; - } - } - - var = ngx_stream_add_variable(cf, &name, NGX_STREAM_VAR_CHANGEABLE); - if (var == NULL) { - return NGX_CONF_ERROR; - } - - geoip2->lookup = ngx_pcalloc(cf->pool, - sizeof(const char *) * (cf->args->nelts - (idx - 1))); - - if (geoip2->lookup == NULL) { - return NGX_CONF_ERROR; - } - - for (i = idx; i < nelts; i++) { - geoip2->lookup[i - idx] = (char *) value[i].data; - } - geoip2->lookup[i - idx] = NULL; - - var->get_handler = ngx_stream_geoip2_variable; - var->data = (uintptr_t) geoip2; - - return NGX_CONF_OK; -} - - -static void -ngx_stream_geoip2_cleanup(void *data) -{ - ngx_queue_t *q; - ngx_stream_geoip2_db_t *database; - ngx_stream_geoip2_conf_t *gcf = data; - - while (!ngx_queue_empty(&gcf->databases)) { - q = ngx_queue_head(&gcf->databases); - ngx_queue_remove(q); - database = ngx_queue_data(q, ngx_stream_geoip2_db_t, queue); - MMDB_close(&database->mmdb); - } -} - - -static ngx_int_t -ngx_stream_geoip2_log_handler(ngx_stream_session_t *s) -{ - int status; - MMDB_s tmpdb; - ngx_queue_t *q; - ngx_file_info_t fi; - ngx_stream_geoip2_db_t *database; - ngx_stream_geoip2_conf_t *gcf; - - ngx_log_debug0(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, - "geoip2 stream log handler"); - - gcf = ngx_stream_get_module_main_conf(s, ngx_stream_geoip2_module); - - if (ngx_queue_empty(&gcf->databases)) { - return NGX_OK; - } - - for (q = ngx_queue_head(&gcf->databases); - q != ngx_queue_sentinel(&gcf->databases); - q = ngx_queue_next(q)) - { - database = ngx_queue_data(q, ngx_stream_geoip2_db_t, queue); - if (database->check_interval == 0) { - continue; - } - - if ((database->last_check + database->check_interval) - > ngx_time()) - { - continue; - } - - database->last_check = ngx_time(); - - if (ngx_file_info(database->mmdb.filename, &fi) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_EMERG, s->connection->log, ngx_errno, - ngx_file_info_n " \"%s\" failed", - database->mmdb.filename); - - continue; - } - - if (ngx_file_mtime(&fi) <= database->last_change) { - continue; - } - - /* do the reload */ - - ngx_memzero(&tmpdb, sizeof(MMDB_s)); - status = MMDB_open(database->mmdb.filename, MMDB_MODE_MMAP, &tmpdb); - - if (status != MMDB_SUCCESS) { - ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, - "MMDB_open(\"%s\") failed to reload - %s", - database->mmdb.filename, MMDB_strerror(status)); - - continue; - } - - database->last_change = ngx_file_mtime(&fi); - MMDB_close(&database->mmdb); - database->mmdb = tmpdb; - - ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, - "Reload MMDB \"%s\"", - database->mmdb.filename); - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_stream_geoip2_init(ngx_conf_t *cf) -{ - ngx_stream_handler_pt *h; - ngx_stream_core_main_conf_t *cmcf; - - cmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_core_module); - - h = ngx_array_push(&cmcf->phases[NGX_STREAM_LOG_PHASE].handlers); - if (h == NULL) { - return NGX_ERROR; - } - - *h = ngx_stream_geoip2_log_handler; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitattributes b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitignore b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitignore deleted file mode 100644 index 39c82fa..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitignore +++ /dev/null @@ -1,54 +0,0 @@ -reindex -.libs -*.swp -*.slo -*.la -*.swo -*.lo -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[78] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -t.sh -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -genmobi.sh -*.mobi -misc/chunked -src/headers.c -src/headers.h -src/module.c -src/module.h -src/util.c -src/util.h -go -ctags -src/in.c -src/in.h -src/out.c -src/out.h -build[89] -build1[0-9] -buildroot/ -work/ -all -t/servroot -analyze -cov -nginx -*.plist -a.patch -Makefile diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.travis.yml b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.travis.yml deleted file mode 100644 index 6b346a8..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -sudo: required -dist: focal - -branches: - only: - - "master" - -os: linux - -language: c - -compiler: - - gcc - -addons: - apt: - packages: - - axel - - cpanminus - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - matrix: - - NGINX_VERSION=1.25.3 WITHOUT_PCRE2=1 - - NGINX_VERSION=1.27.1 WITHOUT_PCRE2=1 - -before_install: - - sudo apt-get update -y - - sudo apt-get install -y ca-certificates - - sudo cpanm -v --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1) - -install: - - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/nginx-eval-module.git ../eval-nginx-module - - git clone https://github.com/openresty/openresty.git ../openresty - - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - - git clone https://github.com/openresty/nginx-devel-utils.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git luajit2 - -before_script: - - cd luajit2/ - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - -script: - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH - - export NGX_BUILD_CC=$CC - - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - - prove -I. -r t - diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/LICENSE b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/LICENSE deleted file mode 100644 index c14f60a..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -This module is licensed under the terms of the BSD license. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/README.markdown b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/README.markdown deleted file mode 100644 index 6baea91..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/README.markdown +++ /dev/null @@ -1,538 +0,0 @@ -Name -==== - -**ngx_headers_more** - Set and clear input and output headers...more than "add"! - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Name](#name) -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) -* [Directives](#directives) - * [more_set_headers](#more_set_headers) - * [more_clear_headers](#more_clear_headers) - * [more_set_input_headers](#more_set_input_headers) - * [more_clear_input_headers](#more_clear_input_headers) -* [Limitations](#limitations) -* [Installation](#installation) -* [Compatibility](#compatibility) -* [Community](#community) - * [English Mailing List](#english-mailing-list) - * [Chinese Mailing List](#chinese-mailing-list) -* [Bugs and Patches](#bugs-and-patches) -* [Source Repository](#source-repository) -* [Changes](#changes) -* [Test Suite](#test-suite) -* [TODO](#todo) -* [Getting involved](#getting-involved) -* [Authors](#authors) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Version -======= - -This document describes headers-more-nginx-module [v0.34](https://github.com/openresty/headers-more-nginx-module/tags) released on 17 July 2022. - -Synopsis -======== - -```nginx - - # set the Server output header - more_set_headers 'Server: my-server'; - - # set and clear output headers - location /bar { - more_set_headers 'X-MyHeader: blah' 'X-MyHeader2: foo'; - more_set_headers -t 'text/plain text/css' 'Content-Type: text/foo'; - more_set_headers -s '400 404 500 503' -s 413 'Foo: Bar'; - more_clear_headers 'Content-Type'; - - # your proxy_pass/memcached_pass/or any other config goes here... - } - - # set output headers - location /type { - more_set_headers 'Content-Type: text/plain'; - # ... - } - - # set input headers - location /foo { - set $my_host 'my dog'; - more_set_input_headers 'Host: $my_host'; - more_set_input_headers -t 'text/plain' 'X-Foo: bah'; - - # now $host and $http_host have their new values... - # ... - } - - # replace input header X-Foo *only* if it already exists - more_set_input_headers -r 'X-Foo: howdy'; -``` - -Description -=========== - -This module allows you to add, set, or clear any output -or input header that you specify. - -This is an enhanced version of the standard -[headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module because it provides more utilities like -resetting or clearing "builtin headers" like `Content-Type`, -`Content-Length`, and `Server`. - -It also allows you to specify an optional HTTP status code -criteria using the `-s` option and an optional content -type criteria using the `-t` option while modifying the -output headers with the [more_set_headers](#more_set_headers) and -[more_clear_headers](#more_clear_headers) directives. For example, - -```nginx - more_set_headers -s 404 -t 'text/html' 'X-Foo: Bar'; -``` - -You can also specify multiple MIME types to filter out in a single `-t` option. -For example, - -```nginx -more_set_headers -t 'text/html text/plain' 'X-Foo: Bar'; -``` - -Never use other parameters like `charset=utf-8` in the `-t` option values; they will not -work as you would expect. - -Input headers can be modified as well. For example - -```nginx - location /foo { - more_set_input_headers 'Host: foo' 'User-Agent: faked'; - # now $host, $http_host, $user_agent, and - # $http_user_agent all have their new values. - } -``` - -The option `-t` is also available in the -[more_set_input_headers](#more_set_input_headers) and -[more_clear_input_headers](#more_clear_input_headers) directives (for request header filtering) while the `-s` option -is not allowed. - -Unlike the standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module, this module's directives will by -default apply to all the status codes, including `4xx` and `5xx`. - -[Back to TOC](#table-of-contents) - -Directives -========== - -[Back to TOC](#table-of-contents) - -more_set_headers ----------------- -**syntax:** *more_set_headers [-t <content-type list>]... [-s <status-code list>]... [-a] <new-header>...* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -Replaces (if any) or adds (if not any) the specified output headers when the response status code matches the codes specified by the `-s` option *AND* the response content type matches the types specified by the `-t` option. - -If the "-a" option is specified, the specified output headers can be appended directly without clearing the old fields. The behavior of builtin headers such as "Content-Type", "Content-Length", "Server", etc. cannot be changed. - -If either `-s` or `-t` is not specified or has an empty list value, then no match is required. Therefore, the following directive set the `Server` output header to the custom value for *any* status code and *any* content type: - -```nginx - - more_set_headers "Server: my_server"; -``` - -Existing response headers with the same name are always overridden. If you want to add headers incrementally, use the standard [add_header](http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header) directive instead. - -A single directive can set/add multiple output headers. For example - -```nginx - - more_set_headers 'Foo: bar' 'Baz: bah'; -``` - -Multiple occurrences of the options are allowed in a single directive. Their values will be merged together. For instance - -```nginx - - more_set_headers -s 404 -s '500 503' 'Foo: bar'; -``` - -is equivalent to - -```nginx - - more_set_headers -s '404 500 503' 'Foo: bar'; -``` - -The new header should be the one of the forms: - -1. `Name: Value` -1. `Name: ` -1. `Name` - -The last two effectively clear the value of the header `Name`. - -Nginx variables are allowed in header values. For example: - -```nginx - - set $my_var "dog"; - more_set_headers "Server: $my_var"; -``` - -But variables won't work in header keys due to performance considerations. - -Multiple set/clear header directives are allowed in a single location, and they're executed sequentially. - -Directives inherited from an upper level scope (say, http block or server blocks) are executed before the directives in the location block. - -Note that although `more_set_headers` is allowed in *location* if blocks, it is *not* allowed in the *server* if blocks, as in - -```nginx - - ? # This is NOT allowed! - ? server { - ? if ($args ~ 'download') { - ? more_set_headers 'Foo: Bar'; - ? } - ? ... - ? } -``` - -Behind the scene, use of this directive and its friend [more_clear_headers](#more_clear_headers) will (lazily) register an ouput header filter that modifies `r->headers_out` the way you specify. - -[Back to TOC](#table-of-contents) - -more_clear_headers ------------------- -**syntax:** *more_clear_headers [-t <content-type list>]... [-s <status-code list>]... <new-header>...* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -Clears the specified output headers. - -In fact, - -```nginx - - more_clear_headers -s 404 -t 'text/plain' Foo Baz; -``` - -is exactly equivalent to - -```nginx - - more_set_headers -s 404 -t 'text/plain' "Foo: " "Baz: "; -``` - -or - -```nginx - - more_set_headers -s 404 -t 'text/plain' Foo Baz -``` - -See [more_set_headers](#more_set_headers) for more details. - -The wildcard character, `*`, can also be used at the end of the header name to specify a pattern. For example, the following directive -effectively clears *any* output headers starting by "`X-Hidden-`": - -```nginx - - more_clear_headers 'X-Hidden-*'; -``` - -The `*` wildcard support was first introduced in [v0.09](#v009). - -[Back to TOC](#table-of-contents) - -more_set_input_headers ----------------------- -**syntax:** *more_set_input_headers [-r] [-t <content-type list>]... <new-header>...* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *rewrite tail* - -Very much like [more_set_headers](#more_set_headers) except that it operates on input headers (or request headers) and it only supports the `-t` option. - -Note that using the `-t` option in this directive means filtering by the `Content-Type` *request* header, rather than the response header. - -Behind the scene, use of this directive and its friend [more_clear_input_headers](#more_clear_input_headers) will (lazily) -register a `rewrite phase` handler that modifies `r->headers_in` the way you specify. Note that it always run at the *end* of -the `rewrite` phase so that it runs *after* the standard [rewrite module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) -and works in subrequests as well. - -If the `-r` option is specified, then the headers will be replaced to the new values *only if* they already exist. - -[Back to TOC](#table-of-contents) - -more_clear_input_headers ------------------------- -**syntax:** *more_clear_input_headers [-t <content-type list>]... <new-header>...* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *rewrite tail* - -Clears the specified input headers. - -In fact, - -```nginx - - more_clear_input_headers -t 'text/plain' Foo Baz; -``` - -is exactly equivalent to - -```nginx - - more_set_input_headers -t 'text/plain' "Foo: " "Baz: "; -``` - -or - -```nginx - - more_set_input_headers -t 'text/plain' Foo Baz -``` - -To remove request headers "Foo" and "Baz" for all incoming requests regardless of the content type, we can write - -```nginx - - more_clear_input_headers "Foo" "Baz"; -``` - -See [more_set_input_headers](#more_set_input_headers) for more details. - -The wildcard character, `*`, can also be used at the end of the header name to specify a pattern. For example, the following directive -effectively clears *any* input headers starting by "`X-Hidden-`": - -```nginx - - more_clear_input_headers 'X-Hidden-*'; -``` - -[Back to TOC](#table-of-contents) - -Limitations -=========== - -* Unlike the standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module, this module does not automatically take care of the constraint among the `Expires`, `Cache-Control`, and `Last-Modified` headers. You have to get them right yourself or use the [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module together with this module. -* You cannot remove the `Connection` response header using this module because the `Connection` response header is generated by the standard `ngx_http_header_filter_module` in the Nginx core, whose output header filter runs always *after* the filter of this module. The only way to actually remove the `Connection` header is to patch the Nginx core, that is, editing the C function `ngx_http_header_filter` in the `src/http/ngx_http_header_filter_module.c` file. - -[Back to TOC](#table-of-contents) - -Installation -============ - -Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.17.8 (see [nginx compatibility](#compatibility)), and then build the source with this module: - -```bash - - wget 'http://nginx.org/download/nginx-1.17.8.tar.gz' - tar -xzvf nginx-1.17.8.tar.gz - cd nginx-1.17.8/ - - # Here we assume you would install you nginx under /opt/nginx/. - ./configure --prefix=/opt/nginx \ - --add-module=/path/to/headers-more-nginx-module - - make - make install -``` - -Download the latest version of the release tarball of this module from [headers-more-nginx-module file list](https://github.com/openresty/headers-more-nginx-module/tags). - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ngx_http_headers_more_filter_module.so; -``` - -Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org). - -[Back to TOC](#table-of-contents) - -Compatibility -============= - -The following versions of Nginx should work with this module: - -* **1.21.x** (last tested: 1.21.4) -* **1.19.x** (last tested: 1.19.9) -* **1.17.x** (last tested: 1.17.8) -* **1.16.x** -* **1.15.x** (last tested: 1.15.8) -* **1.14.x** -* **1.13.x** (last tested: 1.13.6) -* **1.12.x** -* **1.11.x** (last tested: 1.11.2) -* **1.10.x** -* **1.9.x** (last tested: 1.9.15) -* **1.8.x** -* **1.7.x** (last tested: 1.7.10) -* **1.6.x** (last tested: 1.6.2) -* **1.5.x** (last tested: 1.5.8) -* **1.4.x** (last tested: 1.4.4) -* **1.3.x** (last tested: 1.3.7) -* **1.2.x** (last tested: 1.2.9) -* **1.1.x** (last tested: 1.1.5) -* **1.0.x** (last tested: 1.0.11) -* **0.9.x** (last tested: 0.9.4) -* **0.8.x** (last tested: 0.8.54) -* **0.7.x >= 0.7.44** (last tested: 0.7.68) - -Earlier versions of Nginx like 0.6.x and 0.5.x will *not* work. - -If you find that any particular version of Nginx above 0.7.44 does not work with this module, please consider [reporting a bug](#report-bugs). - -[Back to TOC](#table-of-contents) - -Community -========= - -[Back to TOC](#table-of-contents) - -English Mailing List --------------------- - -The [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers. - -[Back to TOC](#table-of-contents) - -Chinese Mailing List --------------------- - -The [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers. - -[Back to TOC](#table-of-contents) - -Bugs and Patches -================ - -Please submit bug reports, wishlists, or patches by - -1. creating a ticket on the [GitHub Issue Tracker](https://github.com/chaoslawful/lua-nginx-module/issues), -1. or posting to the [OpenResty community](#community). - -[Back to TOC](#table-of-contents) - -Source Repository -================= - -Available on github at [openresty/headers-more-nginx-module](https://github.com/openresty/headers-more-nginx-module). - -[Back to TOC](#table-of-contents) - -Changes -======= - -The changes of every release of this module can be obtained from the OpenResty bundle's change logs: - - - -[Back to TOC](#table-of-contents) - -Test Suite -========== - -This module comes with a Perl-driven test suite. The [test cases](https://github.com/openresty/headers-more-nginx-module/tree/master/t/) are -[declarative](https://github.com/openresty/headers-more-nginx-module/blob/master/t/sanity.t) too. Thanks to the [Test::Nginx](http://search.cpan.org/perldoc?Test::Nginx) module in the Perl world. - -To run it on your side: - -```bash - - $ PATH=/path/to/your/nginx-with-headers-more-module:$PATH prove -r t -``` - -To run the test suite with valgrind's memcheck, use the following commands: - -```bash - - $ export PATH=/path/to/your/nginx-with-headers-more-module:$PATH - $ TEST_NGINX_USE_VALGRIND=1 prove -r t -``` - -You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary. - -Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility. - -Some parts of the test suite requires modules [proxy](http://nginx.org/en/docs/http/ngx_http_proxy_module.html), [rewrite](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html), and [echo](https://github.com/openresty/echo-nginx-module) to be enabled as well when building Nginx. - -[Back to TOC](#table-of-contents) - -TODO -==== - -* Support variables in new headers' keys. - -[Back to TOC](#table-of-contents) - -Getting involved -================ - -You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub. - -[Back to TOC](#table-of-contents) - -Authors -======= - -* Yichun "agentzh" Zhang (章亦春) *<agentzh@gmail.com>*, OpenResty Inc. -* Bernd Dorn ( ) - -This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well. - -[Back to TOC](#table-of-contents) - -Copyright & License -=================== - -The code base is borrowed directly from the standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module in Nginx 0.8.24. This part of code is copyrighted by Igor Sysoev. - -Copyright (c) 2009-2017, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. - -Copyright (c) 2010-2013, Bernd Dorn. - -The license text is available in the [LICENSE](LICENSE) file located in the root directory of the project. - -[Back to TOC](#table-of-contents) - -See Also -======== - -* The original thread on the Nginx mailing list that inspires this module's development: ["A question about add_header replication"](http://forum.nginx.org/read.php?2,11206,11738). -* The orginal announcement thread on the Nginx mailing list: ["The "headers_more" module: Set and clear output headers...more than 'add'!"](http://forum.nginx.org/read.php?2,23460). -* The original [blog post](http://agentzh.blogspot.com/2009/11/headers-more-module-scripting-input-and.html) about this module's initial development. -* The [echo module](https://github.com/openresty/echo-nginx-module) for Nginx module's automated testing. -* The standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module. - -[Back to TOC](#table-of-contents) - diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/config b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/config deleted file mode 100644 index 5707cc4..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/config +++ /dev/null @@ -1,32 +0,0 @@ -ngx_addon_name=ngx_http_headers_more_filter_module - -HEADERS_MORE_SRCS=" \ - $ngx_addon_dir/src/ngx_http_headers_more_filter_module.c \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_out.c \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_in.c \ - $ngx_addon_dir/src/ngx_http_headers_more_util.c \ - " - -HEADERS_MORE_DEPS=" \ - $ngx_addon_dir/src/ddebug.h \ - $ngx_addon_dir/src/ngx_http_headers_more_filter_module.h \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_in.h \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_out.h \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_in.h \ - $ngx_addon_dir/src/ngx_http_headers_more_util.h \ - " - -if test -n "$ngx_module_link"; then - ngx_module_type=HTTP_AUX_FILTER - ngx_module_name=$ngx_addon_name - ngx_module_incs= - ngx_module_deps="$HEADERS_MORE_DEPS" - ngx_module_srcs="$HEADERS_MORE_SRCS" - ngx_module_libs= - - . auto/module -else - HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $HEADERS_MORE_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_DEPS $HEADERS_MORE_DEPS" -fi diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/changelog b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/changelog deleted file mode 100644 index 0fd56e3..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/changelog +++ /dev/null @@ -1,72 +0,0 @@ -libnginx-mod-http-headers-more-filter (1:0.38-2) unstable; urgency=medium - - * d/control: bump Standards-Version: 4.7.2, no changes - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:59 +0200 - -libnginx-mod-http-headers-more-filter (1:0.38-1) unstable; urgency=medium - - * New upstream version 0.38 - * d/{control,copyright}: update my email to "janmojzis@debian.org" - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - * d/control: bump Standards-Version: 4.7.0, no changes - - -- Jan Mojžíš Mon, 10 Feb 2025 19:20:06 +0100 - -libnginx-mod-http-headers-more-filter (1:0.37-2) unstable; urgency=medium - - * d/watch: use new recommended github template - - -- Jan Mojžíš Sat, 13 Jan 2024 22:22:57 +0100 - -libnginx-mod-http-headers-more-filter (1:0.37-1) unstable; urgency=medium - - * New upstream version 0.37 - * d/gbp.conf: add [pull] track-missing = True - * d/copyright: bump my copyright year - * d/watch: remove filenamemangle - - -- Jan Mojžíš Sun, 07 Jan 2024 23:40:37 +0100 - -libnginx-mod-http-headers-more-filter (1:0.36-1) unstable; urgency=medium - - * New upstream version 0.36 - - -- Jan Mojžíš Mon, 18 Dec 2023 16:55:54 +0100 - -libnginx-mod-http-headers-more-filter (1:0.34-5) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:27 +0200 - -libnginx-mod-http-headers-more-filter (1:0.34-4) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:38 +0200 - -libnginx-mod-http-headers-more-filter (1:0.34-3) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: bump my copyright year - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:26 +0100 - -libnginx-mod-http-headers-more-filter (1:0.34-2) unstable; urgency=medium - - * d/control: added Multi-Arch: foreign - - -- Jan Mojžíš Fri, 09 Dec 2022 12:50:28 +0100 - -libnginx-mod-http-headers-more-filter (1:0.34-1) experimental; urgency=medium - - * Initial release. (Closes: 1024151) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:53 +0100 diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/control b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/control deleted file mode 100644 index a8ebd83..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/control +++ /dev/null @@ -1,26 +0,0 @@ -Source: libnginx-mod-http-headers-more-filter -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, -Standards-Version: 4.7.2 -Homepage: https://github.com/openresty/headers-more-nginx-module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-headers-more-filter.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-headers-more-filter -Rules-Requires-Root: no - -Package: libnginx-mod-http-headers-more-filter -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Set and clear input and output headers for Nginx - The Headers More module allows you to add, set, or clear any output or input - header that you specify. - . - This is an enhanced version of the standard headers module because it provides - more utilities like resetting or clearing "builtin headers" like Content-Type, - Content-Length, and Server. diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/copyright b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/copyright deleted file mode 100644 index 251922c..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/copyright +++ /dev/null @@ -1,62 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: headers-more-nginx-module -Upstream-Contact: Yichun "agentzh" Zhang (章亦春) -Source: https://github.com/openresty/headers-more-nginx-module - -Files: * -Copyright: 2010-2013, Bernd Dorn. - 2009-2017, Yichun "agentzh" Zhang (\x{7ae0}\x{4ea6}\x{6625}) , OpenResty Inc. -License: BSD-2-clause - -Files: config -Copyright: Igor Sysoev - 2010-2013, Bernd Dorn - 2009-2017, Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: src/* -Copyright: Yichun Zhang (agentzh) -License: BSD-2-clause - -Files: src/ddebug.h -Copyright: Igor Sysoev - 2010-2013, Bernd Dorn - 2009-2017, Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. -License: BSD-2-clause - -Files: t/* -Copyright: Igor Sysoev - 2010-2013, Bernd Dorn - 2009-2017, Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. -License: BSD-2-clause - -Files: util/* -Copyright: Igor Sysoev - 2010-2013, Bernd Dorn - 2009-2017, Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/gbp.conf b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/gbp.conf deleted file mode 100644 index 97cd209..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/gbp.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/rules b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/source/format b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/control b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/control deleted file mode 100644 index b95c6ff..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/control +++ /dev/null @@ -1,13 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: helloworld -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/generic b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/helloworld b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/helloworld deleted file mode 100644 index 6a2e85b..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/helloworld +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - - location /helloworld { - more_set_headers 'Content-Type: text/helloworld'; - more_set_headers -s '200' 'Content-Type: text/helloworld200'; - return 200; - } -} -EOF - -exp="content_type: text/helloworld200 -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --fail -w "content_type: %{content_type}\nresponse_code: %{http_code}\n" http://127.0.0.1/helloworld` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/upstream/metadata b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/upstream/metadata deleted file mode 100644 index 185ca21..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/openresty/headers-more-nginx-module/issues -Bug-Submit: https://github.com/openresty/headers-more-nginx-module/issues/new -Repository-Browse: https://github.com/openresty/headers-more-nginx-module diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/watch b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/watch deleted file mode 100644 index 426294e..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/openresty/headers-more-nginx-module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ddebug.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ddebug.h deleted file mode 100644 index 13879af..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ddebug.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef DDEBUG_H -#define DDEBUG_H - - -#include -#include -#include -#include - - -#if defined(DDEBUG) && (DDEBUG) - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) fprintf(stderr, "headers-more *** %s: ", __func__); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__) - -# else - -#include -#include - -#include - -static ngx_inline void -dd(const char * fmt, ...) { -} - -# endif - -# if DDEBUG > 1 - -# define dd_enter() dd_enter_helper(r, __func__) - -# if defined(nginx_version) && nginx_version >= 8011 -# define dd_main_req_count r->main->count -# else -# define dd_main_req_count 0 -# endif - -static ngx_inline void -dd_enter_helper(ngx_http_request_t *r, const char *func) -{ - ngx_http_posted_request_t *pr; - - fprintf(stderr, "headers-more *** enter %s %.*s %.*s?%.*s c:%d m:%p r:%p ar:%p pr:%p", - func, - (int) r->method_name.len, r->method_name.data, - (int) r->uri.len, r->uri.data, - (int) r->args.len, r->args.data, - (int) dd_main_req_count, r->main, - r, r->connection->data, r->parent); - - if (r->posted_requests) { - fprintf(stderr, " posted:"); - - for (pr = r->posted_requests; pr; pr = pr->next) { - fprintf(stderr, "%p,", pr); - } - } - - fprintf(stderr, "\n"); -} - -# else - -# define dd_enter() - -# endif - -#else - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) - -# define dd_enter() - -# else - -#include - -static ngx_inline void -dd(const char * fmt, ...) { -} - -static ngx_inline void -dd_enter() { -} - -# endif - -#endif - -#if defined(DDEBUG) && (DDEBUG) - -#define dd_check_read_event_handler(r) \ - dd("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#define dd_check_write_event_handler(r) \ - dd("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - -#define dd_check_read_event_handler(r) -#define dd_check_write_event_handler(r) - -#endif - -#endif /* DDEBUG_H */ - diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.c b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.c deleted file mode 100644 index 0bb6fec..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.c +++ /dev/null @@ -1,348 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_headers_more_filter_module.h" -#include "ngx_http_headers_more_headers_out.h" -#include "ngx_http_headers_more_headers_in.h" -#include "ngx_http_headers_more_util.h" -#include - - -/* config handlers */ - -static void *ngx_http_headers_more_create_loc_conf(ngx_conf_t *cf); -static char *ngx_http_headers_more_merge_loc_conf(ngx_conf_t *cf, - void *parent, void *child); -static void *ngx_http_headers_more_create_main_conf(ngx_conf_t *cf); -static ngx_int_t ngx_http_headers_more_post_config(ngx_conf_t *cf); - -/* post-read-phase handler */ - -static ngx_int_t ngx_http_headers_more_handler(ngx_http_request_t *r); - -/* filter handlers */ - -static ngx_int_t ngx_http_headers_more_filter_init(ngx_conf_t *cf); - -ngx_uint_t ngx_http_headers_more_location_hash = 0; - - -static ngx_command_t ngx_http_headers_more_filter_commands[] = { - - { ngx_string("more_set_headers"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF - |NGX_CONF_1MORE, - ngx_http_headers_more_set_headers, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL}, - - { ngx_string("more_clear_headers"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF - |NGX_CONF_1MORE, - ngx_http_headers_more_clear_headers, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL}, - - { ngx_string("more_set_input_headers"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF - |NGX_CONF_1MORE, - ngx_http_headers_more_set_input_headers, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL}, - - { ngx_string("more_clear_input_headers"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF - |NGX_CONF_1MORE, - ngx_http_headers_more_clear_input_headers, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL}, - - ngx_null_command -}; - - -static ngx_http_module_t ngx_http_headers_more_filter_module_ctx = { - NULL, /* preconfiguration */ - ngx_http_headers_more_post_config, /* postconfiguration */ - - ngx_http_headers_more_create_main_conf, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_headers_more_create_loc_conf, /* create location configuration */ - ngx_http_headers_more_merge_loc_conf /* merge location configuration */ -}; - - -ngx_module_t ngx_http_headers_more_filter_module = { - NGX_MODULE_V1, - &ngx_http_headers_more_filter_module_ctx, /* module context */ - ngx_http_headers_more_filter_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static ngx_http_output_header_filter_pt ngx_http_next_header_filter; - - -static volatile ngx_cycle_t *ngx_http_headers_more_prev_cycle = NULL; - - -static ngx_int_t -ngx_http_headers_more_filter(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_uint_t i; - ngx_http_headers_more_loc_conf_t *conf; - ngx_http_headers_more_cmd_t *cmd; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "headers more header filter, uri \"%V\"", &r->uri); - - conf = ngx_http_get_module_loc_conf(r, ngx_http_headers_more_filter_module); - - if (conf->cmds) { - cmd = conf->cmds->elts; - for (i = 0; i < conf->cmds->nelts; i++) { - if (cmd[i].is_input) { - continue; - } - - rc = ngx_http_headers_more_exec_cmd(r, &cmd[i]); - - if (rc != NGX_OK) { - return rc; - } - } - } - - return ngx_http_next_header_filter(r); -} - - -static ngx_int_t -ngx_http_headers_more_filter_init(ngx_conf_t *cf) -{ - ngx_http_next_header_filter = ngx_http_top_header_filter; - ngx_http_top_header_filter = ngx_http_headers_more_filter; - - return NGX_OK; -} - - -static void * -ngx_http_headers_more_create_loc_conf(ngx_conf_t *cf) -{ - ngx_http_headers_more_loc_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_headers_more_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* - * set by ngx_pcalloc(): - * - * conf->cmds = NULL; - */ - - return conf; -} - - -static char * -ngx_http_headers_more_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) -{ - ngx_uint_t i; - ngx_uint_t orig_len; - ngx_http_headers_more_cmd_t *prev_cmd, *cmd; - ngx_http_headers_more_loc_conf_t *prev = parent; - ngx_http_headers_more_loc_conf_t *conf = child; - - if (conf->cmds == NULL || conf->cmds->nelts == 0) { - conf->cmds = prev->cmds; - - } else if (prev->cmds && prev->cmds->nelts) { - orig_len = conf->cmds->nelts; - - (void) ngx_array_push_n(conf->cmds, prev->cmds->nelts); - - cmd = conf->cmds->elts; - - for (i = 0; i < orig_len; i++) { - cmd[conf->cmds->nelts - 1 - i] = cmd[orig_len - 1 - i]; - } - - prev_cmd = prev->cmds->elts; - - for (i = 0; i < prev->cmds->nelts; i++) { - cmd[i] = prev_cmd[i]; - } - } - - return NGX_CONF_OK; -} - - -static ngx_int_t -ngx_http_headers_more_post_config(ngx_conf_t *cf) -{ - int multi_http_blocks; - ngx_int_t rc; - ngx_http_handler_pt *h; - ngx_http_core_main_conf_t *cmcf; - - ngx_http_headers_more_main_conf_t *hmcf; - - ngx_http_headers_more_location_hash = - ngx_http_headers_more_hash_literal("location"); - - hmcf = ngx_http_conf_get_module_main_conf(cf, - ngx_http_headers_more_filter_module); - - if (ngx_http_headers_more_prev_cycle != ngx_cycle) { - ngx_http_headers_more_prev_cycle = ngx_cycle; - multi_http_blocks = 0; - - } else { - multi_http_blocks = 1; - } - - if (multi_http_blocks || hmcf->requires_filter) { - rc = ngx_http_headers_more_filter_init(cf); - if (rc != NGX_OK) { - return rc; - } - } - - if (!hmcf->requires_handler) { - return NGX_OK; - } - - cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); - - h = ngx_array_push(&cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers); - if (h == NULL) { - return NGX_ERROR; - } - - *h = ngx_http_headers_more_handler; - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_headers_more_handler(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_uint_t i; - ngx_http_headers_more_loc_conf_t *conf; - ngx_http_headers_more_main_conf_t *hmcf; - ngx_http_headers_more_cmd_t *cmd; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "headers more rewrite handler, uri \"%V\"", &r->uri); - - hmcf = ngx_http_get_module_main_conf(r, - ngx_http_headers_more_filter_module); - - if (!hmcf->postponed_to_phase_end) { - ngx_http_core_main_conf_t *cmcf; - ngx_http_phase_handler_t tmp; - ngx_http_phase_handler_t *ph; - ngx_http_phase_handler_t *cur_ph; - ngx_http_phase_handler_t *last_ph; - - hmcf->postponed_to_phase_end = 1; - - cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); - - ph = cmcf->phase_engine.handlers; - cur_ph = &ph[r->phase_handler]; - last_ph = &ph[cur_ph->next - 1]; - - if (cur_ph < last_ph) { - dd("swaping the contents of cur_ph and last_ph..."); - - tmp = *cur_ph; - - memmove(cur_ph, cur_ph + 1, - (last_ph - cur_ph) * sizeof (ngx_http_phase_handler_t)); - - *last_ph = tmp; - - r->phase_handler--; /* redo the current ph */ - - return NGX_DECLINED; - } - } - - dd("running phase handler..."); - - conf = ngx_http_get_module_loc_conf(r, ngx_http_headers_more_filter_module); - - if (conf->cmds) { - if (r->http_version < NGX_HTTP_VERSION_10) { - return NGX_DECLINED; - } - - cmd = conf->cmds->elts; - for (i = 0; i < conf->cmds->nelts; i++) { - if (!cmd[i].is_input) { - continue; - } - - rc = ngx_http_headers_more_exec_input_cmd(r, &cmd[i]); - - if (rc != NGX_OK) { - return rc; - } - } - } - - return NGX_DECLINED; -} - - -static void * -ngx_http_headers_more_create_main_conf(ngx_conf_t *cf) -{ - ngx_http_headers_more_main_conf_t *hmcf; - - hmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_headers_more_main_conf_t)); - if (hmcf == NULL) { - return NULL; - } - - /* set by ngx_pcalloc: - * hmcf->postponed_to_phase_end = 0; - * hmcf->requires_filter = 0; - * hmcf->requires_handler = 0; - */ - - return hmcf; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.h deleted file mode 100644 index 5f31ab4..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.h +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H -#define NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H - - -#include -#include -#include - - -typedef enum { - ngx_http_headers_more_opcode_set, - ngx_http_headers_more_opcode_clear -} ngx_http_headers_more_opcode_t; - - -typedef struct { - ngx_array_t *types; /* of ngx_str_t */ - ngx_array_t *statuses; /* of ngx_uint_t */ - ngx_array_t *headers; /* of ngx_http_header_val_t */ - ngx_flag_t is_input; -} ngx_http_headers_more_cmd_t; - - -typedef struct { - ngx_array_t *cmds; /* of ngx_http_headers_more_cmd_t */ -} ngx_http_headers_more_loc_conf_t; - - -typedef struct { - ngx_int_t postponed_to_phase_end; - ngx_int_t requires_filter; - ngx_int_t requires_handler; -} ngx_http_headers_more_main_conf_t; - - -typedef struct ngx_http_headers_more_header_val_s - ngx_http_headers_more_header_val_t; - - -typedef ngx_int_t (*ngx_http_headers_more_set_header_pt)(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); - - -typedef struct { - ngx_str_t name; - ngx_uint_t offset; - ngx_http_headers_more_set_header_pt handler; -} ngx_http_headers_more_set_header_t; - - -struct ngx_http_headers_more_header_val_s { - ngx_http_complex_value_t value; - ngx_uint_t hash; - ngx_str_t key; - ngx_http_headers_more_set_header_pt handler; - ngx_uint_t offset; - unsigned replace:1; - unsigned wildcard:1; - unsigned append:1; -}; - - -extern ngx_module_t ngx_http_headers_more_filter_module; - - -#ifndef ngx_str_set -#define ngx_str_set(str, text) \ - (str)->len = sizeof(text) - 1; (str)->data = (u_char *) text -#endif - - -#define ngx_http_headers_more_assert(a) assert(a) - - -#endif /* NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H */ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.c b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.c deleted file mode 100644 index 983be5b..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.c +++ /dev/null @@ -1,959 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_headers_more_headers_in.h" -#include "ngx_http_headers_more_util.h" -#include - - -static char *ngx_http_headers_more_parse_directive(ngx_conf_t *cf, - ngx_command_t *ngx_cmd, void *conf, - ngx_http_headers_more_opcode_t opcode); -static int ngx_http_headers_more_check_type(ngx_http_request_t *r, - ngx_array_t *types); -static ngx_int_t ngx_http_set_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_header_helper(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value, - ngx_table_elt_t **output_header); -static ngx_int_t ngx_http_set_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_user_agent_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_clear_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_clear_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_host_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_connection_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_builtin_multi_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_headers_more_validate_host(ngx_str_t *host, - ngx_pool_t *pool, ngx_uint_t alloc); - - -static ngx_http_headers_more_set_header_t ngx_http_headers_more_set_handlers[] - = { - - { ngx_string("Host"), - offsetof(ngx_http_headers_in_t, host), - ngx_http_set_host_header }, - - { ngx_string("Connection"), - offsetof(ngx_http_headers_in_t, connection), - ngx_http_set_connection_header }, - - { ngx_string("If-Modified-Since"), - offsetof(ngx_http_headers_in_t, if_modified_since), - ngx_http_set_builtin_header }, - -#if defined(nginx_version) && nginx_version >= 9002 - { ngx_string("If-Unmodified-Since"), - offsetof(ngx_http_headers_in_t, if_unmodified_since), - ngx_http_set_builtin_header }, -#endif - -#if defined(nginx_version) && nginx_version >= 1003003 - { ngx_string("If-Match"), - offsetof(ngx_http_headers_in_t, if_match), - ngx_http_set_builtin_header }, - - { ngx_string("If-None-Match"), - offsetof(ngx_http_headers_in_t, if_none_match), - ngx_http_set_builtin_header }, -#endif - - { ngx_string("User-Agent"), - offsetof(ngx_http_headers_in_t, user_agent), - ngx_http_set_user_agent_header }, - - { ngx_string("Referer"), - offsetof(ngx_http_headers_in_t, referer), - ngx_http_set_builtin_header }, - - { ngx_string("Content-Length"), - offsetof(ngx_http_headers_in_t, content_length), - ngx_http_set_content_length_header }, - - { ngx_string("Content-Type"), - offsetof(ngx_http_headers_in_t, content_type), - ngx_http_set_builtin_header }, - - { ngx_string("Range"), - offsetof(ngx_http_headers_in_t, range), - ngx_http_set_builtin_header }, - - { ngx_string("If-Range"), - offsetof(ngx_http_headers_in_t, if_range), - ngx_http_set_builtin_header }, - - { ngx_string("Transfer-Encoding"), - offsetof(ngx_http_headers_in_t, transfer_encoding), - ngx_http_set_builtin_header }, - - { ngx_string("Expect"), - offsetof(ngx_http_headers_in_t, expect), - ngx_http_set_builtin_header }, - -#if defined(nginx_version) && nginx_version >= 1003013 - { ngx_string("Upgrade"), - offsetof(ngx_http_headers_in_t, upgrade), - ngx_http_set_builtin_header }, -#endif - -#if (NGX_HTTP_GZIP) - { ngx_string("Accept-Encoding"), - offsetof(ngx_http_headers_in_t, accept_encoding), - ngx_http_set_builtin_header }, - - { ngx_string("Via"), offsetof(ngx_http_headers_in_t, via), - ngx_http_set_builtin_header }, -#endif - - { ngx_string("Authorization"), - offsetof(ngx_http_headers_in_t, authorization), - ngx_http_set_builtin_header }, - - { ngx_string("Keep-Alive"), - offsetof(ngx_http_headers_in_t, keep_alive), - ngx_http_set_builtin_header }, - -#if (NGX_HTTP_X_FORWARDED_FOR) - { ngx_string("X-Forwarded-For"), - offsetof(ngx_http_headers_in_t, x_forwarded_for), - ngx_http_set_builtin_multi_header }, - -#endif - -#if (NGX_HTTP_REALIP) - { ngx_string("X-Real-IP"), - offsetof(ngx_http_headers_in_t, x_real_ip), - ngx_http_set_builtin_header }, -#endif - -#if (NGX_HTTP_DAV) - { ngx_string("Depth"), offsetof(ngx_http_headers_in_t, depth), - ngx_http_set_builtin_header }, - - { ngx_string("Destination"), offsetof(ngx_http_headers_in_t, destination), - ngx_http_set_builtin_header }, - - { ngx_string("Overwrite"), offsetof(ngx_http_headers_in_t, overwrite), - ngx_http_set_builtin_header }, - - { ngx_string("Date"), offsetof(ngx_http_headers_in_t, date), - ngx_http_set_builtin_header }, -#endif - -#if defined(nginx_version) && nginx_version >= 1023000 - { ngx_string("Cookie"), - offsetof(ngx_http_headers_in_t, cookie), - ngx_http_set_builtin_multi_header }, -#else - { ngx_string("Cookie"), - offsetof(ngx_http_headers_in_t, cookies), - ngx_http_set_builtin_multi_header }, -#endif - - { ngx_null_string, 0, ngx_http_set_header } -}; - - -ngx_int_t -ngx_http_headers_more_exec_input_cmd(ngx_http_request_t *r, - ngx_http_headers_more_cmd_t *cmd) -{ - ngx_str_t value; - ngx_http_headers_more_header_val_t *h; - ngx_uint_t i; - - if (!cmd->headers) { - return NGX_OK; - } - - if (cmd->types && !ngx_http_headers_more_check_type(r, cmd->types)) { - return NGX_OK; - } - - h = cmd->headers->elts; - for (i = 0; i < cmd->headers->nelts; i++) { - - if (ngx_http_complex_value(r, &h[i].value, &value) != NGX_OK) { - return NGX_ERROR; - } - - if (value.len) { - value.len--; /* remove the trailing '\0' added by - ngx_http_headers_more_parse_header */ - } - - if (h[i].handler(r, &h[i], &value) != NGX_OK) { - return NGX_ERROR; - } - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - return ngx_http_set_header_helper(r, hv, value, NULL); -} - - -static ngx_int_t -ngx_http_set_header_helper(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value, - ngx_table_elt_t **output_header) -{ - ngx_table_elt_t *h, *matched; - ngx_list_part_t *part; - ngx_uint_t i; - ngx_uint_t rc; - - dd_enter(); - - matched = NULL; - -retry: - - part = &r->headers_in.headers.part; - h = part->elts; - - for (i = 0; /* void */; i++) { - dd("i: %d, part: %p", (int) i, part); - - if (i >= part->nelts) { - if (part->next == NULL) { - break; - } - - part = part->next; - h = part->elts; - i = 0; - } - - if (!hv->wildcard - && h[i].key.len == hv->key.len - && ngx_strncasecmp(h[i].key.data, hv->key.data, - h[i].key.len) == 0) - { - goto matched; - } - - if (hv->wildcard - && value->len == 0 - && h[i].key.len >= hv->key.len - 1 - && ngx_strncasecmp(h[i].key.data, hv->key.data, - hv->key.len - 1) == 0) - { - goto matched; - } - - /* not matched */ - continue; - -matched: - - if (value->len == 0 || (matched && matched != &h[i])) { - h[i].hash = 0; - - rc = ngx_http_headers_more_rm_header_helper( - &r->headers_in.headers, part, i); - - ngx_http_headers_more_assert( - !(r->headers_in.headers.part.next == NULL - && r->headers_in.headers.last - != &r->headers_in.headers.part)); - - if (rc == NGX_OK) { - if (output_header) { - *output_header = NULL; - } - - goto retry; - } - - return NGX_ERROR; - } - - h[i].value = *value; - - if (output_header) { - *output_header = &h[i]; - dd("setting existing builtin input header"); - } - - if (matched == NULL) { - matched = &h[i]; - } - } - - if (matched) { - return NGX_OK; - } - - if (value->len == 0 || hv->replace) { - return NGX_OK; - } - - if (r->headers_in.headers.last == NULL) { - /* must be 400 bad request */ - return NGX_OK; - } - - h = ngx_list_push(&r->headers_in.headers); - - if (h == NULL) { - return NGX_ERROR; - } - - dd("created new header for %.*s", (int) hv->key.len, hv->key.data); - - if (value->len == 0) { - h->hash = 0; - - } else { - h->hash = hv->hash; - } - - h->key = hv->key; - h->value = *value; -#if defined(nginx_version) && nginx_version >= 1023000 - h->next = NULL; -#endif - - h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); - if (h->lowcase_key == NULL) { - return NGX_ERROR; - } - - ngx_strlow(h->lowcase_key, h->key.data, h->key.len); - - if (output_header) { - *output_header = h; - - while (r != r->main) { - r->parent->headers_in = r->headers_in; - r = r->parent; - } - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - ngx_table_elt_t *h, **old; - - dd("entered set_builtin_header (input)"); - - if (hv->offset) { - old = (ngx_table_elt_t **) ((char *) &r->headers_in + hv->offset); - - } else { - old = NULL; - } - - dd("old builtin ptr ptr: %p", old); - if (old) { - dd("old builtin ptr: %p", *old); - } - - if (old == NULL || *old == NULL) { - dd("set normal header"); - return ngx_http_set_header_helper(r, hv, value, old); - } - - h = *old; - - if (value->len == 0) { - h->hash = 0; - h->value = *value; - - return ngx_http_set_header_helper(r, hv, value, old); - } - - h->hash = hv->hash; - h->value = *value; - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_host_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - ngx_str_t host; - - if (value->len) { - host= *value; - - if (ngx_http_headers_more_validate_host(&host, r->pool, 0) != NGX_OK) { - return NGX_ERROR; - } - - r->headers_in.server = host; - - } else { - r->headers_in.server = *value; - } - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_set_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - off_t len; - - if (value->len == 0) { - return ngx_http_clear_content_length_header(r, hv, value); - } - - len = ngx_atosz(value->data, value->len); - if (len == NGX_ERROR) { - return NGX_ERROR; - } - - dd("reset headers_in.content_length_n to %d", (int) len); - - r->headers_in.content_length_n = len; - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_clear_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - r->headers_in.content_length_n = -1; - - return ngx_http_clear_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_clear_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - value->len = 0; - return ngx_http_set_builtin_header(r, hv, value); -} - - -char * -ngx_http_headers_more_set_input_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - return ngx_http_headers_more_parse_directive(cf, cmd, conf, - ngx_http_headers_more_opcode_set); -} - - -char * -ngx_http_headers_more_clear_input_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - return ngx_http_headers_more_parse_directive(cf, cmd, conf, - ngx_http_headers_more_opcode_clear); -} - - -static int -ngx_http_headers_more_check_type(ngx_http_request_t *r, ngx_array_t *types) -{ - ngx_uint_t i; - ngx_str_t *t; - ngx_str_t actual_type; - - if (r->headers_in.content_type == NULL) { - return 0; - } - - actual_type = r->headers_in.content_type->value; - if (actual_type.len == 0) { - return 0; - } - - dd("headers_in->content_type: %.*s", - (int) actual_type.len, - actual_type.data); - - t = types->elts; - for (i = 0; i < types->nelts; i++) { - dd("...comparing with type [%.*s]", (int) t[i].len, t[i].data); - - if (actual_type.len == t[i].len - && ngx_strncmp(actual_type.data, t[i].data, t[i].len) == 0) - { - return 1; - } - } - - return 0; -} - - -static char * -ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd, - void *conf, ngx_http_headers_more_opcode_t opcode) -{ - ngx_http_headers_more_loc_conf_t *hlcf = conf; - - ngx_uint_t i; - ngx_http_headers_more_cmd_t *cmd; - ngx_str_t *arg; - ngx_flag_t ignore_next_arg; - ngx_str_t *cmd_name; - ngx_int_t rc; - ngx_flag_t replace = 0; - ngx_http_headers_more_header_val_t *h; - - ngx_http_headers_more_main_conf_t *hmcf; - - if (hlcf->cmds == NULL) { - hlcf->cmds = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_headers_more_cmd_t)); - - if (hlcf->cmds == NULL) { - return NGX_CONF_ERROR; - } - } - - cmd = ngx_array_push(hlcf->cmds); - - if (cmd == NULL) { - return NGX_CONF_ERROR; - } - - cmd->headers = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_headers_more_header_val_t)); - - if (cmd->headers == NULL) { - return NGX_CONF_ERROR; - } - - cmd->types = ngx_array_create(cf->pool, 1, sizeof(ngx_str_t)); - if (cmd->types == NULL) { - return NGX_CONF_ERROR; - } - - cmd->statuses = NULL; - - arg = cf->args->elts; - - cmd_name = &arg[0]; - - ignore_next_arg = 0; - - for (i = 1; i < cf->args->nelts; i++) { - if (ignore_next_arg) { - ignore_next_arg = 0; - continue; - } - - if (arg[i].len == 0) { - continue; - } - - if (arg[i].data[0] != '-') { - rc = ngx_http_headers_more_parse_header(cf, cmd_name, - &arg[i], cmd->headers, - opcode, - ngx_http_headers_more_set_handlers); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - continue; - } - - if (arg[i].len == 2) { - if (arg[i].data[1] == 't') { - if (i == cf->args->nelts - 1) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: option -t takes an argument.", - cmd_name); - - return NGX_CONF_ERROR; - } - - rc = ngx_http_headers_more_parse_types(cf->log, cmd_name, - &arg[i + 1], - cmd->types); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - ignore_next_arg = 1; - - continue; - } - - if (arg[i].data[1] == 'r') { - dd("Found replace flag"); - replace = 1; - continue; - } - } - - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: invalid option name: \"%V\"", cmd_name, &arg[i]); - - return NGX_CONF_ERROR; - } - - dd("Found %d types, and %d headers", - (int) cmd->types->nelts, - (int) cmd->headers->nelts); - - if (cmd->headers->nelts == 0) { - ngx_pfree(cf->pool, cmd->headers); - cmd->headers = NULL; - - } else { - h = cmd->headers->elts; - for (i = 0; i < cmd->headers->nelts; i++) { - h[i].replace = replace; - } - } - - if (cmd->types->nelts == 0) { - ngx_pfree(cf->pool, cmd->types); - cmd->types = NULL; - } - - cmd->is_input = 1; - - hmcf = ngx_http_conf_get_module_main_conf(cf, - ngx_http_headers_more_filter_module); - - hmcf->requires_handler = 1; - - return NGX_CONF_OK; -} - - -/* borrowed the code from ngx_http_request.c:ngx_http_process_user_agent */ -static ngx_int_t -ngx_http_set_user_agent_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - u_char *user_agent, *msie; - - /* clear existing settings */ - - r->headers_in.msie = 0; - r->headers_in.msie6 = 0; - r->headers_in.opera = 0; - r->headers_in.gecko = 0; - r->headers_in.chrome = 0; - r->headers_in.safari = 0; - r->headers_in.konqueror = 0; - - if (value->len == 0) { - return ngx_http_set_builtin_header(r, hv, value); - } - - /* check some widespread browsers */ - - user_agent = value->data; - - msie = ngx_strstrn(user_agent, "MSIE ", 5 - 1); - - if (msie && msie + 7 < user_agent + value->len) { - - r->headers_in.msie = 1; - - if (msie[6] == '.') { - - switch (msie[5]) { - case '4': - case '5': - r->headers_in.msie6 = 1; - break; - case '6': - if (ngx_strstrn(msie + 8, "SV1", 3 - 1) == NULL) { - r->headers_in.msie6 = 1; - } - break; - } - } - } - - if (ngx_strstrn(user_agent, "Opera", 5 - 1)) { - r->headers_in.opera = 1; - r->headers_in.msie = 0; - r->headers_in.msie6 = 0; - } - - if (!r->headers_in.msie && !r->headers_in.opera) { - - if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) { - r->headers_in.gecko = 1; - - } else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) { - r->headers_in.chrome = 1; - - } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1) - && ngx_strstrn(user_agent, "Mac OS X", 8 - 1)) - { - r->headers_in.safari = 1; - - } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) { - r->headers_in.konqueror = 1; - } - } - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_set_connection_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - r->headers_in.connection_type = 0; - - if (value->len == 0) { - return ngx_http_set_builtin_header(r, hv, value); - } - - if (ngx_strcasestrn(value->data, "close", 5 - 1)) { - r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE; - r->headers_in.keep_alive_n = -1; - r->keepalive = 0; - - } else if (ngx_strcasestrn(value->data, "keep-alive", 10 - 1)) { - r->headers_in.connection_type = NGX_HTTP_CONNECTION_KEEP_ALIVE; - } - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_set_builtin_multi_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ -#if defined(nginx_version) && nginx_version >= 1023000 - ngx_table_elt_t **headers, **ph, *h; -#if (DDEBUG) - int nelts; -#endif - - if (r->headers_out.status == 400 || r->headers_in.headers.last == NULL) { - /* must be a 400 Bad Request */ - return NGX_OK; - } - - headers = (ngx_table_elt_t **) ((char *) &r->headers_in + hv->offset); - - if (*headers) { -#if (DDEBUG) - nelts = 0; - for (h = *headers; h; h = h->next) { - nelts++; - } - - dd("clear multi-value headers: %d", nelts); -#endif - - *headers = NULL; - } - - if (ngx_http_set_header_helper(r, hv, value, &h) == NGX_ERROR) { - return NGX_ERROR; - } - - if (value->len == 0) { - return NGX_OK; - } - - dd("new multi-value header: %p", h); - - if (*headers) { - for (ph = headers; *ph; ph = &(*ph)->next) { /* void */ } - *ph = h; - - } else { - *headers = h; - } - - h->next = NULL; - - return NGX_OK; -#else - ngx_array_t *headers; - ngx_table_elt_t **v, *h; - - if (r->headers_out.status == 400 || r->headers_in.headers.last == NULL) { - /* must be a 400 Bad Request */ - return NGX_OK; - } - - headers = (ngx_array_t *) ((char *) &r->headers_in + hv->offset); - - if (headers->nelts > 0) { - ngx_array_destroy(headers); - - if (ngx_array_init(headers, r->pool, 2, - sizeof(ngx_table_elt_t *)) - != NGX_OK) - { - return NGX_ERROR; - } - - dd("clear multi-value headers: %d", (int) headers->nelts); - } - -#if 1 - if (headers->nalloc == 0) { - if (ngx_array_init(headers, r->pool, 2, - sizeof(ngx_table_elt_t *)) - != NGX_OK) - { - return NGX_ERROR; - } - } -#endif - - h = NULL; - if (ngx_http_set_header_helper(r, hv, value, &h) == NGX_ERROR) { - return NGX_ERROR; - } - - if (value->len == 0) { - return NGX_OK; - } - - dd("new cookie header: %p", h); - - v = ngx_array_push(headers); - if (v == NULL) { - return NGX_ERROR; - } - - *v = h; - return NGX_OK; -#endif -} - - -static ngx_int_t -ngx_http_headers_more_validate_host(ngx_str_t *host, ngx_pool_t *pool, - ngx_uint_t alloc) -{ - u_char *h, ch; - size_t i, dot_pos, host_len; - - enum { - sw_usual = 0, - sw_literal, - sw_rest - } state; - - dot_pos = host->len; - host_len = host->len; - - h = host->data; - - state = sw_usual; - - for (i = 0; i < host->len; i++) { - ch = h[i]; - - switch (ch) { - - case '.': - if (dot_pos == i - 1) { - return NGX_DECLINED; - } - - dot_pos = i; - break; - - case ':': - if (state == sw_usual) { - host_len = i; - state = sw_rest; - } - break; - - case '[': - if (i == 0) { - state = sw_literal; - } - break; - - case ']': - if (state == sw_literal) { - host_len = i + 1; - state = sw_rest; - } - break; - - case '\0': - return NGX_DECLINED; - - default: - - if (ngx_path_separator(ch)) { - return NGX_DECLINED; - } - - if (ch >= 'A' && ch <= 'Z') { - alloc = 1; - } - - break; - } - } - - if (dot_pos == host_len - 1) { - host_len--; - } - - if (host_len == 0) { - return NGX_DECLINED; - } - - if (alloc) { - host->data = ngx_pnalloc(pool, host_len); - if (host->data == NULL) { - return NGX_ERROR; - } - - ngx_strlow(host->data, h, host_len); - } - - host->len = host_len; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.h deleted file mode 100644 index d2251da..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.h +++ /dev/null @@ -1,26 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_HEADERS_MORE_INPUT_HEADERS_H -#define NGX_HTTP_HEADERS_MORE_INPUT_HEADERS_H - - -#include "ngx_http_headers_more_filter_module.h" - - -/* output header setters and clearers */ - -ngx_int_t ngx_http_headers_more_exec_input_cmd(ngx_http_request_t *r, - ngx_http_headers_more_cmd_t *cmd); - -char *ngx_http_headers_more_set_input_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - -char *ngx_http_headers_more_clear_input_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - - -#endif /* NGX_HTTP_HEADERS_MORE_INPUT_HEADERS_H */ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.c b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.c deleted file mode 100644 index 2a95b5f..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.c +++ /dev/null @@ -1,814 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_headers_more_headers_out.h" -#include "ngx_http_headers_more_util.h" -#include - - -static char * -ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd, - void *conf, ngx_http_headers_more_opcode_t opcode); -static ngx_flag_t ngx_http_headers_more_check_type(ngx_http_request_t *r, - ngx_array_t *types); -static ngx_flag_t ngx_http_headers_more_check_status(ngx_http_request_t *r, - ngx_array_t *statuses); -static ngx_int_t ngx_http_set_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_header_helper(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value, - ngx_table_elt_t **output_header, ngx_flag_t no_create); -static ngx_int_t ngx_http_set_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_accept_ranges_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_content_type_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_clear_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_clear_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_builtin_multi_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); - - -static ngx_http_headers_more_set_header_t ngx_http_headers_more_set_handlers[] - = { - - { ngx_string("Server"), - offsetof(ngx_http_headers_out_t, server), - ngx_http_set_builtin_header }, - - { ngx_string("Date"), - offsetof(ngx_http_headers_out_t, date), - ngx_http_set_builtin_header }, - - { ngx_string("Content-Encoding"), - offsetof(ngx_http_headers_out_t, content_encoding), - ngx_http_set_builtin_header }, - - { ngx_string("Location"), - offsetof(ngx_http_headers_out_t, location), - ngx_http_set_builtin_header }, - - { ngx_string("Refresh"), - offsetof(ngx_http_headers_out_t, refresh), - ngx_http_set_builtin_header }, - - { ngx_string("Last-Modified"), - offsetof(ngx_http_headers_out_t, last_modified), - ngx_http_set_builtin_header }, - - { ngx_string("Content-Range"), - offsetof(ngx_http_headers_out_t, content_range), - ngx_http_set_builtin_header }, - - { ngx_string("Accept-Ranges"), - offsetof(ngx_http_headers_out_t, accept_ranges), - ngx_http_set_accept_ranges_header }, - - { ngx_string("WWW-Authenticate"), - offsetof(ngx_http_headers_out_t, www_authenticate), - ngx_http_set_builtin_header }, - - { ngx_string("Expires"), - offsetof(ngx_http_headers_out_t, expires), - ngx_http_set_builtin_header }, - - { ngx_string("E-Tag"), - offsetof(ngx_http_headers_out_t, etag), - ngx_http_set_builtin_header }, - - { ngx_string("Content-Length"), - offsetof(ngx_http_headers_out_t, content_length), - ngx_http_set_content_length_header }, - - { ngx_string("Content-Type"), - 0, - ngx_http_set_content_type_header }, - - { ngx_string("Cache-Control"), - offsetof(ngx_http_headers_out_t, cache_control), - ngx_http_set_builtin_multi_header }, - - { ngx_null_string, 0, ngx_http_set_header } -}; - - -ngx_int_t -ngx_http_headers_more_exec_cmd(ngx_http_request_t *r, - ngx_http_headers_more_cmd_t *cmd) -{ - ngx_str_t value; - ngx_http_headers_more_header_val_t *h; - ngx_uint_t i; - - if (!cmd->headers) { - return NGX_OK; - } - - if (cmd->types && !ngx_http_headers_more_check_type(r, cmd->types)) { - return NGX_OK; - } - - if (cmd->statuses - && !ngx_http_headers_more_check_status(r, cmd->statuses)) - { - return NGX_OK; - } - - h = cmd->headers->elts; - for (i = 0; i < cmd->headers->nelts; i++) { - - if (ngx_http_complex_value(r, &h[i].value, &value) != NGX_OK) { - return NGX_ERROR; - } - - if (value.len) { - value.len--; /* remove the trailing '\0' added by - ngx_http_headers_more_parse_header */ - } - - if (h[i].handler(r, &h[i], &value) != NGX_OK) { - return NGX_ERROR; - } - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - return ngx_http_set_header_helper(r, hv, value, NULL, 0); -} - - -static ngx_int_t -ngx_http_set_header_helper(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value, - ngx_table_elt_t **output_header, ngx_flag_t no_create) -{ - ngx_table_elt_t *h; - ngx_list_part_t *part; - ngx_uint_t i; - ngx_flag_t matched = 0; - - dd_enter(); - -#if 1 - if (r->headers_out.location - && r->headers_out.location->value.len - && r->headers_out.location->value.data[0] == '/') - { - /* XXX ngx_http_core_find_config_phase, for example, - * may not initialize the "key" and "hash" fields - * for a nasty optimization purpose, and - * we have to work-around it here */ - - r->headers_out.location->hash = ngx_http_headers_more_location_hash; - ngx_str_set(&r->headers_out.location->key, "Location"); - } -#endif - - if (hv->append) { - goto append; - } - - part = &r->headers_out.headers.part; - h = part->elts; - - for (i = 0; /* void */; i++) { - - if (i >= part->nelts) { - if (part->next == NULL) { - break; - } - - part = part->next; - h = part->elts; - i = 0; - } - - if (h[i].hash == 0) { - continue; - } - - if (!hv->wildcard - && h[i].key.len == hv->key.len - && ngx_strncasecmp(h[i].key.data, hv->key.data, - h[i].key.len) == 0) - { - goto matched; - } - - if (hv->wildcard - && h[i].key.len >= hv->key.len - 1 - && ngx_strncasecmp(h[i].key.data, hv->key.data, - hv->key.len - 1) == 0) - { - goto matched; - } - - /* not matched */ - continue; - -matched: - - if (value->len == 0 || matched) { - dd("clearing normal header for %.*s", (int) hv->key.len, - hv->key.data); - - h[i].value.len = 0; - h[i].hash = 0; - - } else { - h[i].value = *value; - h[i].hash = hv->hash; - } - - if (output_header) { - *output_header = &h[i]; - } - - matched = 1; - } - - if (matched){ - return NGX_OK; - } - - if ((hv->wildcard || no_create) && value->len == 0) { - return NGX_OK; - } - - /* XXX we still need to create header slot even if the value - * is empty because some builtin headers like Last-Modified - * relies on this to get cleared */ - -append: - - h = ngx_list_push(&r->headers_out.headers); - if (h == NULL) { - return NGX_ERROR; - } - - if (value->len == 0) { - h->hash = 0; - - } else { - h->hash = hv->hash; - } - - h->key = hv->key; - h->value = *value; - - h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); - if (h->lowcase_key == NULL) { - return NGX_ERROR; - } - - ngx_strlow(h->lowcase_key, h->key.data, h->key.len); - - if (output_header) { - *output_header = h; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - ngx_table_elt_t *h, **old; - - dd_enter(); - - if (hv->offset) { - old = (ngx_table_elt_t **) ((char *) &r->headers_out + hv->offset); - - } else { - old = NULL; - } - - if (old == NULL || *old == NULL) { - return ngx_http_set_header_helper(r, hv, value, old, 0); - } - - h = *old; - - if (value->len == 0) { - dd("clearing the builtin header"); - - h->hash = 0; - h->value = *value; - - return NGX_OK; - } - - h->hash = hv->hash; - h->key = hv->key; - h->value = *value; - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_builtin_multi_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ -#if defined(nginx_version) && nginx_version >= 1023000 - ngx_table_elt_t **headers, *h, *ho, **ph; - - headers = (ngx_table_elt_t **) ((char *) &r->headers_out + hv->offset); - - if (*headers) { - for (h = (*headers)->next; h; h = h->next) { - h->hash = 0; - h->value.len = 0; - } - - h = *headers; - - h->value = *value; - - if (value->len == 0) { - h->hash = 0; - - } else { - h->hash = hv->hash; - } - - return NGX_OK; - } - - for (ph = headers; *ph; ph = &(*ph)->next) { /* void */ } - - ho = ngx_list_push(&r->headers_out.headers); - if (ho == NULL) { - return NGX_ERROR; - } - - ho->value = *value; - ho->hash = hv->hash; - ngx_str_set(&ho->key, "Cache-Control"); - ho->next = NULL; - *ph = ho; - - return NGX_OK; -#else - ngx_array_t *pa; - ngx_table_elt_t *ho, **ph; - ngx_uint_t i; - - pa = (ngx_array_t *) ((char *) &r->headers_out + hv->offset); - - if (pa->elts == NULL) { - if (ngx_array_init(pa, r->pool, 2, sizeof(ngx_table_elt_t *)) - != NGX_OK) - { - return NGX_ERROR; - } - } - - /* override old values (if any) */ - - if (pa->nelts > 0) { - ph = pa->elts; - for (i = 1; i < pa->nelts; i++) { - ph[i]->hash = 0; - ph[i]->value.len = 0; - } - - ph[0]->value = *value; - - if (value->len == 0) { - ph[0]->hash = 0; - - } else { - ph[0]->hash = hv->hash; - } - - return NGX_OK; - } - - ph = ngx_array_push(pa); - if (ph == NULL) { - return NGX_ERROR; - } - - ho = ngx_list_push(&r->headers_out.headers); - if (ho == NULL) { - return NGX_ERROR; - } - - ho->value = *value; - ho->hash = hv->hash; - ngx_str_set(&ho->key, "Cache-Control"); - *ph = ho; - - return NGX_OK; -#endif -} - - -static ngx_int_t -ngx_http_set_content_type_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - u_char *p, *last, *end; - - r->headers_out.content_type_len = value->len; - r->headers_out.content_type = *value; - r->headers_out.content_type_hash = hv->hash; - r->headers_out.content_type_lowcase = NULL; - - p = value->data; - end = p + value->len; - - for (; p != end; p++) { - - if (*p != ';') { - continue; - } - - last = p; - - while (*++p == ' ') { /* void */ } - - if (p == end) { - break; - } - - if (ngx_strncasecmp(p, (u_char *) "charset=", 8) != 0) { - continue; - } - - p += 8; - - r->headers_out.content_type_len = last - value->data; - - if (*p == '"') { - p++; - } - - last = end; - - if (*(last - 1) == '"') { - last--; - } - - r->headers_out.charset.len = last - p; - r->headers_out.charset.data = p; - - break; - } - - value->len = 0; - - return ngx_http_set_header_helper(r, hv, value, NULL, 1); -} - - -static ngx_int_t -ngx_http_set_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - off_t len; - - if (value->len == 0) { - return ngx_http_clear_content_length_header(r, hv, value); - } - - len = ngx_atosz(value->data, value->len); - if (len == NGX_ERROR) { - return NGX_ERROR; - } - - r->headers_out.content_length_n = len; - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_set_accept_ranges_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - if (value->len == 0) { - r->allow_ranges = 0; - } - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_clear_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - r->headers_out.content_length_n = -1; - - return ngx_http_clear_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_clear_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - dd_enter(); - - value->len = 0; - - return ngx_http_set_builtin_header(r, hv, value); -} - - -char * -ngx_http_headers_more_set_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - return ngx_http_headers_more_parse_directive(cf, cmd, conf, - ngx_http_headers_more_opcode_set); -} - - -char * -ngx_http_headers_more_clear_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - return ngx_http_headers_more_parse_directive(cf, cmd, conf, - ngx_http_headers_more_opcode_clear); -} - - -static ngx_flag_t -ngx_http_headers_more_check_type(ngx_http_request_t *r, ngx_array_t *types) -{ - ngx_uint_t i; - ngx_str_t *t; - - dd("headers_out->content_type: %.*s (len %d)", - (int) r->headers_out.content_type.len, - r->headers_out.content_type.data, - (int) r->headers_out.content_type.len); - - t = types->elts; - - for (i = 0; i < types->nelts; i++) { - dd("...comparing with type [%.*s]", (int) t[i].len, t[i].data); - - if (r->headers_out.content_type_len == t[i].len - && ngx_strncmp(r->headers_out.content_type.data, - t[i].data, t[i].len) == 0) - { - return 1; - } - } - - return 0; -} - - -static ngx_flag_t -ngx_http_headers_more_check_status(ngx_http_request_t *r, ngx_array_t *statuses) -{ - ngx_uint_t i; - ngx_uint_t *status; - - dd("headers_out.status = %d", (int) r->headers_out.status); - - status = statuses->elts; - for (i = 0; i < statuses->nelts; i++) { - dd("...comparing with specified status %d", (int) status[i]); - - if (r->headers_out.status == status[i]) { - return 1; - } - } - - return 0; -} - - -static char * -ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd, - void *conf, ngx_http_headers_more_opcode_t opcode) -{ - ngx_http_headers_more_loc_conf_t *hlcf = conf; - - ngx_uint_t i, j; - ngx_http_headers_more_cmd_t *cmd; - ngx_str_t *arg; - ngx_flag_t ignore_next_arg; - ngx_str_t *cmd_name; - ngx_int_t rc; - ngx_flag_t append = 0; - ngx_flag_t is_builtin_header = 0; - ngx_http_headers_more_header_val_t *h; - ngx_http_headers_more_set_header_t *handlers; - - ngx_http_headers_more_main_conf_t *hmcf; - - if (hlcf->cmds == NULL) { - hlcf->cmds = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_headers_more_cmd_t)); - - if (hlcf->cmds == NULL) { - return NGX_CONF_ERROR; - } - } - - cmd = ngx_array_push(hlcf->cmds); - if (cmd == NULL) { - return NGX_CONF_ERROR; - } - - cmd->headers = - ngx_array_create(cf->pool, 1, - sizeof(ngx_http_headers_more_header_val_t)); - if (cmd->headers == NULL) { - return NGX_CONF_ERROR; - } - - cmd->types = ngx_array_create(cf->pool, 1, sizeof(ngx_str_t)); - if (cmd->types == NULL) { - return NGX_CONF_ERROR; - } - - cmd->statuses = ngx_array_create(cf->pool, 1, sizeof(ngx_uint_t)); - if (cmd->statuses == NULL) { - return NGX_CONF_ERROR; - } - - arg = cf->args->elts; - - cmd_name = &arg[0]; - - ignore_next_arg = 0; - - for (i = 1; i < cf->args->nelts; i++) { - - if (ignore_next_arg) { - ignore_next_arg = 0; - continue; - } - - if (arg[i].len == 0) { - continue; - } - - if (arg[i].data[0] != '-') { - rc = ngx_http_headers_more_parse_header(cf, cmd_name, - &arg[i], cmd->headers, - opcode, - ngx_http_headers_more_set_handlers); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - continue; - } - - if (arg[i].len == 2) { - if (arg[i].data[1] == 't') { - if (i == cf->args->nelts - 1) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: option -t takes an argument.", - cmd_name); - - return NGX_CONF_ERROR; - } - - rc = ngx_http_headers_more_parse_types(cf->log, cmd_name, - &arg[i + 1], - cmd->types); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - ignore_next_arg = 1; - - continue; - - } else if (arg[i].data[1] == 's') { - - if (i == cf->args->nelts - 1) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: option -s takes an argument.", - cmd_name); - - return NGX_CONF_ERROR; - } - - rc = ngx_http_headers_more_parse_statuses(cf->log, cmd_name, - &arg[i + 1], - cmd->statuses); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - ignore_next_arg = 1; - - continue; - - } else if (arg[i].data[1] == 'a') { - - if (ngx_strncasecmp((u_char *) "more_set_headers", - cmd_name->data, cmd_name->len) != 0) - { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: invalid option name: \"%V\"", - cmd_name, &arg[i]); - - return NGX_CONF_ERROR; - } - - dd("Found append flag"); - append = 1; - continue; - } - } - - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: invalid option name: \"%V\"", cmd_name, &arg[i]); - - return NGX_CONF_ERROR; - } - - dd("Found %d statuses, %d types, and %d headers", - (int) cmd->statuses->nelts, (int) cmd->types->nelts, - (int) cmd->headers->nelts); - - if (cmd->headers->nelts == 0) { - cmd->headers = NULL; - - } else { - - h = cmd->headers->elts; - for (i = 0; i < cmd->headers->nelts; i++) { - h[i].append = 0; - - handlers = ngx_http_headers_more_set_handlers; - - for (j = 0; handlers[j].name.len; j++) { - if (h[i].key.len == handlers[j].name.len - && ngx_strncasecmp(h[i].key.data, handlers[j].name.data, - h[i].key.len) == 0) - { - is_builtin_header = 1; - break; - } - } - - if (is_builtin_header && append) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: can not append builtin headers \"%V\"", - cmd_name, &h[i].key); - - return NGX_CONF_ERROR; - } - - if (!is_builtin_header) { - h[i].append = append; - } - } - } - - if (cmd->types->nelts == 0) { - cmd->types = NULL; - } - - if (cmd->statuses->nelts == 0) { - cmd->statuses = NULL; - } - - cmd->is_input = 0; - - hmcf = ngx_http_conf_get_module_main_conf(cf, - ngx_http_headers_more_filter_module); - - hmcf->requires_filter = 1; - - return NGX_CONF_OK; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.h deleted file mode 100644 index c939507..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.h +++ /dev/null @@ -1,26 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_HEADERS_MORE_OUTPUT_HEADERS_H -#define NGX_HTTP_HEADERS_MORE_OUTPUT_HEADERS_H - - -#include "ngx_http_headers_more_filter_module.h" - - -/* output header setters and clearers */ - -ngx_int_t ngx_http_headers_more_exec_cmd(ngx_http_request_t *r, - ngx_http_headers_more_cmd_t *cmd); - -char *ngx_http_headers_more_set_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - -char *ngx_http_headers_more_clear_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - - -#endif /* NGX_HTTP_HEADERS_MORE_OUTPUT_HEADERS_H */ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.c b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.c deleted file mode 100644 index e1f3636..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.c +++ /dev/null @@ -1,382 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_headers_more_util.h" -#include - - -ngx_int_t -ngx_http_headers_more_parse_header(ngx_conf_t *cf, ngx_str_t *cmd_name, - ngx_str_t *raw_header, ngx_array_t *headers, - ngx_http_headers_more_opcode_t opcode, - ngx_http_headers_more_set_header_t *handlers) -{ - ngx_http_headers_more_header_val_t *hv; - - ngx_uint_t i; - ngx_str_t key = ngx_null_string; - ngx_str_t value = ngx_null_string; - ngx_flag_t seen_end_of_key; - ngx_http_compile_complex_value_t ccv; - u_char *p; - - hv = ngx_array_push(headers); - if (hv == NULL) { - return NGX_ERROR; - } - - seen_end_of_key = 0; - for (i = 0; i < raw_header->len; i++) { - if (key.len == 0) { - if (isspace(raw_header->data[i])) { - continue; - } - - key.data = raw_header->data; - key.len = 1; - - continue; - } - - if (!seen_end_of_key) { - if (raw_header->data[i] == ':' - || isspace(raw_header->data[i])) - { - seen_end_of_key = 1; - continue; - } - - key.len++; - - continue; - } - - if (value.len == 0) { - if (raw_header->data[i] == ':' - || isspace(raw_header->data[i])) - { - continue; - } - - value.data = &raw_header->data[i]; - value.len = 1; - - continue; - } - - value.len++; - } - - if (key.len == 0) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: no key found in the header argument: %V", - cmd_name, raw_header); - - return NGX_ERROR; - } - - hv->wildcard = (key.data[key.len - 1] == '*'); - if (hv->wildcard && key.len<2){ - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: wildcard key too short: %V", - cmd_name, raw_header); - return NGX_ERROR; - } - - hv->hash = ngx_hash_key_lc(key.data, key.len); - hv->key = key; - - hv->offset = 0; - - for (i = 0; handlers[i].name.len; i++) { - if (hv->key.len != handlers[i].name.len - || ngx_strncasecmp(hv->key.data, handlers[i].name.data, - handlers[i].name.len) != 0) - { - dd("hv key comparison: %s <> %s", handlers[i].name.data, - hv->key.data); - - continue; - } - - hv->offset = handlers[i].offset; - hv->handler = handlers[i].handler; - - break; - } - - if (handlers[i].name.len == 0 && handlers[i].handler) { - hv->offset = handlers[i].offset; - hv->handler = handlers[i].handler; - } - - if (opcode == ngx_http_headers_more_opcode_clear) { - value.len = 0; - } - - if (value.len == 0) { - ngx_memzero(&hv->value, sizeof(ngx_http_complex_value_t)); - return NGX_OK; - - } - - /* Nginx request header value requires to be a null-terminated - * C string */ - - p = ngx_palloc(cf->pool, value.len + 1); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_memcpy(p, value.data, value.len); - p[value.len] = '\0'; - value.data = p; - value.len++; /* we should also compile the trailing '\0' */ - - /* compile the header value as a complex value */ - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value; - ccv.complex_value = &hv->value; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_ERROR; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_headers_more_parse_statuses(ngx_log_t *log, ngx_str_t *cmd_name, - ngx_str_t *value, ngx_array_t *statuses) -{ - u_char *p, *last; - ngx_uint_t *s = NULL; - - p = value->data; - last = p + value->len; - - for (; p != last; p++) { - if (s == NULL) { - if (isspace(*p)) { - continue; - } - - s = ngx_array_push(statuses); - if (s == NULL) { - return NGX_ERROR; - } - - if (*p >= '0' && *p <= '9') { - *s = *p - '0'; - - } else { - ngx_log_error(NGX_LOG_ERR, log, 0, - "%V: invalid digit \"%c\" found in " - "the status code list \"%V\"", - cmd_name, *p, value); - - return NGX_ERROR; - } - - continue; - } - - if (isspace(*p)) { - dd("Parsed status %d", (int) *s); - - s = NULL; - continue; - } - - if (*p >= '0' && *p <= '9') { - *s *= 10; - *s += *p - '0'; - - } else { - ngx_log_error(NGX_LOG_ERR, log, 0, - "%V: invalid digit \"%c\" found in " - "the status code list \"%V\"", - cmd_name, *p, value); - - return NGX_ERROR; - } - } - - if (s) { - dd("Parsed status %d", (int) *s); - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_headers_more_parse_types(ngx_log_t *log, ngx_str_t *cmd_name, - ngx_str_t *value, ngx_array_t *types) -{ - u_char *p, *last; - ngx_str_t *t = NULL; - - p = value->data; - last = p + value->len; - - for (; p != last; p++) { - if (t == NULL) { - if (isspace(*p) || *p == ';') { - continue; - } - - t = ngx_array_push(types); - if (t == NULL) { - return NGX_ERROR; - } - - t->len = 1; - t->data = p; - - continue; - } - - if (isspace(*p) || *p == ';') { - t = NULL; - continue; - } - - t->len++; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_headers_more_rm_header_helper(ngx_list_t *l, ngx_list_part_t *cur, - ngx_uint_t i) -{ - ngx_table_elt_t *data; - ngx_list_part_t *new, *part; - - dd("list rm item: part %p, i %d, nalloc %d", cur, (int) i, - (int) l->nalloc); - - data = cur->elts; - - dd("cur: nelts %d, nalloc %d", (int) cur->nelts, - (int) l->nalloc); - - if (i == 0) { - cur->elts = (char *) cur->elts + l->size; - cur->nelts--; - - if (cur == l->last) { - if (cur->nelts == 0) { -#if 1 - part = &l->part; - - if (part == cur) { - cur->elts = (char *) cur->elts - l->size; - /* do nothing */ - - } else { - while (part->next != cur) { - if (part->next == NULL) { - return NGX_ERROR; - } - - part = part->next; - } - - l->last = part; - part->next = NULL; - dd("part nelts: %d", (int) part->nelts); - l->nalloc = part->nelts; - } -#endif - - } else { - l->nalloc--; - } - - return NGX_OK; - } - - if (cur->nelts == 0) { - part = &l->part; - - if (part == cur) { - ngx_http_headers_more_assert(cur->next != NULL); - - dd("remove 'cur' from the list by rewriting 'cur': " - "l->last: %p, cur: %p, cur->next: %p, part: %p", - l->last, cur, cur->next, part); - - if (l->last == cur->next) { - dd("last is cur->next"); - l->part = *(cur->next); - l->last = part; - l->nalloc = part->nelts; - - } else { - l->part = *(cur->next); - } - - } else { - dd("remove 'cur' from the list"); - while (part->next != cur) { - if (part->next == NULL) { - return NGX_ERROR; - } - - part = part->next; - } - - part->next = cur->next; - } - - return NGX_OK; - } - - return NGX_OK; - } - - if (i == cur->nelts - 1) { - cur->nelts--; - - if (cur == l->last) { - l->nalloc = cur->nelts; - } - - return NGX_OK; - } - - new = ngx_palloc(l->pool, sizeof(ngx_list_part_t)); - if (new == NULL) { - return NGX_ERROR; - } - - new->elts = &data[i + 1]; - new->nelts = cur->nelts - i - 1; - new->next = cur->next; - - cur->nelts = i; - cur->next = new; - if (cur == l->last) { - l->last = new; - l->nalloc = new->nelts; - } - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.h deleted file mode 100644 index 6c4614b..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.h +++ /dev/null @@ -1,52 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_HEADERS_MORE_UTIL_H -#define NGX_HTTP_HEADERS_MORE_UTIL_H - - -#include "ngx_http_headers_more_filter_module.h" - - -#define ngx_http_headers_more_hash_literal(s) \ - ngx_http_headers_more_hash_str((u_char *) s, sizeof(s) - 1) - - -static ngx_inline ngx_uint_t -ngx_http_headers_more_hash_str(u_char *src, size_t n) -{ - ngx_uint_t key; - - key = 0; - - while (n--) { - key = ngx_hash(key, *src); - src++; - } - - return key; -} - - -extern ngx_uint_t ngx_http_headers_more_location_hash; - - -ngx_int_t ngx_http_headers_more_parse_header(ngx_conf_t *cf, - ngx_str_t *cmd_name, ngx_str_t *raw_header, ngx_array_t *headers, - ngx_http_headers_more_opcode_t opcode, - ngx_http_headers_more_set_header_t *handlers); - -ngx_int_t ngx_http_headers_more_parse_statuses(ngx_log_t *log, - ngx_str_t *cmd_name, ngx_str_t *value, ngx_array_t *statuses); - -ngx_int_t ngx_http_headers_more_parse_types(ngx_log_t *log, - ngx_str_t *cmd_name, ngx_str_t *value, ngx_array_t *types); - -ngx_int_t ngx_http_headers_more_rm_header_helper(ngx_list_t *l, - ngx_list_part_t *cur, ngx_uint_t i); - - -#endif /* NGX_HTTP_HEADERS_MORE_UTIL_H */ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/bug.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/bug.t deleted file mode 100644 index 2339401..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/bug.t +++ /dev/null @@ -1,416 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; # 'no_plan'; - -repeat_each(2); - -plan tests => 56 * repeat_each(); - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set Server ---- config - #more_set_headers 'Last-Modified: x'; - more_clear_headers 'Last-Modified'; ---- request - GET /index.html ---- response_headers -! Last-Modified ---- response_body_like: It works! - - - -=== TEST 2: variables in the Ranges header ---- config - location /index.html { - set $rfrom 1; - set $rto 3; - more_set_input_headers 'Range: bytes=$rfrom - $rto'; - #more_set_input_headers 'Range: bytes=1 - 3'; - #echo $http_range; - } ---- request -GET /index.html ---- error_code: 206 ---- response_body chomp -htm - - - -=== TEST 3: mime type overriding (inlined types) ---- config - more_clear_headers 'X-Powered-By' 'X-Runtime' 'ETag'; - - types { - text/html html htm shtml; - text/css css; - } ---- user_files ->>> a.css -hello ---- request -GET /a.css ---- error_code: 200 ---- response_headers -Content-Type: text/css ---- response_body -hello - - - -=== TEST 4: mime type overriding (included types file) ---- config - more_clear_headers 'X-Powered-By' 'X-Runtime' 'ETag'; - include mime.types; ---- user_files ->>> a.css -hello ->>> ../conf/mime.types -types { - text/html html htm shtml; - text/css css; -} ---- request -GET /a.css ---- error_code: 200 ---- response_headers -Content-Type: text/css ---- response_body -hello - - - -=== TEST 5: empty variable as the header value ---- config - location /foo { - more_set_headers 'X-Foo: $arg_foo'; - echo hi; - } ---- request - GET /foo ---- response_headers -! X-Foo ---- response_body -hi - - - -=== TEST 6: range bug ---- config - location /index.html { - more_clear_input_headers "Range*" ; - more_clear_input_headers "Content-Range*" ; - - more_set_input_headers 'Range: bytes=1-5'; - more_set_headers 'Content-Range: bytes 1-5/1000'; - } ---- request - GET /index.html ---- more_headers -Range: bytes=1-3 ---- raw_response_headers_like: Content-Range: bytes 1-5/1000$ ---- response_body chop -html> ---- error_code: 206 ---- SKIP - - - -=== TEST 7: Allow-Ranges ---- config - location /index.html { - more_clear_headers 'Accept-Ranges'; - } ---- request - GET /index.html ---- response_headers -! Accept-Ranges ---- response_body_like: It works - - - -=== TEST 8: clear hand-written Allow-Ranges headers ---- config - location /index.html { - more_set_headers 'Accept-Ranges: bytes'; - more_clear_headers 'Accept-Ranges'; - } ---- request - GET /index.html ---- response_headers -! Accept-Ranges ---- response_body_like: It works - - - -=== TEST 9: clear first, then add ---- config - location /bug { - more_clear_headers 'Foo'; - more_set_headers 'Foo: a'; - echo hello; - } ---- request - GET /bug ---- raw_response_headers_like eval -".*Foo: a.*" ---- response_body -hello - - - -=== TEST 10: first add, then clear, then add again ---- config - location /bug { - more_set_headers 'Foo: a'; - more_clear_headers 'Foo'; - more_set_headers 'Foo: b'; - echo hello; - } ---- request - GET /bug ---- raw_response_headers_like eval -".*Foo: b.*" ---- response_body -hello - - - -=== TEST 11: override charset ---- config - location /foo { - charset iso-8859-1; - default_type "text/html"; - echo hiya; - } - - location /bug { - more_set_headers "Content-Type: text/html; charset=UTF-8"; - proxy_pass http://127.0.0.1:$server_port/foo; - } ---- request - GET /bug ---- response_body -hiya ---- response_headers -Content-Type: text/html; charset=UTF-8 - - - -=== TEST 12: set multi-value header to a single value ---- config - location /main { - set $footer ''; - proxy_pass http://127.0.0.1:$server_port/foo; - more_set_headers 'Foo: b'; - header_filter_by_lua ' - ngx.var.footer = ngx.header.Foo - '; - echo_after_body $footer; - } - location /foo { - echo foo; - add_header Foo a; - add_header Foo c; - } ---- request - GET /main ---- response_headers -Foo: b ---- response_body -foo -b - - - -=== TEST 13: set multi values to cache-control and override it with multiple values (to reproduce a bug) ---- config - location /lua { - content_by_lua ' - ngx.header.cache_control = { "private", "no-store", "foo", "bar", "baz" } - ngx.send_headers() - ngx.say("Cache-Control: ", ngx.var.sent_http_cache_control) - '; - more_clear_headers Cache-Control; - add_header Cache-Control "blah"; - } ---- request - GET /lua ---- response_headers -Cache-Control: blah ---- response_body -Cache-Control: blah - - - -=== TEST 14: set 20+ headers ---- config - location /test { - more_clear_input_headers "Authorization"; - echo $http_a1; - echo $http_authorization; - echo $http_a2; - echo $http_a3; - echo $http_a23; - echo $http_a24; - echo $http_a25; - } ---- request - GET /test ---- more_headers eval -my $i = 1; -my $s; -while ($i <= 25) { - $s .= "A$i: $i\n"; - if ($i == 22) { - $s .= "Authorization: blah\n"; - } - $i++; -} -#warn $s; -$s ---- response_body -1 - -2 -3 -23 -24 -25 - - - -=== TEST 15: github #20: segfault caused by the nasty optimization in the nginx core (set) ---- config - location = /t/ { - more_set_headers "Foo: 1"; - proxy_pass http://127.0.0.1:$server_port; - } ---- request -GET /t ---- more_headers -Foo: bar -Bah: baz ---- response_body_like: 301 Moved Permanently ---- error_code: 301 ---- no_error_log -[error] - - - -=== TEST 16: github #20: segfault caused by the nasty optimization in the nginx core (clear) ---- config - location = /t/ { - more_clear_headers Foo; - proxy_pass http://127.0.0.1:$server_port; - } ---- request -GET /t ---- more_headers -Foo: bar -Bah: baz ---- response_body_like: 301 Moved Permanently ---- error_code: 301 ---- no_error_log -[error] - - - -=== TEST 17: Content-Type response headers with a charset param (correct -t values) ---- config - location = /t { - more_set_headers -t 'text/html' 'X-Foo: Bar'; - proxy_pass http://127.0.0.1:$server_port/fake; - } - - location = /fake { - default_type text/html; - charset utf-8; - echo ok; - } ---- request -GET /t ---- response_headers -X-Foo: Bar ---- response_body -ok - - - -=== TEST 18: Content-Type response headers with a charset param (WRONG -t values) ---- config - location = /t { - more_set_headers -t 'text/html; charset=utf-8' 'X-Foo: Bar'; - proxy_pass http://127.0.0.1:$server_port/fake; - } - - location = /fake { - default_type text/html; - charset utf-8; - echo ok; - } ---- request -GET /t ---- response_headers -X-Foo: Bar ---- response_body -ok - - - -=== TEST 19: for bad requests (bad request method letter case) ---- config - error_page 400 = /err; - - location = /err { - more_set_input_headers "Foo: bar"; - echo ok; - } ---- raw_request -GeT / HTTP/1.1 ---- response_body -ok ---- no_check_leak - - - -=== TEST 20: for bad requests (bad request method names) ---- config - error_page 400 = /err; - - location = /err { - more_set_input_headers "Foo: bar"; - echo ok; - } ---- raw_request -GET x HTTP/1.1 ---- response_body -ok ---- no_check_leak - - - -=== TEST 21: override Cache-Control header sent by proxy module ---- config - location = /back { - content_by_lua_block { - ngx.header['Cache-Control'] = 'max-age=0, no-cache' - ngx.send_headers() - ngx.say("Cache-Control: ", ngx.var.sent_http_cache_control) - } - } - - location = /t { - more_set_headers "Cache-Control: max-age=1800"; - proxy_pass http://127.0.0.1:$server_port/back; - } ---- request - GET /t ---- response_headers -Cache-Control: max-age=1800 ---- response_body -Cache-Control: max-age=0, no-cache diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/builtin.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/builtin.t deleted file mode 100644 index 27b20af..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/builtin.t +++ /dev/null @@ -1,338 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -plan tests => 60; - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set Server ---- config - location /foo { - echo hi; - more_set_headers 'Server: Foo'; - } ---- request - GET /foo ---- response_headers -Server: Foo ---- response_body -hi - - - -=== TEST 2: clear Server ---- config - location /foo { - echo hi; - more_clear_headers 'Server: '; - } ---- request - GET /foo ---- response_headers -! Server ---- response_body -hi - - - -=== TEST 3: set Content-Type ---- config - location /foo { - default_type 'text/plan'; - more_set_headers 'Content-Type: text/css'; - echo hi; - } ---- request - GET /foo ---- response_headers -Content-Type: text/css ---- response_body -hi - - - -=== TEST 4: set Content-Type ---- config - location /foo { - default_type 'text/plan'; - more_set_headers 'Content-Type: text/css'; - return 404; - } ---- request - GET /foo ---- response_headers -Content-Type: text/css ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 5: clear Content-Type ---- config - location /foo { - default_type 'text/plain'; - more_clear_headers 'Content-Type: '; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 6: clear Content-Type (colon not required) ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_clear_headers 'Content-Type'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 7: clear Content-Type (value ignored) ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_clear_headers 'Content-Type: blah'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 8: clear Content-Type (case insensitive) ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_clear_headers 'content-type: blah'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 9: clear Content-Type using set empty ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_set_headers 'content-type:'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 10: clear Content-Type using setting key only ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_set_headers 'content-type'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 11: set content-length ---- config - location /len { - more_set_headers 'Content-Length: 2'; - echo hello; - } ---- request - GET /len ---- response_headers -Content-Length: 2 ---- response_body chop -he - - - -=== TEST 12: set content-length multiple times ---- config - location /len { - more_set_headers 'Content-Length: 2'; - more_set_headers 'Content-Length: 4'; - echo hello; - } ---- request - GET /len ---- response_headers -Content-Length: 4 ---- response_body chop -hell - - - -=== TEST 13: clear content-length ---- config - location /len { - more_set_headers 'Content-Length: 4'; - more_set_headers 'Content-Length:'; - echo hello; - } ---- request - GET /len ---- response_headers -! Content-Length ---- response_body -hello - - - -=== TEST 14: clear content-length (another way) ---- config - location /len { - more_set_headers 'Content-Length: 4'; - more_clear_headers 'Content-Length'; - echo hello; - } ---- request - GET /len ---- response_headers -! Content-Length ---- response_body -hello - - - -=== TEST 15: clear content-type ---- config - location /len { - default_type 'text/plain'; - more_set_headers 'Content-Type:'; - echo hello; - } ---- request - GET /len ---- response_headers -! Content-Type ---- response_body -hello - - - -=== TEST 16: clear content-type (the other way) ---- config - location /len { - default_type 'text/plain'; - more_clear_headers 'Content-Type:'; - echo hello; - } ---- request - GET /len ---- response_headers -! Content-Type ---- response_body -hello - - - -=== TEST 17: set Charset ---- config - location /len { - default_type 'text/plain'; - more_set_headers 'Charset: gbk'; - echo hello; - } ---- request - GET /len ---- response_headers -Charset: gbk ---- response_body -hello - - - -=== TEST 18: clear Charset ---- config - location /len { - default_type 'text/plain'; - more_set_headers 'Charset: gbk'; - more_clear_headers 'Charset'; - echo hello; - } ---- request - GET /len ---- response_headers -! Charset ---- response_body -hello - - - -=== TEST 19: clear Charset (the other way: using set) ---- config - location /len { - default_type 'text/plain'; - more_set_headers 'Charset: gbk'; - more_set_headers 'Charset: '; - echo hello; - } ---- request - GET /len ---- response_headers -! Charset ---- response_body -hello - - - -=== TEST 20: set Vary ---- config - location /foo { - more_set_headers 'Vary: gbk'; - echo hello; - } - location /len { - default_type 'text/plain'; - more_set_headers 'Vary: hello'; - proxy_pass http://127.0.0.1:$server_port/foo; - } ---- request - GET /len ---- response_headers -Vary: hello ---- response_body -hello diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/eval.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/eval.t deleted file mode 100644 index febd306..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/eval.t +++ /dev/null @@ -1,36 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -#no_long_string(); -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set request header at client side ---- config - location /foo { - eval_subrequest_in_memory off; - eval_override_content_type text/plain; - eval $res { - echo -n 1; - } - #echo "[$res]"; - if ($res = '1') { - more_set_input_headers 'Foo: Bar'; - echo "OK"; - break; - } - echo "NOT OK"; - } ---- request - GET /foo ---- response_body -OK diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-conn.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-conn.t deleted file mode 100644 index f53e80f..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-conn.t +++ /dev/null @@ -1,137 +0,0 @@ -# vim:set ft= ts=4 sw=4 et fdm=marker: - -use lib 'lib'; -use Test::Nginx::Socket; - -#worker_connections(1014); -#master_process_enabled(1); -#log_level('warn'); - -repeat_each(2); - -plan tests => repeat_each() * (4 * blocks()); - -#no_diff(); -no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: clear the Connection req header ---- config - location /req-header { - more_clear_input_headers Connection; - echo "connection: $http_connection"; - } ---- request -GET /req-header - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: conn type: %d\n", $r->headers_in->connection_type) -} - - -F(ngx_http_core_content_phase) { - printf("content: conn type: %d\n", $r->headers_in->connection_type) -} - ---- stap_out -rewrite: conn type: 1 -content: conn type: 0 - ---- response_body -connection: ---- no_error_log -[error] - - - -=== TEST 2: set custom Connection req header (close) ---- config - location /req-header { - more_set_input_headers "Connection: CLOSE"; - echo "connection: $http_connection"; - } ---- request -GET /req-header - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: conn type: %d\n", $r->headers_in->connection_type) -} - - -F(ngx_http_core_content_phase) { - printf("content: conn type: %d\n", $r->headers_in->connection_type) -} - ---- stap_out -rewrite: conn type: 1 -content: conn type: 1 - ---- response_body -connection: CLOSE ---- no_error_log -[error] - - - -=== TEST 3: set custom Connection req header (keep-alive) ---- config - location /req-header { - more_set_input_headers "Connection: keep-alive"; - echo "connection: $http_connection"; - } ---- request -GET /req-header - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: conn type: %d\n", $r->headers_in->connection_type) -} - - -F(ngx_http_core_content_phase) { - printf("content: conn type: %d\n", $r->headers_in->connection_type) -} - ---- stap_out -rewrite: conn type: 1 -content: conn type: 2 - ---- response_body -connection: keep-alive ---- no_error_log -[error] - - - -=== TEST 4: set custom Connection req header (bad) ---- config - location /req-header { - more_set_input_headers "Connection: bad"; - echo "connection: $http_connection"; - } ---- request -GET /req-header - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: conn type: %d\n", $r->headers_in->connection_type) -} - - -F(ngx_http_core_content_phase) { - printf("content: conn type: %d\n", $r->headers_in->connection_type) -} - ---- stap_out -rewrite: conn type: 1 -content: conn type: 0 - ---- response_body -connection: bad ---- no_error_log -[error] diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-cookie.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-cookie.t deleted file mode 100644 index 3e5257b..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-cookie.t +++ /dev/null @@ -1,183 +0,0 @@ -# vim:set ft= ts=4 sw=4 et fdm=marker: - -use lib 'lib'; -use Test::Nginx::Socket; - -#worker_connections(1014); -#master_process_enabled(1); -#log_level('warn'); - -repeat_each(2); - -plan tests => repeat_each() * (4 * blocks()); - -#no_diff(); -no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: clear cookie (with existing cookies) ---- config - location /t { - more_clear_input_headers Cookie; - echo "Cookie foo: $cookie_foo"; - echo "Cookie baz: $cookie_baz"; - echo "Cookie: $http_cookie"; - } ---- request -GET /t ---- more_headers -Cookie: foo=bar -Cookie: baz=blah - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: cookies: %d\n", $r->headers_in->cookies->nelts) -} - -F(ngx_http_core_content_phase) { - printf("content: cookies: %d\n", $r->headers_in->cookies->nelts) -} - ---- stap_out -rewrite: cookies: 2 -content: cookies: 0 - ---- response_body -Cookie foo: -Cookie baz: -Cookie: - ---- no_error_log -[error] - - - -=== TEST 2: clear cookie (without existing cookies) ---- config - location /t { - more_clear_input_headers Cookie; - echo "Cookie foo: $cookie_foo"; - echo "Cookie baz: $cookie_baz"; - echo "Cookie: $http_cookie"; - } ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: cookies: %d\n", $r->headers_in->cookies->nelts) -} - -F(ngx_http_core_content_phase) { - printf("content: cookies: %d\n", $r->headers_in->cookies->nelts) -} - ---- stap_out -rewrite: cookies: 0 -content: cookies: 0 - ---- response_body -Cookie foo: -Cookie baz: -Cookie: - ---- no_error_log -[error] - - - -=== TEST 3: set one custom cookie (with existing cookies) ---- config - location /t { - more_set_input_headers "Cookie: boo=123"; - echo "Cookie foo: $cookie_foo"; - echo "Cookie baz: $cookie_baz"; - echo "Cookie boo: $cookie_boo"; - echo "Cookie: $http_cookie"; - } ---- request -GET /t ---- more_headers -Cookie: foo=bar -Cookie: baz=blah - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: cookies: %d\n", $r->headers_in->cookies->nelts) -} - -F(ngx_http_core_content_phase) { - printf("content: cookies: %d\n", $r->headers_in->cookies->nelts) -} - ---- stap_out -rewrite: cookies: 2 -content: cookies: 1 - ---- response_body -Cookie foo: -Cookie baz: -Cookie boo: 123 -Cookie: boo=123 - ---- no_error_log -[error] - - - -=== TEST 4: set one custom cookie (without existing cookies) ---- config - location /t { - more_set_input_headers "Cookie: boo=123"; - echo "Cookie foo: $cookie_foo"; - echo "Cookie baz: $cookie_baz"; - echo "Cookie boo: $cookie_boo"; - echo "Cookie: $http_cookie"; - } ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: cookies: %d\n", $r->headers_in->cookies->nelts) -} - -F(ngx_http_core_content_phase) { - printf("content: cookies: %d\n", $r->headers_in->cookies->nelts) -} - ---- stap_out -rewrite: cookies: 0 -content: cookies: 1 - ---- response_body -Cookie foo: -Cookie baz: -Cookie boo: 123 -Cookie: boo=123 - ---- no_error_log -[error] - - - -=== TEST 5: for bad requests causing segfaults when setting & getting multi-value headers ---- config - error_page 400 = /err; - - location = /err { - more_set_input_headers "Cookie: foo=bar"; - echo -n $cookie_foo; - echo ok; - } ---- raw_request -GeT / HTTP/1.1 ---- response_body -ok ---- no_error_log -[warn] -[error] ---- no_check_leak diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-ua.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-ua.t deleted file mode 100644 index da9a60d..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-ua.t +++ /dev/null @@ -1,628 +0,0 @@ -# vim:set ft= ts=4 sw=4 et fdm=marker: - -use lib 'lib'; -use Test::Nginx::Socket; - -#worker_connections(1014); -#master_process_enabled(1); -#log_level('warn'); - -repeat_each(2); - -plan tests => repeat_each() * (4 * blocks()); - -#no_diff(); -no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: clear Opera user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.4; U; en) Presto/2.10.229 Version/11.62 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: opera: %d\n", $r->headers_in->opera) -} - -F(ngx_http_core_content_phase) { - printf("content: opera: %d\n", $r->headers_in->opera) -} - ---- stap_out -rewrite: opera: 1 -content: opera: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 2: clear MSIE 4 user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=1 msie6=1 -content: msie=0 msie6=0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 3: set custom MSIE 4 user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=1 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0) ---- no_error_log -[error] - - - -=== TEST 4: clear MSIE 5 user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=1 msie6=1 -content: msie=0 msie6=0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 5: set custom MSIE 5 user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=1 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler) ---- no_error_log -[error] - - - -=== TEST 6: clear MSIE 6 (without SV1) user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=1 msie6=1 -content: msie=0 msie6=0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 7: set custom MSIE 6 (without SV1) user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=1 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;) ---- no_error_log -[error] - - - -=== TEST 8: clear MSIE 6 (with SV1) user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=1 msie6=0 -content: msie=0 msie6=0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 9: set custom MSIE 6 (with SV1) user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=0 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1) ---- no_error_log -[error] - - - -=== TEST 10: set custom MSIE 7 user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; winfx; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Zune 2.0)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=0 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; winfx; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Zune 2.0) ---- no_error_log -[error] - - - -=== TEST 11: clear Gecko user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: gecko: %d\n", $r->headers_in->gecko) -} - - -F(ngx_http_core_content_phase) { - printf("content: gecko: %d\n", $r->headers_in->gecko) -} - ---- stap_out -rewrite: gecko: 1 -content: gecko: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 12: set custom Gecko user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: gecko: %d\n", $r->headers_in->gecko) -} - - -F(ngx_http_core_content_phase) { - printf("content: gecko: %d\n", $r->headers_in->gecko) -} - ---- stap_out -rewrite: gecko: 0 -content: gecko: 1 - ---- response_body -User-Agent: Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0 ---- no_error_log -[error] - - - -=== TEST 13: clear Chrome user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: chrome: %d\n", $r->headers_in->chrome) -} - - -F(ngx_http_core_content_phase) { - printf("content: chrome: %d\n", $r->headers_in->chrome) -} - ---- stap_out -rewrite: chrome: 1 -content: chrome: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 14: set custom Chrome user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: chrome: %d\n", $r->headers_in->chrome) -} - - -F(ngx_http_core_content_phase) { - printf("content: chrome: %d\n", $r->headers_in->chrome) -} - ---- stap_out -rewrite: chrome: 0 -content: chrome: 1 - ---- response_body -User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19 ---- no_error_log -[error] - - - -=== TEST 15: clear Safari (Mac OS X) user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: safari: %d\n", $r->headers_in->safari) -} - - -F(ngx_http_core_content_phase) { - printf("content: safari: %d\n", $r->headers_in->safari) -} - ---- stap_out -rewrite: safari: 1 -content: safari: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 16: set custom Safari user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: safari: %d\n", $r->headers_in->safari) -} - - -F(ngx_http_core_content_phase) { - printf("content: safari: %d\n", $r->headers_in->safari) -} - ---- stap_out -rewrite: safari: 0 -content: safari: 1 - ---- response_body -User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8 ---- no_error_log -[error] - - - -=== TEST 17: clear Konqueror user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) (Kubuntu) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: konqueror: %d\n", $r->headers_in->konqueror) -} - - -F(ngx_http_core_content_phase) { - printf("content: konqueror: %d\n", $r->headers_in->konqueror) -} - ---- stap_out -rewrite: konqueror: 1 -content: konqueror: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 18: set custom Konqueror user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) (Kubuntu)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: konqueror: %d\n", $r->headers_in->konqueror) -} - - -F(ngx_http_core_content_phase) { - printf("content: konqueror: %d\n", $r->headers_in->konqueror) -} - ---- stap_out -rewrite: konqueror: 0 -content: konqueror: 1 - ---- response_body -User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) (Kubuntu) ---- no_error_log -[error] diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input.t deleted file mode 100644 index 01ae73f..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input.t +++ /dev/null @@ -1,1331 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -repeat_each(2); - -plan tests => repeat_each() * 128; - -no_long_string(); -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set request header at client side ---- config - location /foo { - #more_set_input_headers 'X-Foo: howdy'; - echo $http_x_foo; - } ---- request - GET /foo ---- more_headers -X-Foo: blah ---- response_headers -! X-Foo ---- response_body -blah - - - -=== TEST 2: set request header at client side and rewrite it ---- config - location /foo { - more_set_input_headers 'X-Foo: howdy'; - echo $http_x_foo; - } ---- request - GET /foo ---- more_headers -X-Foo: blah ---- response_headers -! X-Foo ---- response_body -howdy - - - -=== TEST 3: rewrite content length ---- config - location /bar { - more_set_input_headers 'Content-Length: 2048'; - echo_read_request_body; - echo_request_body; - } ---- request eval -"POST /bar\n" . -"a" x 4096 ---- response_body eval -"a" x 2048 ---- timeout: 15 - - - -=== TEST 4: try to rewrite content length using the rewrite module -Thisshould not take effect ;) ---- config - location /bar { - set $http_content_length 2048; - echo_read_request_body; - echo_request_body; - } ---- request eval -"POST /bar\n" . -"a" x 4096 ---- response_body eval -"a" x 4096 - - - -=== TEST 5: rewrite host and user-agent ---- config - location /bar { - more_set_input_headers 'Host: foo' 'User-Agent: blah'; - echo "Host: $host"; - echo "User-Agent: $http_user_agent"; - } ---- request -GET /bar ---- response_body -Host: foo -User-Agent: blah - - - -=== TEST 6: clear host and user-agent -$host always has a default value and cannot be really cleared. ---- config - location /bar { - more_clear_input_headers 'Host: foo' 'User-Agent: blah'; - echo "Host: $host"; - echo "Host (2): $http_host"; - echo "User-Agent: $http_user_agent"; - } ---- request -GET /bar ---- response_body -Host: localhost -Host (2): -User-Agent: - - - -=== TEST 7: clear host and user-agent (the other way) ---- config - location /bar { - more_set_input_headers 'Host:' 'User-Agent:' 'X-Foo:'; - echo "Host: $host"; - echo "User-Agent: $http_user_agent"; - echo "X-Foo: $http_x_foo"; - } ---- request -GET /bar ---- more_headers -X-Foo: bar ---- response_body -Host: localhost -User-Agent: -X-Foo: - - - -=== TEST 8: clear content-length ---- config - location /bar { - more_set_input_headers 'Content-Length: '; - echo "Content-Length: $http_content_length"; - } ---- request -POST /bar -hello ---- more_headers ---- response_body -Content-Length: - - - -=== TEST 9: clear content-length (the other way) ---- config - location /bar { - more_clear_input_headers 'Content-Length: '; - echo "Content-Length: $http_content_length"; - } ---- request -POST /bar -hello ---- more_headers ---- response_body -Content-Length: - - - -=== TEST 10: rewrite type ---- config - location /bar { - more_set_input_headers 'Content-Type: text/css'; - echo "Content-Type: $content_type"; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -Content-Type: text/css - - - -=== TEST 11: clear type ---- config - location /bar { - more_set_input_headers 'Content-Type:'; - echo "Content-Type: $content_type"; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -Content-Type: - - - -=== TEST 12: clear type (the other way) ---- config - location /bar { - more_clear_input_headers 'Content-Type:foo'; - echo "Content-Type: $content_type"; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -Content-Type: - - - -=== TEST 13: add type constraints ---- config - location /bar { - more_set_input_headers -t 'text/plain' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -yay - - - -=== TEST 14: add type constraints (not matched) ---- config - location /bar { - more_set_input_headers -t 'text/plain' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/css ---- response_body eval: "\n" - - - -=== TEST 15: add type constraints (OR'd) ---- config - location /bar { - more_set_input_headers -t 'text/plain text/css' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/css ---- response_body -yay - - - -=== TEST 16: add type constraints (OR'd) ---- config - location /bar { - more_set_input_headers -t 'text/plain text/css' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -yay - - - -=== TEST 17: add type constraints (OR'd) (not matched) ---- config - location /bar { - more_set_input_headers -t 'text/plain text/css' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/html ---- response_body eval: "\n" - - - -=== TEST 18: mix input and output cmds ---- config - location /bar { - more_set_input_headers 'X-Blah:yay'; - more_set_headers 'X-Blah:hiya'; - echo $http_x_blah; - } ---- request -GET /bar ---- response_headers -X-Blah: hiya ---- response -yay - - - -=== TEST 19: set request header at client side and replace ---- config - location /foo { - more_set_input_headers -r 'X-Foo: howdy'; - echo $http_x_foo; - } ---- request - GET /foo ---- more_headers -X-Foo: blah ---- response_headers -! X-Foo ---- response_body -howdy - - - -=== TEST 20: do no set request header at client, so no replace with -r option ---- config - location /foo { - more_set_input_headers -r 'X-Foo: howdy'; - echo "empty_header:" $http_x_foo; - } ---- request - GET /foo ---- response_headers -! X-Foo ---- response_body -empty_header: - - - -=== TEST 21: clear input headers ---- config - location /foo { - set $val 'dog'; - - more_clear_input_headers 'User-Agent'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - } - location /proxy { - echo -n $echo_client_request_headers; - } ---- request - GET /foo ---- more_headers -User-Agent: my-sock ---- response_body eval -"GET /proxy HTTP/1.0\r -Host: 127.0.0.1:\$ServerPort\r -Connection: close\r -\r -" ---- skip_nginx: 3: < 0.7.46 - - - -=== TEST 22: clear input headers ---- config - location /foo { - more_clear_input_headers 'User-Agent'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - } - location /proxy { - echo -n $echo_client_request_headers; - } ---- request - GET /foo ---- response_body eval -"GET /proxy HTTP/1.0\r -Host: 127.0.0.1:\$ServerPort\r -Connection: close\r -\r -" ---- skip_nginx: 3: < 0.7.46 - - - -=== TEST 23: clear input headers ---- config - location /foo { - more_clear_input_headers 'X-Foo19'; - more_clear_input_headers 'X-Foo20'; - more_clear_input_headers 'X-Foo21'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - } - location /proxy { - echo -n $echo_client_request_headers; - } ---- request - GET /foo ---- more_headers eval -my $s; -for my $i (3..21) { - $s .= "X-Foo$i: $i\n"; -} -$s; ---- response_body eval -"GET /proxy HTTP/1.0\r -Host: 127.0.0.1:\$ServerPort\r -Connection: close\r -X-Foo3: 3\r -X-Foo4: 4\r -X-Foo5: 5\r -X-Foo6: 6\r -X-Foo7: 7\r -X-Foo8: 8\r -X-Foo9: 9\r -X-Foo10: 10\r -X-Foo11: 11\r -X-Foo12: 12\r -X-Foo13: 13\r -X-Foo14: 14\r -X-Foo15: 15\r -X-Foo16: 16\r -X-Foo17: 17\r -X-Foo18: 18\r -\r -" ---- skip_nginx: 3: < 0.7.46 - - - -=== TEST 24: Accept-Encoding ---- config - location /bar { - default_type 'text/plain'; - more_set_input_headers 'Accept-Encoding: gzip'; - gzip on; - gzip_min_length 1; - gzip_buffers 4 8k; - gzip_types text/plain; - } ---- user_files -">>> bar -" . ("hello" x 512) ---- request -GET /bar ---- response_headers -Content-Encoding: gzip ---- response_body_like: . - - - -=== TEST 25: rewrite + set request header ---- config - location /t { - rewrite ^ /foo last; - } - - location /foo { - more_set_input_headers 'X-Foo: howdy'; - proxy_pass http://127.0.0.1:$server_port/echo; - } - - location /echo { - echo "X-Foo: $http_x_foo"; - } ---- request - GET /foo ---- response_headers -! X-Foo ---- response_body -X-Foo: howdy - - - -=== TEST 26: clear_header should clear all the instances of the user custom header ---- config - location = /t { - more_clear_input_headers Foo; - - proxy_pass http://127.0.0.1:$server_port/echo; - } - - location = /echo { - echo "Foo: [$http_foo]"; - echo "Test-Header: [$http_test_header]"; - } ---- request -GET /t ---- more_headers -Foo: foo -Foo: bah -Test-Header: 1 ---- response_body -Foo: [] -Test-Header: [1] - - - -=== TEST 27: clear_header should clear all the instances of the builtin header ---- config - location = /t { - more_clear_input_headers Content-Type; - - proxy_pass http://127.0.0.1:$server_port/echo; - } - - location = /echo { - echo "Content-Type: [$http_content_type]"; - echo "Test-Header: [$http_test_header]"; - #echo $echo_client_request_headers; - } ---- request -GET /t ---- more_headers -Content-Type: foo -Content-Type: bah -Test-Header: 1 ---- response_body -Content-Type: [] -Test-Header: [1] - - - -=== TEST 28: Converting POST to GET - clearing headers (bug found by Matthieu Tourne, 411 error page) ---- config - location /t { - more_clear_input_headers Content-Type; - more_clear_input_headers Content-Length; - - #proxy_pass http://127.0.0.1:8888; - proxy_pass http://127.0.0.1:$server_port/back; - } - - location /back { - echo $echo_client_request_headers; - } ---- request -POST /t -hello world ---- more_headers -Content-Type: application/ocsp-request -Test-Header: 1 ---- response_body_like eval -qr/Connection: close\r -Test-Header: 1\r -\r -$/ ---- no_error_log -[error] - - - -=== TEST 29: clear_header() does not duplicate subsequent headers (old bug) ---- config - location = /t { - more_clear_input_headers Foo; - - proxy_pass http://127.0.0.1:$server_port/echo; - } - - location = /echo { - echo $echo_client_request_headers; - } ---- request -GET /t ---- more_headers -Bah: bah -Foo: foo -Test-Header: 1 -Foo1: foo1 -Foo2: foo2 -Foo3: foo3 -Foo4: foo4 -Foo5: foo5 -Foo6: foo6 -Foo7: foo7 -Foo8: foo8 -Foo9: foo9 -Foo10: foo10 -Foo11: foo11 -Foo12: foo12 -Foo13: foo13 -Foo14: foo14 -Foo15: foo15 -Foo16: foo16 -Foo17: foo17 -Foo18: foo18 -Foo19: foo19 -Foo20: foo20 -Foo21: foo21 -Foo22: foo22 ---- response_body_like eval -qr/Bah: bah\r -Test-Header: 1\r -Foo1: foo1\r -Foo2: foo2\r -Foo3: foo3\r -Foo4: foo4\r -Foo5: foo5\r -Foo6: foo6\r -Foo7: foo7\r -Foo8: foo8\r -Foo9: foo9\r -Foo10: foo10\r -Foo11: foo11\r -Foo12: foo12\r -Foo13: foo13\r -Foo14: foo14\r -Foo15: foo15\r -Foo16: foo16\r -Foo17: foo17\r -Foo18: foo18\r -Foo19: foo19\r -Foo20: foo20\r -Foo21: foo21\r -Foo22: foo22\r -/ - - - -=== TEST 30: clear input header (just more than 20 headers) ---- config - location = /t { - more_clear_input_headers "R"; - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Host foo; - #proxy_pass http://127.0.0.1:1234/back; - } - - location = /back { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\n"; - -for my $i ('a' .. 'r') { - $s .= uc($i) . ": " . "$i\n" -} -$s ---- response_body eval -"GET /back HTTP/1.0\r -Host: foo\r -Connection: close\r -User-Agent: curl\r -A: a\r -B: b\r -C: c\r -D: d\r -E: e\r -F: f\r -G: g\r -H: h\r -I: i\r -J: j\r -K: k\r -L: l\r -M: m\r -N: n\r -O: o\r -P: p\r -Q: q\r -\r -" - - - -=== TEST 31: clear input header (just more than 20 headers, and add more) ---- config - location = /t { - more_clear_input_headers R; - more_set_input_headers "foo-1: 1" "foo-2: 2" "foo-3: 3" "foo-4: 4" - "foo-5: 5" "foo-6: 6" "foo-7: 7" "foo-8: 8" "foo-9: 9" - "foo-10: 10" "foo-11: 11" "foo-12: 12" "foo-13: 13" - "foo-14: 14" "foo-15: 15" "foo-16: 16" "foo-17: 17" "foo-18: 18" - "foo-19: 19" "foo-20: 20" "foo-21: 21"; - - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Host foo; - #proxy_pass http://127.0.0.1:1234/back; - } - - location = /back { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\n"; - -for my $i ('a' .. 'r') { - $s .= uc($i) . ": " . "$i\n" -} -$s ---- response_body eval -"GET /back HTTP/1.0\r -Host: foo\r -Connection: close\r -User-Agent: curl\r -A: a\r -B: b\r -C: c\r -D: d\r -E: e\r -F: f\r -G: g\r -H: h\r -I: i\r -J: j\r -K: k\r -L: l\r -M: m\r -N: n\r -O: o\r -P: p\r -Q: q\r -foo-1: 1\r -foo-2: 2\r -foo-3: 3\r -foo-4: 4\r -foo-5: 5\r -foo-6: 6\r -foo-7: 7\r -foo-8: 8\r -foo-9: 9\r -foo-10: 10\r -foo-11: 11\r -foo-12: 12\r -foo-13: 13\r -foo-14: 14\r -foo-15: 15\r -foo-16: 16\r -foo-17: 17\r -foo-18: 18\r -foo-19: 19\r -foo-20: 20\r -foo-21: 21\r -\r -" - - - -=== TEST 32: clear input header (just more than 21 headers) ---- config - location = /t { - more_clear_input_headers R Q; - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Host foo; - #proxy_pass http://127.0.0.1:1234/back; - } - - location = /back { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\nBah: bah\n"; - -for my $i ('a' .. 'r') { - $s .= uc($i) . ": " . "$i\n" -} -$s ---- response_body eval -"GET /back HTTP/1.0\r -Host: foo\r -Connection: close\r -User-Agent: curl\r -Bah: bah\r -A: a\r -B: b\r -C: c\r -D: d\r -E: e\r -F: f\r -G: g\r -H: h\r -I: i\r -J: j\r -K: k\r -L: l\r -M: m\r -N: n\r -O: o\r -P: p\r -\r -" - - - -=== TEST 33: clear input header (just more than 21 headers) ---- config - location = /t { - more_clear_input_headers R Q; - more_set_input_headers "foo-1: 1" "foo-2: 2" "foo-3: 3" "foo-4: 4" - "foo-5: 5" "foo-6: 6" "foo-7: 7" "foo-8: 8" "foo-9: 9" - "foo-10: 10" "foo-11: 11" "foo-12: 12" "foo-13: 13" - "foo-14: 14" "foo-15: 15" "foo-16: 16" "foo-17: 17" "foo-18: 18" - "foo-19: 19" "foo-20: 20" "foo-21: 21"; - - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Host foo; - #proxy_pass http://127.0.0.1:1234/back; - } - - location = /back { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\nBah: bah\n"; - -for my $i ('a' .. 'r') { - $s .= uc($i) . ": " . "$i\n" -} -$s ---- response_body eval -"GET /back HTTP/1.0\r -Host: foo\r -Connection: close\r -User-Agent: curl\r -Bah: bah\r -A: a\r -B: b\r -C: c\r -D: d\r -E: e\r -F: f\r -G: g\r -H: h\r -I: i\r -J: j\r -K: k\r -L: l\r -M: m\r -N: n\r -O: o\r -P: p\r -foo-1: 1\r -foo-2: 2\r -foo-3: 3\r -foo-4: 4\r -foo-5: 5\r -foo-6: 6\r -foo-7: 7\r -foo-8: 8\r -foo-9: 9\r -foo-10: 10\r -foo-11: 11\r -foo-12: 12\r -foo-13: 13\r -foo-14: 14\r -foo-15: 15\r -foo-16: 16\r -foo-17: 17\r -foo-18: 18\r -foo-19: 19\r -foo-20: 20\r -foo-21: 21\r -\r -" - - - -=== TEST 34: clear X-Real-IP ---- config - location /t { - more_clear_input_headers X-Real-IP; - echo "X-Real-IP: $http_x_real_ip"; - } ---- request -GET /t ---- more_headers -X-Real-IP: 8.8.8.8 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - if (@defined($r->headers_in->x_real_ip) && $r->headers_in->x_real_ip) { - printf("rewrite: x-real-ip: %s\n", - user_string_n($r->headers_in->x_real_ip->value->data, - $r->headers_in->x_real_ip->value->len)) - } else { - println("rewrite: no x-real-ip") - } -} - -F(ngx_http_core_content_phase) { - if (@defined($r->headers_in->x_real_ip) && $r->headers_in->x_real_ip) { - printf("content: x-real-ip: %s\n", - user_string_n($r->headers_in->x_real_ip->value->data, - $r->headers_in->x_real_ip->value->len)) - } else { - println("content: no x-real-ip") - } -} - ---- stap_out -rewrite: x-real-ip: 8.8.8.8 -content: no x-real-ip - ---- response_body -X-Real-IP: - ---- no_error_log -[error] - - - -=== TEST 35: set custom X-Real-IP ---- config - location /t { - more_set_input_headers "X-Real-IP: 8.8.4.4"; - echo "X-Real-IP: $http_x_real_ip"; - } ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - if (@defined($r->headers_in->x_real_ip) && $r->headers_in->x_real_ip) { - printf("rewrite: x-real-ip: %s\n", - user_string_n($r->headers_in->x_real_ip->value->data, - $r->headers_in->x_real_ip->value->len)) - } else { - println("rewrite: no x-real-ip") - } - -} - -F(ngx_http_core_content_phase) { - if (@defined($r->headers_in->x_real_ip) && $r->headers_in->x_real_ip) { - printf("content: x-real-ip: %s\n", - user_string_n($r->headers_in->x_real_ip->value->data, - $r->headers_in->x_real_ip->value->len)) - } else { - println("content: no x-real-ip") - } -} - ---- stap_out -rewrite: no x-real-ip -content: x-real-ip: 8.8.4.4 - ---- response_body -X-Real-IP: 8.8.4.4 - ---- no_error_log -[error] - - - -=== TEST 36: clear Via ---- config - location /t { - more_clear_input_headers Via; - echo "Via: $http_via"; - } ---- request -GET /t ---- more_headers -Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - if (@defined($r->headers_in->via) && $r->headers_in->via) { - printf("rewrite: via: %s\n", - user_string_n($r->headers_in->via->value->data, - $r->headers_in->via->value->len)) - } else { - println("rewrite: no via") - } -} - -F(ngx_http_core_content_phase) { - if (@defined($r->headers_in->via) && $r->headers_in->via) { - printf("content: via: %s\n", - user_string_n($r->headers_in->via->value->data, - $r->headers_in->via->value->len)) - } else { - println("content: no via") - } -} - ---- stap_out -rewrite: via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) -content: no via - ---- response_body -Via: - ---- no_error_log -[error] - - - -=== TEST 37: set custom Via ---- config - location /t { - more_set_input_headers "Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)"; - echo "Via: $http_via"; - } ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - if (@defined($r->headers_in->via) && $r->headers_in->via) { - printf("rewrite: via: %s\n", - user_string_n($r->headers_in->via->value->data, - $r->headers_in->via->value->len)) - } else { - println("rewrite: no via") - } - -} - -F(ngx_http_core_content_phase) { - if (@defined($r->headers_in->via) && $r->headers_in->via) { - printf("content: via: %s\n", - user_string_n($r->headers_in->via->value->data, - $r->headers_in->via->value->len)) - } else { - println("content: no via") - } -} - ---- stap_out -rewrite: no via -content: via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) - ---- response_body -Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) - ---- no_error_log -[error] - - - -=== TEST 38: HTTP 0.9 (set) ---- config - location /foo { - more_set_input_headers 'X-Foo: howdy'; - echo "x-foo: $http_x_foo"; - } ---- raw_request eval -"GET /foo\r\n" ---- response_headers -! X-Foo ---- response_body -x-foo: ---- http09 - - - -=== TEST 39: HTTP 0.9 (clear) ---- config - location /foo { - more_clear_input_headers 'X-Foo'; - echo "x-foo: $http_x_foo"; - } ---- raw_request eval -"GET /foo\r\n" ---- response_headers -! X-Foo ---- response_body -x-foo: ---- http09 - - - -=== TEST 40: Host header with port and $host ---- config - location /bar { - more_set_input_headers 'Host: agentzh.org:1984'; - echo "host var: $host"; - echo "http_host var: $http_host"; - } ---- request -GET /bar ---- response_body -host var: agentzh.org -http_host var: agentzh.org:1984 - - - -=== TEST 41: Host header with upper case letters and $host ---- config - location /bar { - more_set_input_headers 'Host: agentZH.org:1984'; - echo "host var: $host"; - echo "http_host var: $http_host"; - } ---- request -GET /bar ---- response_body -host var: agentzh.org -http_host var: agentZH.org:1984 - - - -=== TEST 42: clear all and re-insert ---- config - location = /t { - more_clear_input_headers Host Connection Cache-Control Accept - User-Agent Accept-Encoding Accept-Language - Cookie; - - more_set_input_headers "Host: a" "Connection: b" "Cache-Control: c" - "Accept: d" "User-Agent: e" "Accept-Encoding: f" - "Accept-Language: g" "Cookie: h"; - - more_clear_input_headers Host Connection Cache-Control Accept - User-Agent Accept-Encoding Accept-Language - Cookie; - - more_set_input_headers "Host: a" "Connection: b" "Cache-Control: c" - "Accept: d" "User-Agent: e" "Accept-Encoding: f" - "Accept-Language: g" "Cookie: h"; - - echo ok; - } - ---- raw_request eval -"GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Cache-Control: max-age=0\r -Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r -User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36\r -Accept-Encoding: gzip,deflate,sdch\r -Accept-Language: en-US,en;q=0.8\r -Cookie: test=cookie;\r -\r -" ---- response_body -ok ---- no_error_log -[error] - - - -=== TEST 43: more_set_input_header does not override request headers with multiple values ---- config - #lua_code_cache off; - location = /t { - more_set_input_headers "AAA: 111"; - - content_by_lua ' - local headers = ngx.req.get_headers() - ngx.say(headers["AAA"]) - '; - } ---- request -GET /t ---- more_headers -AAA: 123 -AAA: 456 -AAA: 678 - ---- response_body -111 ---- no_error_log -[error] - - - -=== TEST 44: clear If-Unmodified-Since req header ---- config - location = /t { - more_clear_input_headers 'If-Unmodified-Since'; - content_by_lua ' - ngx.header["Last-Modified"] = "Tue, 30 Jun 2011 12:16:36 GMT" - ngx.say("If-Unmodified-Since: ", ngx.var.http_if_unmodified_since) - '; - } ---- request -GET /t ---- more_headers -If-Unmodified-Since: Tue, 28 Jun 2011 12:16:36 GMT ---- response_body -If-Unmodified-Since: nil ---- no_error_log -[error] - - - -=== TEST 45: clear If-Match req header ---- config - location = /t { - more_clear_input_headers 'If-Match'; - echo "If-Match: $http_if_match"; - } ---- request -GET /t ---- more_headers -If-Match: abc ---- response_body -If-Match: ---- no_error_log -[error] - - - -=== TEST 46: clear If-None-Match req header ---- config - location = /t { - more_clear_input_headers 'If-None-Match'; - echo "If-None-Match: $http_if_none_match"; - } ---- request -GET /t ---- more_headers -If-None-Match: * ---- response_body -If-None-Match: ---- no_error_log -[error] - - - -=== TEST 47: set the Destination request header for WebDav ---- config - location = /a.txt { - more_set_input_headers "Destination: /b.txt"; - dav_methods MOVE; - dav_access all:rw; - root html; - } - ---- user_files ->>> a.txt -hello, world! - ---- request -MOVE /a.txt - ---- response_body ---- no_error_log -client sent no "Destination" header -[error] ---- error_code: 204 - - - -=== TEST 48: more_set_input_headers + X-Forwarded-For ---- config - location = /t { - more_set_input_headers "X-Forwarded-For: 8.8.8.8"; - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Foo $proxy_add_x_forwarded_for; - } - - location = /back { - echo "Foo: $http_foo"; - } - ---- request -GET /t - ---- response_body -Foo: 8.8.8.8, 127.0.0.1 ---- no_error_log -[error] - - - -=== TEST 49: more_clear_input_headers + X-Forwarded-For ---- config - location = /t { - more_clear_input_headers "X-Forwarded-For"; - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Foo $proxy_add_x_forwarded_for; - } - - location = /back { - echo "Foo: $http_foo"; - } - ---- request -GET /t - ---- more_headers -X-Forwarded-For: 8.8.8.8 ---- response_body -Foo: 127.0.0.1 ---- no_error_log -[error] - - - -=== TEST 50: clear input headers with wildcard ---- config - location /hello { - more_clear_input_headers 'X-Hidden-*'; - content_by_lua ' - ngx.say("X-Hidden-One: ", ngx.var.http_x_hidden_one) - ngx.say("X-Hidden-Two: ", ngx.var.http_x_hidden_two) - '; - } ---- request - GET /hello ---- more_headers -X-Hidden-One: i am hidden -X-Hidden-Two: me 2 ---- response_body -X-Hidden-One: nil -X-Hidden-Two: nil - - - -=== TEST 51: make sure wildcard doesn't affect more_set_input_headers ---- config - location /hello { - more_set_input_headers 'X-Hidden-*: lol'; - content_by_lua ' - ngx.say("X-Hidden-One: ", ngx.var.http_x_hidden_one) - ngx.say("X-Hidden-Two: ", ngx.var.http_x_hidden_two) - '; - } ---- request - GET /hello ---- more_headers -X-Hidden-One: i am hidden -X-Hidden-Two: me 2 ---- response_body -X-Hidden-One: i am hidden -X-Hidden-Two: me 2 diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/phase.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/phase.t deleted file mode 100644 index 11183db..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/phase.t +++ /dev/null @@ -1,25 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 3; - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: simple set (1 arg) ---- config - location /foo { - deny all; - more_set_headers 'X-Foo: Blah'; - } ---- request - GET /foo ---- response_headers -X-Foo: Blah ---- response_body_like: 403 Forbidden ---- error_code: 403 diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/sanity.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/sanity.t deleted file mode 100644 index 47d65e3..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/sanity.t +++ /dev/null @@ -1,628 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 123; - -#master_on(); -#workers(2); -log_level("warn"); -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: simple set (1 arg) ---- config - location /foo { - echo hi; - more_set_headers 'X-Foo: Blah'; - } ---- request - GET /foo ---- response_headers -X-Foo: Blah ---- response_body -hi - - - -=== TEST 2: simple set (2 args) ---- config - location /foo { - echo hi; - more_set_headers 'X-Foo: Blah' 'X-Bar: hi'; - } ---- request - GET /foo ---- response_headers -X-Foo: Blah -X-Bar: hi ---- response_body -hi - - - -=== TEST 3: two sets in a single location ---- config - location /two { - echo hi; - more_set_headers 'X-Foo: Blah' - more_set_headers 'X-Bar: hi'; - } ---- request - GET /two ---- response_headers -X-Foo: Blah -X-Bar: hi ---- response_body -hi - - - -=== TEST 4: two sets in a single location (for 404 too) ---- config - location /two { - more_set_headers 'X-Foo: Blah' - more_set_headers 'X-Bar: hi'; - return 404; - } ---- request - GET /two ---- response_headers -X-Foo: Blah -X-Bar: hi ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 5: set a header then clears it (500) ---- config - location /two { - more_set_headers 'X-Foo: Blah'; - more_set_headers 'X-Foo:'; - return 500; - } ---- request - GET /two ---- response_headers -! X-Foo -! X-Bar ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 6: set a header only when 500 (matched) ---- config - location /bad { - more_set_headers -s 500 'X-Mine: Hiya'; - more_set_headers -s 404 'X-Yours: Blah'; - return 500; - } ---- request - GET /bad ---- response_headers -X-Mine: Hiya -! X-Yours ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 7: set a header only when 500 (not matched with 200) ---- config - location /bad { - more_set_headers -s 500 'X-Mine: Hiya'; - more_set_headers -s 404 'X-Yours: Blah'; - echo hello; - } ---- request - GET /bad ---- response_headers -! X-Mine -! X-Yours ---- response_body -hello ---- error_code: 200 - - - -=== TEST 8: set a header only when 500 (not matched with 404) ---- config - location /bad { - more_set_headers -s 500 'X-Mine: Hiya'; - more_set_headers -s 404 'X-Yours: Blah'; - return 404; - } ---- request - GET /bad ---- response_headers -! X-Mine -X-Yours: Blah ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 9: more conditions ---- config - location /bad { - more_set_headers -s '503 404' 'X-Mine: Hiya'; - more_set_headers -s ' 404 413 ' 'X-Yours: Blah'; - return 503; - } ---- request - GET /bad ---- response_headers -X-Mine: Hiya -! X-Yours ---- response_body_like: 503 Service ---- error_code: 503 - - - -=== TEST 10: more conditions ---- config - location /bad { - more_set_headers -s '503 404' 'X-Mine: Hiya'; - more_set_headers -s ' 404 413 ' 'X-Yours: Blah'; - return 404; - } ---- request - GET /bad ---- response_headers -X-Mine: Hiya -X-Yours: Blah ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 11: more conditions ---- config - location /bad { - more_set_headers -s '503 404' 'X-Mine: Hiya'; - more_set_headers -s ' 404 413 ' 'X-Yours: Blah'; - return 413; - } ---- request - GET /bad ---- response_headers -! X-Mine -X-Yours: Blah ---- response_body_like: 413 Request Entity Too Large ---- error_code: 413 - - - -=== TEST 12: simple -t ---- config - location /bad { - default_type 'text/css'; - more_set_headers -t 'text/css' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 13: simple -t (not matched) ---- config - location /bad { - default_type 'text/plain'; - more_set_headers -t 'text/css' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -! X-CSS ---- response_body -hi - - - -=== TEST 14: multiple -t (not matched) ---- config - location /bad { - default_type 'text/plain'; - more_set_headers -t 'text/javascript' -t 'text/css' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -! X-CSS ---- response_body -hi - - - -=== TEST 15: multiple -t (matched) ---- config - location /bad { - default_type 'text/plain'; - more_set_headers -t 'text/javascript' -t 'text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 16: multiple -t (matched) ---- config - location /bad { - default_type 'text/javascript'; - more_set_headers -t 'text/javascript' -t 'text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 17: multiple -t (matched) with extra spaces ---- config - location /bad { - default_type 'text/javascript'; - more_set_headers -t ' text/javascript ' -t 'text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 18: multiple -t merged ---- config - location /bad { - default_type 'text/javascript'; - more_set_headers -t ' text/javascript text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 19: multiple -t merged (2) ---- config - location /bad { - default_type 'text/plain'; - more_set_headers -t ' text/javascript text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 20: multiple -s option in a directive (not matched) ---- config - location /bad { - more_set_headers -s 404 -s 500 'X-status: howdy'; - echo hi; - } ---- request - GET /bad ---- response_headers -! X-status ---- response_body -hi - - - -=== TEST 21: multiple -s option in a directive (matched 404) ---- config - location /bad { - more_set_headers -s 404 -s 500 'X-status: howdy'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status: howdy ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 22: multiple -s option in a directive (matched 500) ---- config - location /bad { - more_set_headers -s 404 -s 500 'X-status: howdy'; - return 500; - } ---- request - GET /bad ---- response_headers -X-status: howdy ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 23: -s mixed with -t ---- config - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -s 200 -t 'text/html' 'X-status: howdy2'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status: howdy2 ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 24: -s mixed with -t ---- config - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -s 200 -t 'text/plain' 'X-status: howdy2'; - return 404; - } ---- request - GET /bad ---- response_headers -! X-status ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 25: -s mixed with -t ---- config - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -s 200 -t 'text/html' 'X-status: howdy2'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-status: howdy2 ---- response_body -hi ---- error_code: 200 - - - -=== TEST 26: -s mixed with -t ---- config - location /bad { - default_type 'text/html'; - more_set_headers -s 500 -s 200 -t 'text/html' 'X-status: howdy2'; - return 404; - } ---- request - GET /bad ---- response_headers -! X-status ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 27: merge from the upper level ---- config - more_set_headers -s 404 -t 'text/html' 'X-status2: howdy3'; - location /bad { - default_type 'text/html'; - more_set_headers -s 500 -s 200 -t 'text/html' 'X-status: howdy2'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status2: howdy3 -! X-status ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 28: merge from the upper level ---- config - more_set_headers -s 404 -t 'text/html' 'X-status2: howdy3'; - location /bad { - default_type 'text/html'; - more_set_headers -s 500 -s 200 -t 'text/html' 'X-status: howdy2'; - echo yeah; - } ---- request - GET /bad ---- response_headers -! X-status2 -X-status: howdy2 ---- response_body -yeah ---- error_code: 200 - - - -=== TEST 29: override settings by inheritance ---- config - more_set_headers -s 404 -t 'text/html' 'X-status: yeah'; - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -t 'text/html' 'X-status: nope'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status: nope ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 30: append settings by inheritance ---- config - more_set_headers -s 404 -t 'text/html' 'X-status: yeah'; - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -t 'text/html' 'X-status2: nope'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status: yeah -X-status2: nope ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 31: clear headers with wildcard ---- config - location = /backend { - add_header X-Hidden-One "i am hidden"; - add_header X-Hidden-Two "me 2"; - echo hi; - } - location /hello { - more_clear_headers 'X-Hidden-*'; - proxy_pass http://127.0.0.1:$server_port/backend; - } ---- request - GET /hello ---- response_headers -! X-Hidden-One -! X-Hidden-Two ---- response_body -hi - - - -=== TEST 32: clear duplicate headers ---- config - location = /backend { - add_header pragma no-cache; - add_header pragma no-cache; - echo hi; - } - location /hello { - more_clear_headers 'pragma'; - proxy_pass http://127.0.0.1:$server_port/backend; - } ---- request - GET /hello ---- response_headers -!pragma ---- response_body -hi - - - -=== TEST 33: HTTP 0.9 (set) ---- config - location /foo { - more_set_headers 'X-Foo: howdy'; - echo ok; - } ---- raw_request eval -"GET /foo\r\n" ---- response_headers -! X-Foo ---- response_body -ok ---- http09 - - - -=== TEST 34: use the -a option to append the cookie field ---- config - location /cookie { - more_set_headers -a 'Set-Cookie: name=lynch'; - echo ok; - } ---- request - GET /cookie ---- response_headers -Set-Cookie: name=lynch ---- response_body -ok - - - -=== TEST 35: the original Set-Cookie fields will not be overwritten, when using the -a option ---- config - location /cookie { - more_set_headers 'Set-Cookie: name=lynch'; - more_set_headers -a 'Set-Cookie: born=1981'; - echo ok; - } ---- request - GET /cookie ---- raw_response_headers_like eval -"Set-Cookie: name=lynch\r\nSet-Cookie: born=1981\r\n" ---- response_body -ok - - - -=== TEST 36: The behavior of builtin headers can not be changed ---- config - location /foo { - more_set_headers -a "Server: myServer"; - echo ok; - } ---- request - GET /foo ---- must_die ---- error_log chomp -can not append builtin headers ---- suppress_stderr - - - -=== TEST 37: can not use -a option with more_clear_headers ---- config - location /foo { - more_clear_headers -a 'Content-Type'; - echo ok; - } ---- request - GET /foo ---- must_die ---- error_log chomp -invalid option name: "-a" ---- suppress_stderr diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/subrequest.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/subrequest.t deleted file mode 100644 index 9443eca..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/subrequest.t +++ /dev/null @@ -1,68 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -plan tests => blocks() * 3; - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: vars in input header directives ---- config - location /main { - echo_location /foo; - echo "main: $http_user_agent"; - } - location /foo { - set $val 'dog'; - - more_set_input_headers 'User-Agent: $val'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - } - location /proxy { - echo "sub: $http_user_agent"; - } ---- request - GET /main ---- more_headers -User-Agent: my-sock ---- response_body -sub: dog -main: dog ---- response_headers -! Host ---- skip_nginx: 3: < 0.7.46 - - - -=== TEST 2: vars in input header directives ---- config - location /main { - #more_set_input_headers 'User-Agent: cat'; - echo_location /foo; - echo "main: $http_user_agent"; - } - location /foo { - set $val 'dog'; - - more_set_input_headers 'User-Agent: $val'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - #echo $http_user_agent; - } - location /proxy { - echo "sub: $http_user_agent"; - } ---- request - GET /main ---- response_body -sub: dog -main: dog ---- response_headers -! Host ---- skip_nginx: 3: < 0.7.46 diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/unused.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/unused.t deleted file mode 100644 index c51f91c..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/unused.t +++ /dev/null @@ -1,174 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (blocks() * 4 + 2); - -#master_on(); -#workers(2); -log_level("warn"); -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: used output filter ---- config - location /foo { - echo hi; - more_set_headers "Foo: bar"; - } ---- request - GET /foo ---- response_headers -Foo: bar ---- response_body -hi ---- error_log -headers more header filter ---- no_error_log -[error] ---- log_level: debug - - - -=== TEST 2: unused output filter (none) ---- config - location /foo { - echo hi; - } ---- request - GET /foo ---- response_body -hi ---- no_error_log -headers more header filter -[error] ---- log_level: debug - - - -=== TEST 3: unused output filter (with more_set_input_headers only) ---- config - location /foo { - more_set_input_headers "Foo: bar"; - echo hi; - } ---- request - GET /foo ---- response_body -hi ---- no_error_log -headers more header filter -[error] ---- log_level: debug - - - -=== TEST 4: used rewrite handler ---- config - location /foo { - more_set_input_headers "Foo: bar"; - echo hi; - } ---- request - GET /foo ---- response_body -hi ---- error_log -headers more rewrite handler ---- no_error_log -[error] ---- log_level: debug - - - -=== TEST 5: unused rewrite handler (none) ---- config - location /foo { - #more_set_input_headers "Foo: bar"; - echo hi; - } ---- request - GET /foo ---- response_body -hi ---- no_error_log -headers more rewrite handler -[error] ---- log_level: debug - - - -=== TEST 6: unused rewrite handler (with output header filters) ---- config - location /foo { - #more_set_input_headers "Foo: bar"; - echo hi; - more_set_headers "Foo: bar"; - } ---- request - GET /foo ---- response_headers -Foo: bar ---- response_body -hi ---- no_error_log -headers more rewrite handler -[error] ---- log_level: debug - - - -=== TEST 7: multiple http {} blocks (filter) -This test case won't run with nginx 1.9.3+ since duplicate http {} blocks -have been prohibited since then. ---- SKIP ---- config - location /foo { - echo hi; - more_set_headers 'Foo: bar'; - } ---- post_main_config - http { - } - ---- request - GET /foo ---- response_body -hi ---- response_headers -Foo: bar ---- no_error_log -[error] ---- error_log -headers more header filter ---- log_level: debug - - - -=== TEST 8: multiple http {} blocks (handler) -This test case won't run with nginx 1.9.3+ since duplicate http {} blocks -have been prohibited since then. ---- SKIP ---- config - location /foo { - more_set_input_headers 'Foo: bar'; - echo $http_foo; - } ---- post_main_config - http { - } - ---- request - GET /foo ---- response_body -bar ---- no_error_log -headers more header handler -[error] ---- log_level: debug diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/vars.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/vars.t deleted file mode 100644 index 04c75c3..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/vars.t +++ /dev/null @@ -1,58 +0,0 @@ -# vi:ft= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -plan tests => 9; - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: vars ---- config - location /foo { - echo hi; - set $val 'hello, world'; - more_set_headers 'X-Foo: $val'; - } ---- request - GET /foo ---- response_headers -X-Foo: hello, world ---- response_body -hi - - - -=== TEST 2: vars in both key and val ---- config - location /foo { - echo hi; - set $val 'hello, world'; - more_set_headers '$val: $val'; - } ---- request - GET /foo ---- response_headers -$val: hello, world ---- response_body -hi - - - -=== TEST 3: vars in input header directives ---- config - location /foo { - set $val 'dog'; - more_set_input_headers 'Host: $val'; - echo $host; - } ---- request - GET /foo ---- response_body -dog ---- response_headers -Host: diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/util/build.sh b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/util/build.sh deleted file mode 100755 index 00a191f..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/util/build.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# this file is mostly meant to be used by the author himself. - -root=`pwd` -version=$1 -home=~ -force=$2 -pcre2_opt="" -if [ "$WITHOUT_PCRE2" = "1" ]; then - pcre2_opt="--without-pcre2" -fi - - #--with-cc=gcc46 \ - -ngx-build $force $version \ - --with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB" \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --without-http_upstream_ip_hash_module \ - --without-http_empty_gif_module \ - --without-http_memcached_module \ - --without-http_referer_module \ - --without-http_autoindex_module \ - --without-http_auth_basic_module \ - --without-http_userid_module \ - $pcre2_opt \ - --with-http_realip_module \ - --with-http_dav_module \ - --add-module=$root/../eval-nginx-module \ - --add-module=$root/../lua-nginx-module \ - --add-module=$root/../echo-nginx-module \ - --add-module=$root $opts \ - --with-debug - #--add-module=$root/../ndk-nginx-module \ - #--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!) - diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/valgrind.suppress b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/valgrind.suppress deleted file mode 100644 index d51de70..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/valgrind.suppress +++ /dev/null @@ -1,135 +0,0 @@ -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - obj:* -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_calloc - fun:ngx_event_process_init -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl -} -{ - - Memcheck:Cond - fun:memcpy - fun:ngx_vslprintf - fun:ngx_log_error_core - fun:ngx_http_charset_header_filter -} -{ - nginx-core-process-init - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - nginx-core-crc32-init - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_crc32_table_init - fun:main -} -{ - palloc_large_for_init_request - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_palloc_large - fun:ngx_palloc - fun:ngx_pcalloc - fun:ngx_http_init_request - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - palloc_large_for_create_temp_buf - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_palloc_large - fun:ngx_palloc - fun:ngx_create_temp_buf - fun:ngx_http_init_request - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - accept_create_pool - Memcheck:Leak - fun:memalign - fun:posix_memalign - fun:ngx_memalign - fun:ngx_create_pool - fun:ngx_event_accept - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - create_pool_for_init_req - Memcheck:Leak - fun:memalign - fun:posix_memalign - fun:ngx_memalign - fun:ngx_create_pool - fun:ngx_http_init_request - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - - Memcheck:Addr8 - fun:getenv - fun:gcov_exit - fun:exit - fun:ngx_master_process_exit -} -{ - - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_worker_process_init - fun:ngx_worker_process_cycle -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/.gitattributes b/modules_deb/libnginx-mod-http-memc-0.20/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-memc-0.20/.gitignore b/modules_deb/libnginx-mod-http-memc-0.20/.gitignore deleted file mode 100644 index ed5f748..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/.gitignore +++ /dev/null @@ -1,54 +0,0 @@ -.libs -*.t_ -*.swp -*.slo -*.la -*.swo -*.lo -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[789] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -t.sh -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -genmobi.sh -*.mobi -misc/chunked -reindex -src/response.c -src/handler.h -src/util.c -src/module.c -src/handler.c -src/response.rl -src/response.h -src/module.h -src/util.h -src/request.h -src/request.c -ctags -nginx -*.html -t/servroot/ -all -Changes -build1[0-9] -go -buildroot/ -analyze -*.plist -Makefile diff --git a/modules_deb/libnginx-mod-http-memc-0.20/.travis.yml b/modules_deb/libnginx-mod-http-memc-0.20/.travis.yml deleted file mode 100644 index e695941..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -sudo: required -dist: bionic - -os: linux - -language: c - -compiler: - - gcc - -addons: - apt: - packages: [ axel, cpanminus, libtest-base-perl, libtext-diff-perl, liburi-perl, libwww-perl, libtest-longstring-perl, liblist-moreutils-perl ] - -cache: - apt: true - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LUA_INCLUDE_DIR=$LUAJIT_INC - - LUA_CMODULE_DIR=/lib - - JOBS=3 - - NGX_BUILD_JOBS=$JOBS - matrix: - - NGINX_VERSION=1.17.8 - - NGINX_VERSION=1.19.9 - -services: - - memcache - -install: - - git clone https://github.com/openresty/nginx-devel-utils.git - - git clone https://github.com/openresty/openresty.git ../openresty - - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module - - git clone https://github.com/openresty/test-nginx.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/nginx-eval-module.git ../eval-nginx-module - - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - - git clone https://github.com/openresty/set-misc-nginx-module.git ../set-misc-nginx-module - -script: - - sudo iptables -I OUTPUT -p tcp --dst 127.0.0.2 --dport 12345 -j DROP - - sudo iptables -I OUTPUT -p udp --dst 127.0.0.2 --dport 12345 -j DROP - - cd luajit2 - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - - perlbrew off && cd test-nginx && sudo cpanm . && cd .. - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH - - export NGX_BUILD_CC=$CC - - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - - nginx -V - - ldd `which nginx`|grep luajit - - prove -I. -r t diff --git a/modules_deb/libnginx-mod-http-memc-0.20/README.markdown b/modules_deb/libnginx-mod-http-memc-0.20/README.markdown deleted file mode 100644 index 7f82bd1..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/README.markdown +++ /dev/null @@ -1,813 +0,0 @@ -Name -==== - -**ngx_memc** - An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands. - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) - * [Keep-alive connections to memcached servers](#keep-alive-connections-to-memcached-servers) - * [How it works](#how-it-works) -* [Memcached commands supported](#memcached-commands-supported) - * [get $memc_key](#get-memc_key) - * [set $memc_key $memc_flags $memc_exptime $memc_value](#set-memc_key-memc_flags-memc_exptime-memc_value) - * [add $memc_key $memc_flags $memc_exptime $memc_value](#add-memc_key-memc_flags-memc_exptime-memc_value) - * [replace $memc_key $memc_flags $memc_exptime $memc_value](#replace-memc_key-memc_flags-memc_exptime-memc_value) - * [append $memc_key $memc_flags $memc_exptime $memc_value](#append-memc_key-memc_flags-memc_exptime-memc_value) - * [prepend $memc_key $memc_flags $memc_exptime $memc_value](#prepend-memc_key-memc_flags-memc_exptime-memc_value) - * [delete $memc_key](#delete-memc_key) - * [delete $memc_key $memc_exptime](#delete-memc_key-memc_exptime) - * [incr $memc_key $memc_value](#incr-memc_key-memc_value) - * [decr $memc_key $memc_value](#decr-memc_key-memc_value) - * [flush_all](#flush_all) - * [flush_all $memc_exptime](#flush_all-memc_exptime) - * [stats](#stats) - * [version](#version) -* [Directives](#directives) - * [memc_pass](#memc_pass) - * [memc_cmds_allowed](#memc_cmds_allowed) - * [memc_flags_to_last_modified](#memc_flags_to_last_modified) - * [memc_connect_timeout](#memc_connect_timeout) - * [memc_send_timeout](#memc_send_timeout) - * [memc_read_timeout](#memc_read_timeout) - * [memc_buffer_size](#memc_buffer_size) - * [memc_ignore_client_abort](#memc_ignore_client_abort) -* [Installation](#installation) - * [For Developers](#for-developers) -* [Compatibility](#compatibility) -* [Community](#community) - * [English Mailing List](#english-mailing-list) - * [Chinese Mailing List](#chinese-mailing-list) -* [Report Bugs](#report-bugs) -* [Source Repository](#source-repository) -* [Changes](#changes) -* [Test Suite](#test-suite) -* [TODO](#todo) -* [Getting involved](#getting-involved) -* [Author](#author) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Version -======= - -This document describes ngx_memc [v0.19](http://github.com/openresty/memc-nginx-module/tags) released on 19 April 2018. - -Synopsis -======== - -```nginx - - # GET /foo?key=dog - # - # POST /foo?key=cat - # Cat's value... - # - # PUT /foo?key=bird - # Bird's value... - # - # DELETE /foo?key=Tiger - location /foo { - set $memc_key $arg_key; - - # $memc_cmd defaults to get for GET, - # add for POST, set for PUT, and - # delete for the DELETE request method. - - memc_pass 127.0.0.1:11211; - } -``` - -```nginx - - # GET /bar?cmd=get&key=cat - # - # POST /bar?cmd=set&key=dog - # My value for the "dog" key... - # - # DELETE /bar?cmd=delete&key=dog - # GET /bar?cmd=delete&key=dog - location /bar { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_flags $arg_flags; # defaults to 0 - set $memc_exptime $arg_exptime; # defaults to 0 - - memc_pass 127.0.0.1:11211; - } -``` - -```nginx - - # GET /bar?cmd=get&key=cat - # GET /bar?cmd=set&key=dog&val=animal&flags=1234&exptime=2 - # GET /bar?cmd=delete&key=dog - # GET /bar?cmd=flush_all - location /bar { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_flags $arg_flags; # defaults to 0 - set $memc_exptime $arg_exptime; # defaults to 0 - - memc_cmds_allowed get set add delete flush_all; - - memc_pass 127.0.0.1:11211; - } -``` - -```nginx - - http { - ... - upstream backend { - server 127.0.0.1:11984; - server 127.0.0.1:11985; - } - server { - location /stats { - set $memc_cmd stats; - memc_pass backend; - } - ... - } - } - ... -``` - -```nginx - - # read the memcached flags into the Last-Modified header - # to respond 304 to conditional GET - location /memc { - set $memc_key $arg_key; - - memc_pass 127.0.0.1:11984; - - memc_flags_to_last_modified on; - } -``` - -```nginx - - location /memc { - set $memc_key foo; - set $memc_cmd get; - - # access the unix domain socket listend by memcached - memc_pass unix:/tmp/memcached.sock; - } -``` - -Description -=========== - -This module extends the standard [memcached module](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) to support almost the whole [memcached ascii protocol](http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt). - -It allows you to define a custom [REST](http://en.wikipedia.org/wiki/REST) interface to your memcached servers or access memcached in a very efficient way from within the nginx server by means of subrequests or [independent fake requests](http://github.com/srlindsay/nginx-independent-subrequest). - -This module is not supposed to be merged into the Nginx core because I've used [Ragel](http://www.complang.org/ragel/) to generate the memcached response parsers (in C) for joy :) - -If you are going to use this module to cache location responses out of the box, try [srcache-nginx-module](http://github.com/openresty/srcache-nginx-module) with this module to achieve that. - -When used in conjunction with [lua-nginx-module](http://github.com/openresty/lua-nginx-module), it is recommended to use the [lua-resty-memcached](http://github.com/openresty/lua-resty-memcached) library instead of this module though, because the former is much more flexible and memory-efficient. - -[Back to TOC](#table-of-contents) - -Keep-alive connections to memcached servers -------------------------------------------- - -You need [HttpUpstreamKeepaliveModule](http://wiki.nginx.org/HttpUpstreamKeepaliveModule) together with this module for keep-alive TCP connections to your backend memcached servers. - -Here's a sample configuration: - -```nginx - - http { - upstream backend { - server 127.0.0.1:11211; - - # a pool with at most 1024 connections - # and do not distinguish the servers: - keepalive 1024; - } - - server { - ... - location /memc { - set $memc_cmd get; - set $memc_key $arg_key; - memc_pass backend; - } - } - } -``` - -[Back to TOC](#table-of-contents) - -How it works ------------- - -It implements the memcached TCP protocol all by itself, based upon the `upstream` mechanism. Everything involving I/O is non-blocking. - -The module itself does not keep TCP connections to the upstream memcached servers across requests, just like other upstream modules. For a working solution, see section [Keep-alive connections to memcached servers](#keep-alive-connections-to-memcached-servers). - -[Back to TOC](#table-of-contents) - -Memcached commands supported -============================ - -The memcached storage commands [set](#set-memc_key-memc_flags-memc_exptime-memc_value), [add](#add-memc_key-memc_flags-memc_exptime-memc_value), [replace](#replace-memc_key-memc_flags-memc_exptime-memc_value), [prepend](#prepend-memc_key-memc_flags-memc_exptime-memc_value), and [append](#append-memc_key-memc_flags-memc_exptime-memc_value) uses the `$memc_key` as the key, `$memc_exptime` as the expiration time (or delay) (defaults to 0), `$memc_flags` as the flags (defaults to 0), to build the corresponding memcached queries. - -If `$memc_value` is not defined at all, then the request body will be used as the value of the `$memc_value` except for the [incr](#incr-memc_key-memc_value) and [decr](#decr-memc_key-memc_value) commands. Note that if `$memc_value` is defined as an empty string (`""`), that empty string will still be used as the value as is. - -The following memcached commands have been implemented and tested (with their parameters marked by corresponding -nginx variables defined by this module): - -[Back to TOC](#table-of-contents) - -get $memc_key -------------- - -Retrieves the value using a key. - -```nginx - - location /foo { - set $memc_cmd 'get'; - set $memc_key 'my_key'; - - memc_pass 127.0.0.1:11211; - - add_header X-Memc-Flags $memc_flags; - } -``` - -Returns `200 OK` with the value put into the response body if the key is found, or `404 Not Found` otherwise. The `flags` number will be set into the `$memc_flags` variable so it's often desired to put that info into the response headers by means of the standard [add_header directive](http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header). - -It returns `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -[Back to TOC](#table-of-contents) - -set $memc_key $memc_flags $memc_exptime $memc_value ---------------------------------------------------- - -To use the request body as the memcached value, just avoid setting the `$memc_value` variable: - -```nginx - - # POST /foo - # my value... - location /foo { - set $memc_cmd 'set'; - set $memc_key 'my_key'; - set $memc_flags 12345; - set $memc_exptime 24; - - memc_pass 127.0.0.1:11211; - } -``` - -Or let the `$memc_value` hold the value: - -```nginx - - location /foo { - set $memc_cmd 'set'; - set $memc_key 'my_key'; - set $memc_flags 12345; - set $memc_exptime 24; - set $memc_value 'my_value'; - - memc_pass 127.0.0.1:11211; - } -``` - -Returns `201 Created` if the upstream memcached server replies `STORED`, `200` for `NOT_STORED`, `404` for `NOT_FOUND`, `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -The original memcached responses are returned as the response body except for `404 NOT FOUND`. - -[Back to TOC](#table-of-contents) - -add $memc_key $memc_flags $memc_exptime $memc_value ---------------------------------------------------- - -Similar to the [set command](#set-memc_key-memc_flags-memc_exptime-memc_value). - -[Back to TOC](#table-of-contents) - -replace $memc_key $memc_flags $memc_exptime $memc_value -------------------------------------------------------- - -Similar to the [set command](#set-memc_key-memc_flags-memc_exptime-memc_value). - -[Back to TOC](#table-of-contents) - -append $memc_key $memc_flags $memc_exptime $memc_value ------------------------------------------------------- - -Similar to the [set command](#set-memc_key-memc_flags-memc_exptime-memc_value). - -Note that at least memcached version 1.2.2 does not support the "append" and "prepend" commands. At least 1.2.4 and later versions seem to supports these two commands. - -[Back to TOC](#table-of-contents) - -prepend $memc_key $memc_flags $memc_exptime $memc_value -------------------------------------------------------- - -Similar to the [append command](#append-memc_key-memc_flags-memc_exptime-memc_value). - -[Back to TOC](#table-of-contents) - -delete $memc_key ----------------- - -Deletes the memcached entry using a key. - -```nginx - - location /foo - set $memc_cmd delete; - set $memc_key my_key; - - memc_pass 127.0.0.1:11211; - } -``` - -Returns `200 OK` if deleted successfully, `404 Not Found` for `NOT_FOUND`, or `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -The original memcached responses are returned as the response body except for `404 NOT FOUND`. - -[Back to TOC](#table-of-contents) - -delete $memc_key $memc_exptime ------------------------------- - -Similar to the [delete $memc_key](#delete-memc_key) command except it accepts an optional `expiration` time specified by the `$memc_exptime` variable. - -This command is no longer available in the latest memcached version 1.4.4. - -[Back to TOC](#table-of-contents) - -incr $memc_key $memc_value --------------------------- - -Increments the existing value of `$memc_key` by the amount specified by `$memc_value`: - -```nginx - - location /foo { - set $memc_cmd incr; - set $memc_key my_key; - set $memc_value 2; - memc_pass 127.0.0.1:11211; - } -``` - -In the preceding example, every time we access `/foo` will cause the value of `my_key` increments by `2`. - -Returns `200 OK` with the new value associated with that key as the response body if successful, or `404 Not Found` if the key is not found. - -It returns `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -[Back to TOC](#table-of-contents) - -decr $memc_key $memc_value --------------------------- - -Similar to [incr $memc_key $memc_value](#incr-memc_key-memc_value). - -[Back to TOC](#table-of-contents) - -flush_all ---------- - -Mark all the keys on the memcached server as expired: - -```nginx - - location /foo { - set $memc_cmd flush_all; - memc_pass 127.0.0.1:11211; - } -``` - -[Back to TOC](#table-of-contents) - -flush_all $memc_exptime ------------------------ - -Just like [flush_all](#flush_all) but also accepts an expiration time specified by the `$memc_exptime` variable. - -[Back to TOC](#table-of-contents) - -stats ------ - -Causes the memcached server to output general-purpose statistics and settings - -```nginx - - location /foo { - set $memc_cmd stats; - memc_pass 127.0.0.1:11211; - } -``` - -Returns `200 OK` if the request succeeds, or 502 for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -The raw `stats` command output from the upstream memcached server will be put into the response body. - -[Back to TOC](#table-of-contents) - -version -------- - -Queries the memcached server's version number: - -```nginx - - location /foo { - set $memc_cmd version; - memc_pass 127.0.0.1:11211; - } -``` - -Returns `200 OK` if the request succeeds, or 502 for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -The raw `version` command output from the upstream memcached server will be put into the response body. - -[Back to TOC](#table-of-contents) - -Directives -========== - -All the standard [memcached module](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) directives in nginx 0.8.28 are directly inherited, with the `memcached_` prefixes replaced by `memc_`. For example, the `memcached_pass` directive is spelled `memc_pass`. - -Here we only document the most important two directives (the latter is a new directive introduced by this module). - -[Back to TOC](#table-of-contents) - -memc_pass ---------- - -**syntax:** *memc_pass <memcached server IP address>:<memcached server port>* - -**syntax:** *memc_pass <memcached server hostname>:<memcached server port>* - -**syntax:** *memc_pass <upstream_backend_name>* - -**syntax:** *memc_pass unix:<path_to_unix_domain_socket>* - -**default:** *none* - -**context:** *http, server, location, if* - -**phase:** *content* - -Specify the memcached server backend. - -[Back to TOC](#table-of-contents) - -memc_cmds_allowed ------------------ -**syntax:** *memc_cmds_allowed <cmd>...* - -**default:** *none* - -**context:** *http, server, location, if* - -Lists memcached commands that are allowed to access. By default, all the memcached commands supported by this module are accessible. -An example is - -```nginx - - location /foo { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:11211; - - memc_cmds_allowed get; - } -``` - -[Back to TOC](#table-of-contents) - -memc_flags_to_last_modified ---------------------------- -**syntax:** *memc_flags_to_last_modified on|off* - -**default:** *off* - -**context:** *http, server, location, if* - -Read the memcached flags as epoch seconds and set it as the value of the `Last-Modified` header. For conditional GET, it will signal nginx to return `304 Not Modified` response to save bandwidth. - -[Back to TOC](#table-of-contents) - -memc_connect_timeout --------------------- -**syntax:** *memc_connect_timeout <time>* - -**default:** *60s* - -**context:** *http, server, location* - -The timeout for connecting to the memcached server, in seconds by default. - -It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes). - -This time must be less than 597 hours. - -[Back to TOC](#table-of-contents) - -memc_send_timeout ------------------ -**syntax:** *memc_send_timeout <time>* - -**default:** *60s* - -**context:** *http, server, location* - -The timeout for sending TCP requests to the memcached server, in seconds by default. - -It is wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes). - -This time must be less than 597 hours. - -[Back to TOC](#table-of-contents) - -memc_read_timeout ------------------ -**syntax:** *memc_read_timeout <time>* - -**default:** *60s* - -**context:** *http, server, location* - -The timeout for reading TCP responses from the memcached server, in seconds by default. - -It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes). - -This time must be less than 597 hours. - -[Back to TOC](#table-of-contents) - -memc_buffer_size ----------------- -**syntax:** *memc_buffer_size <size>* - -**default:** *4k/8k* - -**context:** *http, server, location* - -This buffer size is used for the memory buffer to hold - -* the complete response for memcached commands other than `get`, -* the complete response header (i.e., the first line of the response) for the `get` memcached command. - -This default size is the page size, may be `4k` or `8k`. - -[Back to TOC](#table-of-contents) - -memc_ignore_client_abort ------------------------- -**syntax:** *memc_ignore_client_abort on|off* - -**default:** *off* - -**context:** *location* - -Determines whether the connection with a memcache server should be closed when a client closes a connection without waiting for a response. - -This directive was first added in the `v0.14` release. - -[Back to TOC](#table-of-contents) - -Installation -============ - -You're recommended to install this module (as well as the Nginx core and many other goodies) via the [OpenResty bundle](http://openresty.org). See the [installation steps](http://openresty.org/#Installation) for `OpenResty`. - -Alternatively, you can compile this module into the standard Nginx source distribution by hand: - -Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.13.6 (see [nginx compatibility](#compatibility)), and then build the source with this module: - -```bash - - wget 'http://nginx.org/download/nginx-1.13.6.tar.gz' - tar -xzvf nginx-1.13.6.tar.gz - cd nginx-1.13.6/ - - # Here we assume you would install you nginx under /opt/nginx/. - ./configure --prefix=/opt/nginx \ - --add-module=/path/to/memc-nginx-module - - make -j2 - make install -``` - -Download the latest version of the release tarball of this module from [memc-nginx-module file list](http://github.com/openresty/memc-nginx-module/tags). - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ngx_http_memc_module.so; -``` - -[Back to TOC](#table-of-contents) - -For Developers --------------- - -The memached response parsers were generated by [Ragel](http://www.complang.org/ragel/). If you want to -regenerate the parser's C file, i.e., [src/ngx_http_memc_response.c](http://github.com/openresty/memc-nginx-module/blob/master/src/ngx_http_memc_response.c), use the following command from the root of the memc module's source tree: - -```bash - - $ ragel -G2 src/ngx_http_memc_response.rl -``` - -[Back to TOC](#table-of-contents) - -Compatibility -============= - -The following versions of Nginx should work with this module: - - -* **1.17.x** (last tested: 1.17.4) -* **1.16.x** -* **1.15.x** (last tested: 1.15.8) -* **1.14.x** -* **1.13.x** (last tested: 1.13.6) -* **1.12.x** -* **1.11.x** (last tested: 1.11.2) -* **1.10.x** -* **1.9.x** (last tested: 1.9.15) -* **1.8.x** -* **1.7.x** (last tested: 1.7.10) -* **1.6.x** -* **1.5.x** (last tested: 1.5.12) -* **1.4.x** (last tested: 1.4.4) -* **1.2.x** (last tested: 1.2.9) -* **1.1.x** (last tested: 1.1.5) -* **1.0.x** (last tested: 1.0.10) -* **0.9.x** (last tested: 0.9.4) -* **0.8.x** (last tested: 0.8.54) -* **0.7.x >= 0.7.46** (last tested: 0.7.68) - -It's worth mentioning that some 0.7.x versions older than 0.7.46 might also work, but I can't easily test them because the test suite makes extensive use of the [echo module](http://github.com/openresty/echo-nginx-module)'s [echo_location directive](http://github.com/openresty/echo-nginx-module#echo_location), which requires at least nginx 0.7.46 :) - -Earlier versions of Nginx like 0.6.x and 0.5.x will *not* work. - -If you find that any particular version of Nginx above 0.7.46 does not work with this module, please consider [reporting a bug](#report-bugs). - -[Back to TOC](#table-of-contents) - -Community -========= - -[Back to TOC](#table-of-contents) - -English Mailing List --------------------- - -The [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers. - -[Back to TOC](#table-of-contents) - -Chinese Mailing List --------------------- - -The [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers. - -[Back to TOC](#table-of-contents) - -Report Bugs -=========== - -Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to - -1. create a ticket on the [issue tracking interface](http://github.com/openresty/memc-nginx-module/issues) provided by GitHub, -1. or send a bug report or even patches to the [nginx mailing list](http://mailman.nginx.org/mailman/listinfo/nginx). - -[Back to TOC](#table-of-contents) - -Source Repository -================= - -Available on github at [openresty/memc-nginx-module](http://github.com/openresty/memc-nginx-module). - -[Back to TOC](#table-of-contents) - -Changes -======= - -The changes of every release of this module can be obtained from the OpenResty bundle's change logs: - - - -[Back to TOC](#table-of-contents) - -Test Suite -========== - -This module comes with a Perl-driven test suite. The [test cases](http://github.com/openresty/memc-nginx-module/tree/master/t/) are -[declarative](http://github.com/openresty/memc-nginx-module/blob/master/t/storage.t) too. Thanks to the [Test::Base](http://search.cpan.org/perldoc?Test::Base) module in the Perl world. - -To run it on your side: - -```bash - - $ PATH=/path/to/your/nginx-with-memc-module:$PATH prove -r t -``` - -You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary. - -Either [LWP::UserAgent](http://search.cpan.org/perldoc?LWP::UserAgent) or [IO::Socket](http://search.cpan.org/perldoc?IO::Socket) is used by the [test scaffold](http://github.com/openresty/memc-nginx-module/blob/master/test/lib/Test/Nginx/LWP.pm). - -Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility. - -You should also keep a memcached server listening on the `11211` port at localhost before running the test suite. - -Some parts of the test suite requires modules [rewrite](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) and [echo](http://github.com/openresty/echo-nginx-module) to be enabled as well when building Nginx. - -[Back to TOC](#table-of-contents) - -TODO -==== - -* add support for the memcached commands `cas`, `gets` and `stats $memc_value`. -* add support for the `noreply` option. - -[Back to TOC](#table-of-contents) - -Getting involved -================ - -You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub. - -[Back to TOC](#table-of-contents) - -Author -====== - -Yichun "agentzh" Zhang (章亦春) *<agentzh@gmail.com>*, OpenResty Inc. - -This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well. - -[Back to TOC](#table-of-contents) - -Copyright & License -=================== - -The code base is borrowed directly from the standard [memcached module](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) in the Nginx core. This part of code is copyrighted by Igor Sysoev and Nginx Inc. - -Copyright (c) 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. - -This module is licensed under the terms of the BSD license. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[Back to TOC](#table-of-contents) - -See Also -======== - -* The original announcement email on the nginx mailing list: [ngx_memc: "an extended version of ngx_memcached that supports set, add, delete, and many more commands"](http://forum.nginx.org/read.php?2,28359) -* My slides demonstrating various ngx_memc usage: (use the arrow or pageup/pagedown keys on the keyboard to swith pages) -* The latest [memcached TCP protocol](http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt). -* The [ngx_srcache](http://github.com/openresty/srcache-nginx-module) module -* The [lua-resty-memcached](https://github.com/openresty/lua-resty-memcached) library based on the [lua-nginx-module](http://github.com/openresty/lua-nginx-module) cosocket API. -* The standard [memcached](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) module. -* The [echo module](http://github.com/openresty/echo-nginx-module) for Nginx module's automated testing. -* The standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module and the 3rd-parth [headers-more](http://github.com/openresty/headers-more-nginx-module) module. - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/config b/modules_deb/libnginx-mod-http-memc-0.20/config deleted file mode 100644 index 7e4bfd6..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/config +++ /dev/null @@ -1,31 +0,0 @@ -ngx_addon_name=ngx_http_memc_module - -MEMC_SRCS=" \ - $ngx_addon_dir/src/ngx_http_memc_module.c \ - $ngx_addon_dir/src/ngx_http_memc_request.c \ - $ngx_addon_dir/src/ngx_http_memc_response.c \ - $ngx_addon_dir/src/ngx_http_memc_util.c \ - $ngx_addon_dir/src/ngx_http_memc_handler.c \ - " - -MEMC_DEPS=" \ - $ngx_addon_dir/src/ddebug.h \ - $ngx_addon_dir/src/ngx_http_memc_module.h \ - $ngx_addon_dir/src/ngx_http_memc_request.h \ - $ngx_addon_dir/src/ngx_http_memc_response.h \ - $ngx_addon_dir/src/ngx_http_memc_util.h \ - $ngx_addon_dir/src/ngx_http_memc_handler.h \ - " - -if [ -n "$ngx_module_link" ]; then - ngx_module_type=HTTP - ngx_module_name=$ngx_addon_name - ngx_module_srcs="$MEMC_SRCS" - ngx_module_deps="$MEMC_DEPS" - - . auto/module -else - HTTP_MODULES="$HTTP_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $MEMC_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_DEPS $MEMC_DEPS" -fi diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/changelog b/modules_deb/libnginx-mod-http-memc-0.20/debian/changelog deleted file mode 100644 index 57faeca..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/changelog +++ /dev/null @@ -1,51 +0,0 @@ -libnginx-mod-http-memc (0.20-2) unstable; urgency=medium - - * Team upload. - * d/control: bump Standards-Version: 4.7.2, no changes - * d/watch: use more generic template - * d/copyright: bump debian/* copyright year - - -- Jan Mojžíš Sat, 12 Apr 2025 09:05:46 +0200 - -libnginx-mod-http-memc (0.20-1) unstable; urgency=medium - - * Team upload - * New upstream version 0.20 - * d/rules: Rebuild ngx_http_memc_response.c using ragel (Closes: 1025810) - * d/copyright: bump debian/* copyright year - * d/watch: use new recommended github template - * d/gbp.conf: add [pull] track-missing = True - - -- Jan Mojžíš Mon, 08 Jan 2024 11:33:58 +0100 - -libnginx-mod-http-memc (0.19-4) unstable; urgency=medium - - * Team upload - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 17:50:21 +0200 - -libnginx-mod-http-memc (0.19-3) unstable; urgency=medium - - * Team upload - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Wed, 28 Jun 2023 00:01:44 +0200 - -libnginx-mod-http-memc (0.19-2) unstable; urgency=medium - - * Team upload. - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * d/fix.scanned.copyright: added, fixes upstream author name parsing - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:30 +0100 - -libnginx-mod-http-memc (0.19-1) unstable; urgency=medium - - * Initial release. (Closes: #1025289) - - -- Jérémy Lal Fri, 02 Dec 2022 00:32:56 +0100 diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/control b/modules_deb/libnginx-mod-http-memc-0.20/debian/control deleted file mode 100644 index 3b34393..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/control +++ /dev/null @@ -1,26 +0,0 @@ -Source: libnginx-mod-http-memc -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jérémy Lal , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, - ragel, -Standards-Version: 4.7.2 -Homepage: https://github.com/openresty/memc-nginx-module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-memc.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-memc -Rules-Requires-Root: no - -Package: libnginx-mod-http-memc -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Extended memcached commands module for Nginx - This module supports almost the whole memcached ascii protocol, - and provides many more commands than the embedded memcached - module in Nginx. - The libnginx-mod-http-srcache-filter module can be configured to - use that module to cache responses. diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/copyright b/modules_deb/libnginx-mod-http-memc-0.20/debian/copyright deleted file mode 100644 index a2e9e2e..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/copyright +++ /dev/null @@ -1,62 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: memc-nginx-module -Upstream-Contact: Yichun "agentzh" Zhang (章亦春) -Source: https://github.com/openresty/memc-nginx-module - -Files: * -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: config -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: debian/* -Copyright: 2022-2024, Jérémy Lal , - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: src/* -Copyright: Yichun Zhang (agentzh) -License: BSD-2-clause - -Files: src/ddebug.h - src/ngx_http_memc_handler.h -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: src/ngx_http_memc_module.c -Copyright: Zhang "agentzh" Yichun - Igor Sysoev -License: BSD-2-clause - -Files: t/* -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: util/* -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/fix.scanned.copyright b/modules_deb/libnginx-mod-http-memc-0.20/debian/fix.scanned.copyright deleted file mode 100644 index b25e244..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/fix.scanned.copyright +++ /dev/null @@ -1,2 +0,0 @@ -# fixes upstream author name parsing -! copyright Files:~/.*/ Copyright=~"s/(Zhang)\s\(.*x\{6625\}\)/$1\ (章亦春)/" diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/gbp.conf b/modules_deb/libnginx-mod-http-memc-0.20/debian/gbp.conf deleted file mode 100644 index 97cd209..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/gbp.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/rules b/modules_deb/libnginx-mod-http-memc-0.20/debian/rules deleted file mode 100755 index ec9b918..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/rules +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -execute_before_dh_auto_build: - # rebuild ngx_http_memc_response.c using ragel - [ -f src/ngx_http_memc_response.c.orig ] || cp src/ngx_http_memc_response.c src/ngx_http_memc_response.c.orig - ragel -G2 src/ngx_http_memc_response.rl || mv -f src/ngx_http_memc_response.c.orig src/ngx_http_memc_response.c - diff -u src/ngx_http_memc_response.c.orig src/ngx_http_memc_response.c || : - -execute_after_dh_auto_build: - mv -f src/ngx_http_memc_response.c.orig src/ngx_http_memc_response.c - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/source/format b/modules_deb/libnginx-mod-http-memc-0.20/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/control b/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/control deleted file mode 100644 index 3c57b8b..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/control +++ /dev/null @@ -1,14 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: flush -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - memcached, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/flush b/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/flush deleted file mode 100644 index a194656..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/flush +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - - location /flush { - set \$memc_cmd flush_all; - memc_pass 127.0.0.1:11211; - } -} -EOF - -exp="OK -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/flush` -out=`echo "${out}" | sed 's/\r//'` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/generic b/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/upstream/metadata b/modules_deb/libnginx-mod-http-memc-0.20/debian/upstream/metadata deleted file mode 100644 index 1f4a243..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/openresty/memc-nginx-module/issues -Bug-Submit: https://github.com/openresty/memc-nginx-module/issues/new -Repository-Browse: https://github.com/openresty/memc-nginx-module diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/watch b/modules_deb/libnginx-mod-http-memc-0.20/debian/watch deleted file mode 100644 index 81f077a..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/openresty/memc-nginx-module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ddebug.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ddebug.h deleted file mode 100644 index 36e810e..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ddebug.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef DDEBUG_H -#define DDEBUG_H - - -#include -#include - - -#if defined(DDEBUG) && (DDEBUG) - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) fprintf(stderr, "memc *** "); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__) - -# else - -#include -#include - -#include - -static ngx_inline void -dd(const char* fmt, ...) { -} - -# endif - -#else - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) - -# else - -#include - -static ngx_inline void -dd(const char* fmt, ...) { -} - -# endif - -#endif - -#if defined(DDEBUG) && (DDEBUG) - -#define dd_check_read_event_handler(r) \ - dd("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#define dd_check_write_event_handler(r) \ - dd("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - -#define dd_check_read_event_handler(r) -#define dd_check_write_event_handler(r) - -#endif - -#endif /* DDEBUG_H */ diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_common.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_common.rl deleted file mode 100644 index eeb61c1..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_common.rl +++ /dev/null @@ -1,44 +0,0 @@ -%%{ - machine memc_common; - - action catch_err { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } - - msg = any* -- "\r\n"; - - error_helper = "ERROR\r\n" - | "CLIENT_ERROR " msg "\r\n" - | "SERVER_ERROR " msg "\r\n" - ; - - error = error_helper @catch_err - ; - - action finalize { - dd("done it!"); - *done_addr = 1; - } - - action check { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - - action handle_stored { - dd("status set to 201"); - - *status_addr = NGX_HTTP_CREATED; - } - - action handle_not_found { - dd("status set to 404"); - - *status_addr = NGX_HTTP_NOT_FOUND; - } - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_delete.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_delete.rl deleted file mode 100644 index 1e01b05..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_delete.rl +++ /dev/null @@ -1,17 +0,0 @@ -%%{ - machine memc_delete; - - alphtype short; - - include memc_common "memc_common.rl"; - - response = "DELETED\r\n" - | "NOT_FOUND\r\n" @handle_not_found - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_flush_all.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_flush_all.rl deleted file mode 100644 index 74c7288..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_flush_all.rl +++ /dev/null @@ -1,16 +0,0 @@ -%%{ - machine memc_flush_all; - - alphtype short; - - include memc_common "memc_common.rl"; - - response = "OK\r\n" - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_incr_decr.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_incr_decr.rl deleted file mode 100644 index b4b13a5..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_incr_decr.rl +++ /dev/null @@ -1,20 +0,0 @@ -%%{ - machine memc_incr_decr; - - alphtype short; - - include memc_common "memc_common.rl"; - - value = digit+ - ; - - response = value " "* "\r\n" @handle_stored - | "NOT_FOUND\r\n" @handle_not_found - | error - ; - - main := response @finalize $check - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_stats.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_stats.rl deleted file mode 100644 index 9526b77..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_stats.rl +++ /dev/null @@ -1,22 +0,0 @@ -%%{ - machine memc_stats; - - alphtype short; - - include memc_common "memc_common.rl"; - - content = any+ - "\r\n" - ; - - stat_line = "STAT " content "\r\n" - ; - - response = stat_line* "END\r\n" - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_storage.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_storage.rl deleted file mode 100644 index b64a441..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_storage.rl +++ /dev/null @@ -1,17 +0,0 @@ -%%{ - machine memc_storage; - - include memc_common "memc_common.rl"; - - response = "STORED\r\n" @handle_stored - | "NOT_STORED\r\n" - | "EXISTS\r\n" - | "NOT_FOUND\r\n" @handle_not_found - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_version.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_version.rl deleted file mode 100644 index 3a85b59..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_version.rl +++ /dev/null @@ -1,19 +0,0 @@ -%%{ - machine memc_version; - - alphtype short; - - include memc_common "memc_common.rl"; - - version = any+ - "\r\n" - ; - - response = "VERSION " version "\r\n" - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.c deleted file mode 100644 index 0236242..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.c +++ /dev/null @@ -1,612 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_memc_handler.h" -#include "ngx_http_memc_module.h" -#include "ngx_http_memc_request.h" -#include "ngx_http_memc_response.h" -#include "ngx_http_memc_util.h" - - -static ngx_int_t ngx_http_memc_flags_as_http_time_variable( - ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data); - - -static ngx_http_variable_t ngx_http_memc_variables[] = { - - { ngx_string("memc_flags_as_http_time"), NULL, - ngx_http_memc_flags_as_http_time_variable, 0, - 0, 0 }, - - { ngx_null_string, NULL, NULL, 0, 0, 0 } -}; - - -static ngx_str_t ngx_http_memc_key = ngx_string("memc_key"); -static ngx_str_t ngx_http_memc_cmd = ngx_string("memc_cmd"); -static ngx_str_t ngx_http_memc_value = ngx_string("memc_value"); -static ngx_str_t ngx_http_memc_flags = ngx_string("memc_flags"); -static ngx_str_t ngx_http_memc_exptime = ngx_string("memc_exptime"); - - -static ngx_int_t ngx_http_memc_add_more_variables(ngx_conf_t *cf); -static ngx_int_t ngx_http_memc_variable_not_found(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); -static ngx_int_t ngx_http_memc_add_variable(ngx_conf_t *cf, ngx_str_t *name); -static ngx_flag_t ngx_http_memc_in_cmds_allowed(ngx_http_memc_loc_conf_t *mlcf, - ngx_http_memc_cmd_t memc_cmd); -static ngx_int_t ngx_http_memc_reinit_request(ngx_http_request_t *r); -static void ngx_http_memc_abort_request(ngx_http_request_t *r); -static void ngx_http_memc_finalize_request(ngx_http_request_t *r, - ngx_int_t rc); -static ngx_flag_t ngx_http_memc_valid_uint32_str(u_char *data, size_t len); -static ngx_flag_t ngx_http_memc_valid_uint64_str(u_char *data, size_t len); - - -ngx_int_t -ngx_http_memc_handler(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_http_memc_loc_conf_t *mlcf; - ngx_http_memc_main_conf_t *mmcf; - ngx_str_t target; - ngx_url_t url; - - ngx_http_variable_value_t *cmd_vv; - ngx_http_variable_value_t *key_vv; - ngx_http_variable_value_t *value_vv; - ngx_http_variable_value_t *flags_vv; - ngx_http_variable_value_t *exptime_vv; - - ngx_http_memc_cmd_t memc_cmd; - ngx_flag_t is_storage_cmd = 0; - - dd("memc handler"); - - mmcf = ngx_http_get_module_main_conf(r, ngx_http_memc_module); - - key_vv = ngx_http_get_indexed_variable(r, mmcf->key_index); - if (key_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - cmd_vv = ngx_http_get_indexed_variable(r, mmcf->cmd_index); - if (cmd_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (cmd_vv->not_found || cmd_vv->len == 0) { - dd("variable $memc_cmd not found"); - cmd_vv->not_found = 0; - cmd_vv->valid = 1; - cmd_vv->no_cacheable = 0; - - if (r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD)) { - cmd_vv->len = sizeof("get") - 1; - cmd_vv->data = (u_char *) "get"; - memc_cmd = ngx_http_memc_cmd_get; - - } else if (r->method == NGX_HTTP_POST) { - cmd_vv->len = sizeof("add") - 1; - cmd_vv->data = (u_char *) "add"; - memc_cmd = ngx_http_memc_cmd_add; - is_storage_cmd = 1; - - } else if (r->method == NGX_HTTP_PUT) { - cmd_vv->len = sizeof("set") - 1; - cmd_vv->data = (u_char *) "set"; - memc_cmd = ngx_http_memc_cmd_set; - is_storage_cmd = 1; - - } else if (r->method == NGX_HTTP_DELETE) { - cmd_vv->len = sizeof("delete") - 1; - cmd_vv->data = (u_char *) "delete"; - memc_cmd = ngx_http_memc_cmd_delete; - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "ngx_memc: $memc_cmd variable not found for HTTP " - "%V requests", &r->method_name); - - return NGX_HTTP_BAD_REQUEST; - } - - } else { - - memc_cmd = ngx_http_memc_parse_cmd(cmd_vv->data, cmd_vv->len, - &is_storage_cmd); - - if (memc_cmd == ngx_http_memc_cmd_unknown) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "ngx_memc: unknown $memc_cmd \"%v\"", cmd_vv); - return NGX_HTTP_BAD_REQUEST; - } - } - - mlcf = ngx_http_get_module_loc_conf(r, ngx_http_memc_module); - - dd("XXX connect timeout %d", (int) mlcf->upstream.connect_timeout); - - if (!ngx_http_memc_in_cmds_allowed(mlcf, memc_cmd)) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "ngx_memc: memcached command \"%v\" not allowed", - cmd_vv); - - return NGX_HTTP_FORBIDDEN; - } - - if (ngx_http_set_content_type(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - -#if defined(nginx_version) && \ - ((nginx_version >= 7063 && nginx_version < 8000) \ - || nginx_version >= 8007) - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - u = r->upstream; - -#else /* 0.7.x < 0.7.63, 0.8.x < 0.8.7 */ - - u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t)); - if (u == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - u->peer.log = r->connection->log; - u->peer.log_error = NGX_ERROR_ERR; -# if (NGX_THREADS) - u->peer.lock = &r->connection->lock; -# endif - - r->upstream = u; - -#endif - - if (mlcf->complex_target) { - /* variables used in the memc_pass directive */ - if (ngx_http_complex_value(r, mlcf->complex_target, &target) - != NGX_OK) - { - dd("failed to compile"); - return NGX_ERROR; - } - - if (target.len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memc: handler: empty \"memc_pass\" target"); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - url.host = target; - url.port = 0; - url.no_resolve = 1; - - mlcf->upstream.upstream = ngx_http_memc_upstream_add(r, &url); - - if (mlcf->upstream.upstream == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memc: upstream \"%V\" not found", &target); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - } - - u->schema.len = sizeof("memcached://") - 1; - u->schema.data = (u_char *) "memcached://"; - - u->output.tag = (ngx_buf_tag_t) &ngx_http_memc_module; - - u->conf = &mlcf->upstream; - - ctx = ngx_palloc(r->pool, sizeof(ngx_http_memc_ctx_t)); - if (ctx == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ctx->body_length = 0; - ctx->memc_key_vv = key_vv; - ctx->memc_value_vv = NULL; - ctx->memc_flags_vv = NULL; - - ctx->parser_state = NGX_ERROR; - - ctx->rest = NGX_HTTP_MEMC_END; - ctx->request = r; - - ctx->cmd_str.data = cmd_vv->data; - ctx->cmd_str.len = cmd_vv->len; - - ctx->cmd = memc_cmd; - - ctx->is_storage_cmd = is_storage_cmd; - - ngx_http_set_ctx(r, ctx, ngx_http_memc_module); - - if (is_storage_cmd) { - u->create_request = ngx_http_memc_create_storage_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_get) { - u->create_request = ngx_http_memc_create_get_cmd_request; - u->process_header = ngx_http_memc_process_get_cmd_header; - - u->input_filter_init = ngx_http_memc_get_cmd_filter_init; - u->input_filter = ngx_http_memc_get_cmd_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_flush_all) { - u->create_request = ngx_http_memc_create_flush_all_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_version - || memc_cmd == ngx_http_memc_cmd_stats) - { - u->create_request = ngx_http_memc_create_noarg_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_delete) { - u->create_request = ngx_http_memc_create_delete_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_incr - || memc_cmd == ngx_http_memc_cmd_decr) - { - u->create_request = ngx_http_memc_create_incr_decr_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "assertion failed: command \"%v\" does not have proper " - "handlers.", cmd_vv); - - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - u->reinit_request = ngx_http_memc_reinit_request; - u->abort_request = ngx_http_memc_abort_request; - u->finalize_request = ngx_http_memc_finalize_request; - - u->input_filter_ctx = ctx; - - if (is_storage_cmd - || memc_cmd == ngx_http_memc_cmd_flush_all - || memc_cmd == ngx_http_memc_cmd_delete) - { - exptime_vv = ngx_http_get_indexed_variable(r, mmcf->exptime_index); - - if (exptime_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ctx->memc_exptime_vv = exptime_vv; - - if (!exptime_vv->not_found - && exptime_vv->len - && !ngx_http_memc_valid_uint32_str(exptime_vv->data, - exptime_vv->len)) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "variable \"$memc_exptime\" takes invalid value: %v", - exptime_vv); - - return NGX_HTTP_BAD_REQUEST; - } - } - - if (is_storage_cmd || memc_cmd == ngx_http_memc_cmd_get) { - flags_vv = ngx_http_get_indexed_variable(r, mmcf->flags_index); - if (flags_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ctx->memc_flags_vv = flags_vv; - - if (is_storage_cmd - && !flags_vv->not_found - && flags_vv->len - && !ngx_http_memc_valid_uint32_str(flags_vv->data, flags_vv->len)) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "variable \"$memc_flags\" takes invalid value: %v", - flags_vv); - - return NGX_HTTP_BAD_REQUEST; - } - } - - if (is_storage_cmd - || memc_cmd == ngx_http_memc_cmd_incr - || memc_cmd == ngx_http_memc_cmd_decr) - { - value_vv = ngx_http_get_indexed_variable(r, mmcf->value_index); - if (value_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (memc_cmd == ngx_http_memc_cmd_incr - || memc_cmd == ngx_http_memc_cmd_decr) - { - if (value_vv->not_found || value_vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_value\" variable is required for " - "command \"%V\"", &ctx->cmd_str); - - return NGX_HTTP_BAD_REQUEST; - } - - if (!ngx_http_memc_valid_uint64_str(value_vv->data, - value_vv->len)) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "variable \"$memc_value\" is invalid for " - "incr/decr: %v", value_vv); - - return NGX_HTTP_BAD_REQUEST; - } - } - - ctx->memc_value_vv = value_vv; - } - - rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init); - - if (rc == NGX_ERROR || rc > NGX_OK) { - return rc; - } - - return NGX_DONE; -} - - -static ngx_int_t -ngx_http_memc_reinit_request(ngx_http_request_t *r) -{ - return NGX_OK; -} - - -static void -ngx_http_memc_abort_request(ngx_http_request_t *r) -{ - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "abort http memcached request"); - return; -} - - -static void -ngx_http_memc_finalize_request(ngx_http_request_t *r, ngx_int_t rc) -{ - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "finalize http memcached request"); - return; -} - - -static ngx_flag_t -ngx_http_memc_in_cmds_allowed(ngx_http_memc_loc_conf_t *mlcf, - ngx_http_memc_cmd_t memc_cmd) -{ - ngx_uint_t i; - ngx_http_memc_cmd_t *value; - - if (mlcf->cmds_allowed == NULL || mlcf->cmds_allowed->nelts == 0) { - /* by default, all the memcached commands supported are allowed. */ - return 1; - } - - value = mlcf->cmds_allowed->elts; - - for (i = 0; i < mlcf->cmds_allowed->nelts; i++) { - if (memc_cmd == value[i]) { - return 1; - } - } - - return 0; -} - - -static ngx_flag_t -ngx_http_memc_valid_uint32_str(u_char *data, size_t len) -{ - u_char *p, *last; - - if (len > NGX_UINT32_LEN) { - return 0; - } - - last = data + len; - for (p = data; p != last; p++) { - if (*p < '0' || *p > '9') { - return 0; - } - } - - return 1; -} - - -static ngx_flag_t -ngx_http_memc_valid_uint64_str(u_char *data, size_t len) -{ - u_char *p, *last; - - if (len > NGX_UINT64_LEN) { - return 0; - } - - last = data + len; - for (p = data; p != last; p++) { - if (*p < '0' || *p > '9') { - return 0; - } - } - - return 1; -} - - -ngx_int_t -ngx_http_memc_init(ngx_conf_t *cf) -{ - ngx_http_memc_main_conf_t *mmcf; - - mmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_memc_module); - - if (!mmcf->module_used) { - return NGX_OK; - } - - mmcf->key_index = ngx_http_memc_add_variable(cf, &ngx_http_memc_key); - if (mmcf->key_index == NGX_ERROR) { - return NGX_ERROR; - } - - mmcf->cmd_index = ngx_http_memc_add_variable(cf, &ngx_http_memc_cmd); - if (mmcf->cmd_index == NGX_ERROR) { - return NGX_ERROR; - } - - mmcf->flags_index = ngx_http_memc_add_variable(cf, &ngx_http_memc_flags); - if (mmcf->flags_index == NGX_ERROR) { - return NGX_ERROR; - } - - mmcf->exptime_index = ngx_http_memc_add_variable(cf, - &ngx_http_memc_exptime); - if (mmcf->exptime_index == NGX_ERROR) { - return NGX_ERROR; - } - - mmcf->value_index = ngx_http_memc_add_variable(cf, &ngx_http_memc_value); - if (mmcf->value_index == NGX_ERROR) { - return NGX_ERROR; - } - - return ngx_http_memc_add_more_variables(cf); -} - - -static ngx_int_t -ngx_http_memc_add_variable(ngx_conf_t *cf, ngx_str_t *name) -{ - ngx_http_variable_t *v; - - v = ngx_http_add_variable(cf, name, NGX_HTTP_VAR_CHANGEABLE); - if (v == NULL) { - return NGX_ERROR; - } - - v->get_handler = ngx_http_memc_variable_not_found; - return ngx_http_get_variable_index(cf, name); -} - - -static ngx_int_t -ngx_http_memc_variable_not_found(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - v->not_found = 1; - return NGX_OK; -} - - -static ngx_int_t -ngx_http_memc_add_more_variables(ngx_conf_t *cf) -{ - ngx_http_variable_t *var, *v; - for (v = ngx_http_memc_variables; v->name.len; v++) { - var = ngx_http_add_variable(cf, &v->name, v->flags); - if (var == NULL) { - return NGX_ERROR; - } - var->get_handler = v->get_handler; - var->data = v->data; - } - return NGX_OK; -} - - -static ngx_int_t -ngx_http_memc_flags_as_http_time_variable( - ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) -{ - u_char *p; - size_t len; - time_t flags_time = 0; - ngx_http_memc_ctx_t *ctx; - - ngx_http_variable_value_t *flags_vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - flags_vv = ctx->memc_flags_vv; - if (flags_vv == NULL) { - goto not_found; - } - - if (flags_vv->not_found || flags_vv->len == 0) { - goto not_found; - } - - flags_time = ngx_atotm(flags_vv->data, flags_vv->len); - if (flags_time == NGX_ERROR) { - return NGX_ERROR; - } - - len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1; - - p = ngx_pnalloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_http_time(p, flags_time); - - v->len = len; - v->data = p; - - v->valid = 1; - v->not_found = 0; - v->no_cacheable = 0; - - return NGX_OK; - -not_found: - - v->len = 0; - v->data = NULL; - v->valid = 1; - v->not_found = 1; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.h deleted file mode 100644 index cd63c4c..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef NGX_HTTP_MEMC_HANDLER_H -#define NGX_HTTP_MEMC_HANDLER_H - -#include -#include - - -ngx_int_t ngx_http_memc_handler(ngx_http_request_t *r); -ngx_int_t ngx_http_memc_init(ngx_conf_t *cf); - - -#endif /* NGX_HTTP_MEMC_HANDLER_H */ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.c deleted file mode 100644 index 5b534d2..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.c +++ /dev/null @@ -1,404 +0,0 @@ - -/* - * Copyright (C) Igor Sysoev - * Copyright (C) Zhang "agentzh" Yichun - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif - -#include "ddebug.h" -#include "ngx_http_memc_module.h" -#include "ngx_http_memc_handler.h" -#include "ngx_http_memc_util.h" - -#include -#include -#include -#include - - -static void *ngx_http_memc_create_loc_conf(ngx_conf_t *cf); -static char *ngx_http_memc_merge_loc_conf(ngx_conf_t *cf, void *parent, - void *child); -static char *ngx_http_memc_cmds_allowed(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_memc_pass(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_memc_upstream_max_fails_unsupported(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_memc_upstream_fail_timeout_unsupported(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static void *ngx_http_memc_create_main_conf(ngx_conf_t *cf); - - -static ngx_conf_bitmask_t ngx_http_memc_next_upstream_masks[] = { - { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR }, - { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT }, - { ngx_string("invalid_response"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER }, - { ngx_string("not_found"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, - { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, - { ngx_null_string, 0 } -}; - - -static ngx_command_t ngx_http_memc_commands[] = { - - { ngx_string("memc_cmds_allowed"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF - |NGX_HTTP_LIF_CONF|NGX_CONF_1MORE, - ngx_http_memc_cmds_allowed, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL }, - - { ngx_string("memc_pass"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_memc_pass, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL }, - - { ngx_string("memc_connect_timeout"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_msec_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.connect_timeout), - NULL }, - - { ngx_string("memc_send_timeout"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_msec_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.send_timeout), - NULL }, - - { ngx_string("memc_read_timeout"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_msec_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.read_timeout), - NULL }, - - { ngx_string("memc_buffer_size"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_size_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.buffer_size), - NULL }, - - { ngx_string("memc_next_upstream"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_conf_set_bitmask_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.next_upstream), - &ngx_http_memc_next_upstream_masks }, - - { ngx_string("memc_upstream_max_fails"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_http_memc_upstream_max_fails_unsupported, - 0, - 0, - NULL }, - - { ngx_string("memc_upstream_fail_timeout"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_http_memc_upstream_fail_timeout_unsupported, - 0, - 0, - NULL }, - - { ngx_string("memc_flags_to_last_modified"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, flags_to_last_modified), - NULL }, - - { ngx_string("memc_ignore_client_abort"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.ignore_client_abort), - NULL }, - - ngx_null_command -}; - - -static ngx_http_module_t ngx_http_memc_module_ctx = { - NULL, /* preconfiguration */ - ngx_http_memc_init, /* postconfiguration */ - - ngx_http_memc_create_main_conf, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_memc_create_loc_conf, /* create location configration */ - ngx_http_memc_merge_loc_conf /* merge location configration */ -}; - - -ngx_module_t ngx_http_memc_module = { - NGX_MODULE_V1, - &ngx_http_memc_module_ctx, /* module context */ - ngx_http_memc_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static void * -ngx_http_memc_create_loc_conf(ngx_conf_t *cf) -{ - ngx_http_memc_loc_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_memc_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* - * set by ngx_pcalloc(): - * - * conf->cmds_allowed = NULL; - * conf->upstream.bufs.num = 0; - * conf->upstream.next_upstream = 0; - * conf->upstream.temp_path = NULL; - * conf->upstream.uri = { 0, NULL }; - * conf->upstream.location = NULL; - */ - - conf->flags_to_last_modified = NGX_CONF_UNSET; - - conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC; - conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC; - conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC; - - conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE; - - conf->upstream.ignore_client_abort = NGX_CONF_UNSET; - - /* the hardcoded values */ - conf->upstream.cyclic_temp_file = 0; - conf->upstream.buffering = 0; - conf->upstream.send_lowat = 0; - conf->upstream.bufs.num = 0; - conf->upstream.busy_buffers_size = 0; - conf->upstream.max_temp_file_size = 0; - conf->upstream.temp_file_write_size = 0; - conf->upstream.intercept_errors = 1; - conf->upstream.intercept_404 = 1; - conf->upstream.pass_request_headers = 0; - conf->upstream.pass_request_body = 0; - - return conf; -} - - -static char * -ngx_http_memc_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) -{ - ngx_http_memc_loc_conf_t *prev = parent; - ngx_http_memc_loc_conf_t *conf = child; - - ngx_conf_merge_value(conf->flags_to_last_modified, - prev->flags_to_last_modified, 0); - - ngx_conf_merge_msec_value(conf->upstream.connect_timeout, - prev->upstream.connect_timeout, 60000); - - ngx_conf_merge_msec_value(conf->upstream.send_timeout, - prev->upstream.send_timeout, 60000); - - ngx_conf_merge_msec_value(conf->upstream.read_timeout, - prev->upstream.read_timeout, 60000); - - ngx_conf_merge_size_value(conf->upstream.buffer_size, - prev->upstream.buffer_size, - (size_t) ngx_pagesize); - - ngx_conf_merge_bitmask_value(conf->upstream.next_upstream, - prev->upstream.next_upstream, - (NGX_CONF_BITMASK_SET - |NGX_HTTP_UPSTREAM_FT_ERROR - |NGX_HTTP_UPSTREAM_FT_TIMEOUT)); - - if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) { - conf->upstream.next_upstream = NGX_CONF_BITMASK_SET - |NGX_HTTP_UPSTREAM_FT_OFF; - } - - if (conf->upstream.upstream == NULL) { - conf->upstream.upstream = prev->upstream.upstream; - } - - if (conf->cmds_allowed == NULL) { - conf->cmds_allowed = prev->cmds_allowed; - } - - ngx_conf_merge_value(conf->upstream.ignore_client_abort, - prev->upstream.ignore_client_abort, 0); - - return NGX_CONF_OK; -} - - -static char * -ngx_http_memc_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_memc_loc_conf_t *mlcf = conf; - ngx_http_memc_main_conf_t *mmcf; - - ngx_str_t *value; - ngx_url_t url; - ngx_http_core_loc_conf_t *clcf; - ngx_uint_t n; - - ngx_http_compile_complex_value_t ccv; - - if (mlcf->upstream.upstream) { - return "is duplicate"; - } - - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - clcf->handler = ngx_http_memc_handler; - - if (clcf->name.data[clcf->name.len - 1] == '/') { - clcf->auto_redirect = 1; - } - - mmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_memc_module); - mmcf->module_used = 1; - - value = cf->args->elts; - - n = ngx_http_script_variables_count(&value[1]); - if (n) { - mlcf->complex_target = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (mlcf->complex_target == NULL) { - return NGX_CONF_ERROR; - } - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = mlcf->complex_target; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; - } - - mlcf->complex_target = NULL; - - ngx_memzero(&url, sizeof(ngx_url_t)); - - url.url = value[1]; - url.no_resolve = 1; - - mlcf->upstream.upstream = ngx_http_upstream_add(cf, &url, 0); - if (mlcf->upstream.upstream == NULL) { - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - - -static char * -ngx_http_memc_upstream_max_fails_unsupported(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "\"memc_upstream_max_fails\" is not supported, " - "use the \"max_fails\" parameter of the \"server\" " - "directive inside the \"upstream\" block"); - - return NGX_CONF_ERROR; -} - - -static char * -ngx_http_memc_upstream_fail_timeout_unsupported(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "\"memc_upstream_fail_timeout\" is not supported, " - "use the \"fail_timeout\" parameter of the \"server\" " - "directive inside the \"upstream\" block"); - - return NGX_CONF_ERROR; -} - -static char * -ngx_http_memc_cmds_allowed(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_memc_loc_conf_t *mlcf = conf; - - ngx_uint_t i; - ngx_str_t *value; - ngx_http_memc_cmd_t memc_cmd; - ngx_http_memc_cmd_t *c; - ngx_flag_t is_storage_cmd; - - value = cf->args->elts; - - mlcf->cmds_allowed = ngx_array_create(cf->pool, cf->args->nelts - 1, - sizeof(ngx_http_memc_cmd_t)); - - if (mlcf->cmds_allowed == NULL) { - return NGX_CONF_ERROR; - } - - for (i = 1; i < cf->args->nelts; i++) { - memc_cmd = ngx_http_memc_parse_cmd(value[i].data, value[i].len, - &is_storage_cmd); - - if (memc_cmd == ngx_http_memc_cmd_unknown) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "Unknown memcached command \"%V\" used in " - "\"memc_cmds_allowed\"", &value[i]); - - return NGX_CONF_ERROR; - } - - c = ngx_array_push(mlcf->cmds_allowed); - if (c == NULL) { - return NGX_CONF_ERROR; - } - - *c = memc_cmd; - } - - return NGX_CONF_OK; -} - - -static void * -ngx_http_memc_create_main_conf(ngx_conf_t *cf) -{ - ngx_http_memc_main_conf_t *mmcf; - - mmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_memc_main_conf_t)); - if (mmcf == NULL) { - return NULL; - } - - return mmcf; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.h deleted file mode 100644 index bea4578..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.h +++ /dev/null @@ -1,98 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_MEMC_MODULE_H -#define NGX_HTTP_MEMC_MODULE_H - - -#include -#include -#include - - -typedef enum { - ngx_http_memc_cmd_set, - ngx_http_memc_cmd_add, - ngx_http_memc_cmd_replace, - ngx_http_memc_cmd_append, - ngx_http_memc_cmd_prepend, - /* ngx_http_memc_cmd_cas, */ - - ngx_http_memc_cmd_get, - /* ngx_http_memc_cmd_gets, */ - - ngx_http_memc_cmd_delete, - - ngx_http_memc_cmd_incr, - ngx_http_memc_cmd_decr, - - ngx_http_memc_cmd_stats, - - ngx_http_memc_cmd_flush_all, - ngx_http_memc_cmd_version, - /* ngx_http_memc_cmd_verbosity, */ - - /* we do not want to support the "quit" command here */ - /* ngx_http_memc_cmd_quit, */ - - ngx_http_memc_cmd_unknown -} ngx_http_memc_cmd_t; - - -typedef struct { - ngx_flag_t flags_to_last_modified; - ngx_http_upstream_conf_t upstream; - ngx_array_t *cmds_allowed; - ngx_http_complex_value_t *complex_target; - -} ngx_http_memc_loc_conf_t; - - -typedef struct { - ngx_int_t key_index; - ngx_int_t cmd_index; - ngx_int_t value_index; - ngx_int_t flags_index; - ngx_int_t exptime_index; - ngx_int_t module_used; -} ngx_http_memc_main_conf_t; - - -typedef struct { -#if defined(nginx_version) && nginx_version >= 1001004 - off_t rest; -#else - size_t rest; -#endif - - ngx_http_request_t *request; - ngx_str_t key; - - ngx_str_t cmd_str; - ngx_http_memc_cmd_t cmd; - - ngx_http_variable_value_t *memc_value_vv; - ngx_http_variable_value_t *memc_key_vv; - ngx_http_variable_value_t *memc_flags_vv; - ngx_http_variable_value_t *memc_exptime_vv; - - ngx_flag_t is_storage_cmd; - - int parser_state; - - /* just for the subrequests in memory support */ - size_t body_length; - -} ngx_http_memc_ctx_t; - - -extern ngx_module_t ngx_http_memc_module; - - -#define NGX_HTTP_MEMC_END (sizeof(CRLF "END" CRLF) - 1) - - -#endif /* NGX_HTTP_MEMC_MODULE_H */ diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.c deleted file mode 100644 index 482a001..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.c +++ /dev/null @@ -1,571 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_memc_request.h" -#include "ngx_http_memc_module.h" -#include "ngx_http_memc_util.h" - - -ngx_int_t -ngx_http_memc_create_storage_cmd_request(ngx_http_request_t *r) -{ - size_t len; - off_t bytes; - size_t bytes_len; - uintptr_t escape; - ngx_buf_t *b; - ngx_chain_t *cl, *in; - ngx_chain_t **ll; - ngx_http_memc_ctx_t *ctx; - - ngx_http_variable_value_t *key_vv; - ngx_http_variable_value_t *flags_vv; - ngx_http_variable_value_t *exptime_vv; - ngx_http_variable_value_t *memc_value_vv; - - u_char bytes_buf[NGX_UINT32_LEN]; - - /* TODO add support for the "cas" command */ - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - /* prepare the "key" argument */ - - key_vv = ctx->memc_key_vv; - - if (key_vv == NULL || key_vv->not_found || key_vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_key\" variable is not set"); - return NGX_ERROR; - } - - escape = 2 * ngx_escape_uri(NULL, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - - /* prepare the "bytes" argument */ - - if (ctx->memc_value_vv && !ctx->memc_value_vv->not_found) { - dd("found variable $memc_value"); - - memc_value_vv = ctx->memc_value_vv; - - bytes = memc_value_vv->len; - - } else if (r->request_body == NULL || r->request_body->bufs == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "neither the \"$memc_value\" variable " - "nor the request body is available"); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - - } else { - memc_value_vv = NULL; - - bytes = 0; - for (cl = r->request_body->bufs; cl; cl = cl->next) { - bytes += ngx_buf_size(cl->buf); - } - } - - bytes_len = ngx_snprintf(bytes_buf, sizeof(bytes_buf), "%O", bytes) - - bytes_buf; - - /* prepare the "flags" argument */ - - flags_vv = ctx->memc_flags_vv; - - if (flags_vv == NULL) { - return NGX_ERROR; - } - - if (flags_vv->not_found) { - flags_vv->not_found = 0; - flags_vv->valid = 1; - flags_vv->no_cacheable = 0; - flags_vv->len = sizeof("0") - 1; - flags_vv->data = (u_char *) "0"; - } else if (flags_vv->len == 0) { - flags_vv->len = sizeof("0") - 1; - flags_vv->data = (u_char *) "0"; - } - - /* prepare the "exptime" argument */ - - exptime_vv = ctx->memc_exptime_vv; - - if (exptime_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (exptime_vv->not_found || exptime_vv->len == 0) { - dd("setting exptime to its default value 0..."); - - exptime_vv->not_found = 0; - exptime_vv->valid = 1; - exptime_vv->no_cacheable = 0; - exptime_vv->len = sizeof("0") - 1; - exptime_vv->data = (u_char *) "0"; - } - - /* calculate the total length of the command */ - - len = ctx->cmd_str.len + sizeof(" ") - 1 - + key_vv->len + escape + sizeof(" ") - 1 - + flags_vv->len + sizeof(" ") - 1 - + exptime_vv->len + sizeof(" ") - 1 - + bytes_len - + sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - ll = &cl->next; - - r->upstream->request_bufs = cl; - - /* copy the memcached command over */ - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - *b->last++ = ' '; - - /* copy the memcached key over */ - - ctx->key.data = b->last; - - if (escape == 0) { - b->last = ngx_copy(b->last, key_vv->data, key_vv->len); - - } else { - b->last = (u_char *) ngx_escape_uri(b->last, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - } - - ctx->key.len = b->last - ctx->key.data; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http memcached request: \"%V\"", &ctx->key); - - *b->last++ = ' '; - - /* copy the memcached flags over */ - - b->last = ngx_copy(b->last, flags_vv->data, flags_vv->len); - - *b->last++ = ' '; - - /* copy the memcached exptime over */ - - b->last = ngx_copy(b->last, exptime_vv->data, exptime_vv->len); - - *b->last++ = ' '; - - /* copy the memcached bytes over */ - - b->last = ngx_copy(b->last, bytes_buf, bytes_len); - - *b->last++ = CR; *b->last++ = LF; - - if (memc_value_vv) { - if (memc_value_vv->len) { - dd("copy $memc_value to the request"); - b = ngx_calloc_buf(r->pool); - - if (b == NULL) { - return NGX_ERROR; - } - - b->memory = 1; - - b->start = b->pos = memc_value_vv->data; - b->last = b->end = b->start + memc_value_vv->len; - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - *ll = cl; - ll = &cl->next; - } - - } else { - /* to preserve the r->request_body->bufs untouched */ - - in = r->request_body->bufs; - - while (in) { - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = ngx_calloc_buf(r->pool); - if (cl->buf == NULL) { - return NGX_ERROR; - } - - cl->buf->memory = 1; - *cl->buf = *in->buf; - - *ll = cl; - ll = &cl->next; - in = in->next; - } - } - - /* append the trailing CRLF */ - - b = ngx_calloc_buf(r->pool); - - if (b == NULL) { - return NGX_ERROR; - } - - b->start = b->pos = (u_char *) CRLF; - b->last = b->end = b->start + sizeof(CRLF) - 1; - - b->memory = 1; - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - *ll = cl; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_create_get_cmd_request(ngx_http_request_t *r) -{ - size_t len; - uintptr_t escape; - ngx_buf_t *b; - ngx_chain_t *cl; - ngx_http_memc_ctx_t *ctx; - ngx_http_variable_value_t *vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - vv = ctx->memc_key_vv; - - if (vv == NULL || vv->not_found || vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_key\" variable is not set"); - return NGX_ERROR; - } - - escape = 2 * ngx_escape_uri(NULL, vv->data, vv->len, NGX_ESCAPE_MEMCACHED); - - len = sizeof("get ") - 1 + vv->len + escape + sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - *b->last++ = 'g'; *b->last++ = 'e'; *b->last++ = 't'; *b->last++ = ' '; - - ctx->key.data = b->last; - - if (escape == 0) { - b->last = ngx_copy(b->last, vv->data, vv->len); - - } else { - b->last = (u_char *) ngx_escape_uri(b->last, vv->data, vv->len, - NGX_ESCAPE_MEMCACHED); - } - - ctx->key.len = b->last - ctx->key.data; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http memcached request: \"%V\"", &ctx->key); - - *b->last++ = CR; *b->last++ = LF; - - ctx->parser_state = NGX_ERROR; - - return NGX_OK; -} - -ngx_int_t -ngx_http_memc_create_noarg_cmd_request(ngx_http_request_t *r) -{ - size_t len; - ngx_buf_t *b; - ngx_http_memc_ctx_t *ctx; - ngx_chain_t *cl; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - len = ctx->cmd_str.len + sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - *b->last++ = CR; *b->last++ = LF; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_create_flush_all_cmd_request(ngx_http_request_t *r) -{ - size_t len; - ngx_buf_t *b; - ngx_http_memc_ctx_t *ctx; - ngx_chain_t *cl; - ngx_http_variable_value_t *exptime_vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - /* prepare the (optional) "exptime" argument */ - - exptime_vv = ctx->memc_exptime_vv; - - if (exptime_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - len = ctx->cmd_str.len; - - if (!exptime_vv->not_found && exptime_vv->len) { - dd("found exptime: %s", exptime_vv->data); - - len += sizeof(" ") - 1 + exptime_vv->len; - } - - len += sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - if (!exptime_vv->not_found && exptime_vv->len) { - *b->last++ = ' '; - b->last = ngx_copy(b->last, exptime_vv->data, exptime_vv->len); - } - - *b->last++ = CR; *b->last++ = LF; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_create_delete_cmd_request(ngx_http_request_t *r) -{ - size_t len; - ngx_buf_t *b; - ngx_http_memc_ctx_t *ctx; - ngx_chain_t *cl; - uintptr_t escape; - ngx_http_variable_value_t *key_vv; - ngx_http_variable_value_t *exptime_vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - /* prepare the "key" argument */ - - key_vv = ctx->memc_key_vv; - - if (key_vv == NULL || key_vv->not_found || key_vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_key\" variable is not set"); - return NGX_ERROR; - } - - escape = 2 * ngx_escape_uri(NULL, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - - /* prepare the (optional) "exptime" argument */ - - exptime_vv = ctx->memc_exptime_vv; - - if (exptime_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - len = ctx->cmd_str.len + sizeof(" ") - 1 + key_vv->len + escape; - - if (!exptime_vv->not_found && exptime_vv->len) { - dd("found exptime: %s", exptime_vv->data); - - len += sizeof(" ") - 1 + exptime_vv->len; - } - - len += sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - *b->last++ = ' '; - - if (escape == 0) { - b->last = ngx_copy(b->last, key_vv->data, key_vv->len); - - } else { - b->last = (u_char *) ngx_escape_uri(b->last, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - } - - if (!exptime_vv->not_found && exptime_vv->len) { - *b->last++ = ' '; - b->last = ngx_copy(b->last, exptime_vv->data, exptime_vv->len); - } - - *b->last++ = CR; *b->last++ = LF; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_create_incr_decr_cmd_request(ngx_http_request_t *r) -{ - size_t len; - ngx_buf_t *b; - ngx_http_memc_ctx_t *ctx; - ngx_chain_t *cl; - uintptr_t escape; - ngx_http_variable_value_t *key_vv; - ngx_http_variable_value_t *value_vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - /* prepare the "key" argument */ - - key_vv = ctx->memc_key_vv; - - if (key_vv == NULL || key_vv->not_found || key_vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_key\" variable is not set"); - return NGX_ERROR; - } - - escape = 2 * ngx_escape_uri(NULL, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - - /* prepare the "value" argument */ - - value_vv = ctx->memc_value_vv; - - /* XXX validate if $memc_value_vv is a valid uint64 string */ - - len = ctx->cmd_str.len + sizeof(" ") - 1 + key_vv->len + escape - + sizeof(" ") - 1 + value_vv->len + sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - *b->last++ = ' '; - - if (escape == 0) { - b->last = ngx_copy(b->last, key_vv->data, key_vv->len); - - } else { - b->last = (u_char *) ngx_escape_uri(b->last, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - } - - *b->last++ = ' '; - - b->last = ngx_copy(b->last, value_vv->data, value_vv->len); - - *b->last++ = CR; *b->last++ = LF; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.h deleted file mode 100644 index 10e74c6..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.h +++ /dev/null @@ -1,27 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_MEMC_REQUEST_H -#define NGX_HTTP_MEMC_REQUEST_H - -#include -#include - -ngx_int_t ngx_http_memc_create_get_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_storage_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_noarg_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_flush_all_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_delete_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_incr_decr_cmd_request(ngx_http_request_t *r); - - -#endif /* NGX_HTTP_MEMC_REQUEST_H */ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.c deleted file mode 100644 index 5f702e7..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.c +++ /dev/null @@ -1,1914 +0,0 @@ - -#line 1 "src/ngx_http_memc_response.rl" - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_memc_response.h" -#include "ngx_http_memc_module.h" - - -#ifdef s_char -#undef s_char -#endif - -#define s_char signed char - - - -#line 24 "src/ngx_http_memc_response.rl" - -#line 29 "src/ngx_http_memc_response.c" -static const char _memc_storage_key_offsets[] = { - 0, 0, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, - 19, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60 -}; - -static const char _memc_storage_trans_keys[] = { - 67, 69, 78, 83, 76, 73, 69, 78, - 84, 95, 69, 82, 82, 79, 82, 32, - 13, 10, 13, 82, 88, 82, 79, 82, - 13, 10, 73, 83, 84, 83, 13, 10, - 79, 84, 95, 70, 83, 79, 85, 78, - 68, 13, 10, 84, 79, 82, 69, 68, - 69, 84, 82, 86, 69, 82, 79, 82, - 69, 68, 13, 10, 0 -}; - -static const char _memc_storage_single_lengths[] = { - 0, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0 -}; - -static const char _memc_storage_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}; - -static const unsigned char _memc_storage_index_offsets[] = { - 0, 0, 5, 7, 9, 11, 13, 15, - 17, 19, 21, 23, 25, 27, 29, 31, - 34, 37, 39, 41, 43, 45, 47, 49, - 51, 53, 55, 57, 59, 61, 63, 65, - 68, 70, 72, 74, 76, 78, 80, 82, - 84, 86, 88, 90, 93, 95, 97, 99, - 101, 103, 105, 107, 109, 111, 113 -}; - -static const char _memc_storage_trans_targs[] = { - 2, 16, 28, 43, 0, 3, 0, 4, - 0, 5, 0, 6, 0, 7, 0, 8, - 0, 9, 0, 10, 0, 11, 0, 12, - 0, 13, 0, 14, 0, 15, 14, 54, - 15, 14, 17, 22, 0, 18, 0, 19, - 0, 20, 0, 21, 0, 54, 0, 23, - 0, 24, 0, 25, 0, 26, 0, 27, - 0, 54, 0, 29, 0, 30, 0, 31, - 0, 32, 38, 0, 33, 0, 34, 0, - 35, 0, 36, 0, 37, 0, 54, 0, - 39, 0, 40, 0, 41, 0, 42, 0, - 26, 0, 44, 48, 0, 45, 0, 46, - 0, 47, 0, 7, 0, 49, 0, 50, - 0, 51, 0, 52, 0, 53, 0, 54, - 0, 0, 0 -}; - -static const char _memc_storage_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0 -}; - -static const int memc_storage_start = 1; -static const int memc_storage_first_final = 54; -static const int memc_storage_error = 0; - - - -#line 25 "src/ngx_http_memc_response.rl" - - -#line 27 "src/ngx_http_memc_response.rl" - -#line 129 "src/ngx_http_memc_response.c" -static const char _memc_flush_all_key_offsets[] = { - 0, 0, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, - 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33 -}; - -static const short _memc_flush_all_trans_keys[] = { - 67, 69, 79, 83, 76, 73, 69, 78, - 84, 95, 69, 82, 82, 79, 82, 32, - 13, 10, 13, 82, 82, 79, 82, 13, - 10, 75, 13, 10, 69, 82, 86, 69, - 82, 0 -}; - -static const char _memc_flush_all_single_lengths[] = { - 0, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0 -}; - -static const char _memc_flush_all_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}; - -static const char _memc_flush_all_index_offsets[] = { - 0, 0, 5, 7, 9, 11, 13, 15, - 17, 19, 21, 23, 25, 27, 29, 31, - 34, 36, 38, 40, 42, 44, 46, 48, - 50, 52, 54, 56, 58, 60, 62 -}; - -static const char _memc_flush_all_indicies[] = { - 0, 2, 3, 4, 1, 5, 1, 6, - 1, 7, 1, 8, 1, 9, 1, 10, - 1, 11, 1, 12, 1, 13, 1, 14, - 1, 15, 1, 16, 1, 17, 16, 18, - 17, 16, 19, 1, 20, 1, 21, 1, - 22, 1, 23, 1, 18, 1, 24, 1, - 25, 1, 26, 1, 27, 1, 28, 1, - 29, 1, 30, 1, 9, 1, 1, 0 -}; - -static const char _memc_flush_all_trans_targs[] = { - 2, 0, 16, 22, 25, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 30, 17, 18, 19, 20, 21, - 23, 24, 30, 26, 27, 28, 29 -}; - -static const char _memc_flush_all_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 0 -}; - -static const int memc_flush_all_start = 1; -static const int memc_flush_all_first_final = 30; -static const int memc_flush_all_error = 0; - - - -#line 28 "src/ngx_http_memc_response.rl" - - -#line 30 "src/ngx_http_memc_response.rl" - -#line 203 "src/ngx_http_memc_response.c" -static const char _memc_version_key_offsets[] = { - 0, 0, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, - 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 41, 43, 43, - 43 -}; - -static const short _memc_version_trans_keys[] = { - 67, 69, 83, 86, 76, 73, 69, 78, - 84, 95, 69, 82, 82, 79, 82, 32, - 13, 10, 13, 82, 82, 79, 82, 13, - 10, 69, 82, 86, 69, 82, 69, 82, - 83, 73, 79, 78, 32, 13, 13, 10, - 13, 10, 13, 13, 0 -}; - -static const char _memc_version_single_lengths[] = { - 0, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 0, 0, - 1 -}; - -static const char _memc_version_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0 -}; - -static const char _memc_version_index_offsets[] = { - 0, 0, 5, 7, 9, 11, 13, 15, - 17, 19, 21, 23, 25, 27, 29, 31, - 34, 36, 38, 40, 42, 44, 46, 48, - 50, 52, 54, 56, 58, 60, 62, 64, - 66, 68, 70, 72, 74, 77, 80, 81, - 82 -}; - -static const char _memc_version_indicies[] = { - 0, 2, 3, 4, 1, 5, 1, 6, - 1, 7, 1, 8, 1, 9, 1, 10, - 1, 11, 1, 12, 1, 13, 1, 14, - 1, 15, 1, 16, 1, 17, 16, 18, - 17, 16, 19, 1, 20, 1, 21, 1, - 22, 1, 23, 1, 18, 1, 24, 1, - 25, 1, 26, 1, 27, 1, 9, 1, - 28, 1, 29, 1, 30, 1, 31, 1, - 32, 1, 33, 1, 34, 1, 36, 35, - 37, 35, 38, 37, 35, 39, 37, 35, - 35, 1, 37, 35, 0 -}; - -static const char _memc_version_trans_targs[] = { - 2, 0, 16, 22, 27, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 39, 17, 18, 19, 20, 21, - 23, 24, 25, 26, 28, 29, 30, 31, - 32, 33, 34, 35, 37, 36, 40, 38 -}; - -static const char _memc_version_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 0 -}; - -static const int memc_version_start = 1; -static const int memc_version_first_final = 39; -static const int memc_version_error = 0; - - - -#line 31 "src/ngx_http_memc_response.rl" - - -#line 33 "src/ngx_http_memc_response.rl" - -#line 291 "src/ngx_http_memc_response.c" -static const char _memc_stats_key_offsets[] = { - 0, 0, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, - 18, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 41, 43, 45, 47, - 48, 50, 52, 52, 52 -}; - -static const short _memc_stats_trans_keys[] = { - 67, 69, 83, 76, 73, 69, 78, 84, - 95, 69, 82, 82, 79, 82, 32, 13, - 10, 13, 78, 82, 68, 13, 10, 82, - 79, 82, 13, 10, 69, 84, 82, 86, - 69, 82, 65, 84, 32, 13, 13, 10, - 13, 13, 69, 13, 78, 13, 68, 13, - 10, 13, 10, 13, 13, 69, 0 -}; - -static const char _memc_stats_single_lengths[] = { - 0, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 2, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 1, - 2, 2, 0, 0, 2 -}; - -static const char _memc_stats_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 -}; - -static const unsigned char _memc_stats_index_offsets[] = { - 0, 0, 4, 6, 8, 10, 12, 14, - 16, 18, 20, 22, 24, 26, 28, 30, - 33, 36, 38, 40, 42, 44, 46, 48, - 50, 52, 55, 57, 59, 61, 63, 65, - 67, 69, 71, 73, 76, 79, 82, 85, - 87, 90, 93, 94, 95 -}; - -static const char _memc_stats_indicies[] = { - 0, 2, 3, 1, 4, 1, 5, 1, - 6, 1, 7, 1, 8, 1, 9, 1, - 10, 1, 11, 1, 12, 1, 13, 1, - 14, 1, 15, 1, 16, 15, 17, 16, - 15, 18, 19, 1, 20, 1, 21, 1, - 22, 1, 23, 1, 24, 1, 25, 1, - 26, 1, 17, 1, 27, 28, 1, 29, - 1, 30, 1, 31, 1, 8, 1, 32, - 1, 33, 1, 34, 1, 36, 35, 37, - 35, 38, 37, 35, 37, 39, 35, 37, - 40, 35, 37, 41, 35, 42, 35, 43, - 37, 35, 44, 37, 35, 35, 1, 37, - 39, 35, 0 -}; - -static const char _memc_stats_trans_targs[] = { - 2, 0, 16, 25, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 15, 43, 17, 20, 18, 19, 43, 21, - 22, 23, 24, 26, 30, 27, 28, 29, - 31, 32, 33, 34, 41, 35, 36, 37, - 38, 39, 40, 44, 42 -}; - -static const char _memc_stats_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0 -}; - -static const int memc_stats_start = 1; -static const int memc_stats_first_final = 43; -static const int memc_stats_error = 0; - - - -#line 34 "src/ngx_http_memc_response.rl" - - -#line 36 "src/ngx_http_memc_response.rl" - -#line 384 "src/ngx_http_memc_response.c" -static const char _memc_delete_key_offsets[] = { - 0, 0, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49 -}; - -static const short _memc_delete_trans_keys[] = { - 67, 68, 69, 78, 83, 76, 73, 69, - 78, 84, 95, 69, 82, 82, 79, 82, - 32, 13, 10, 13, 69, 76, 69, 84, - 69, 68, 13, 10, 82, 82, 79, 82, - 13, 10, 79, 84, 95, 70, 79, 85, - 78, 68, 13, 10, 69, 82, 86, 69, - 82, 0 -}; - -static const char _memc_delete_single_lengths[] = { - 0, 5, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0 -}; - -static const char _memc_delete_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 -}; - -static const unsigned char _memc_delete_index_offsets[] = { - 0, 0, 6, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 26, 28, 30, 32, - 35, 37, 39, 41, 43, 45, 47, 49, - 51, 53, 55, 57, 59, 61, 63, 65, - 67, 69, 71, 73, 75, 77, 79, 81, - 83, 85, 87, 89, 91, 93 -}; - -static const char _memc_delete_trans_targs[] = { - 2, 16, 24, 30, 40, 0, 3, 0, - 4, 0, 5, 0, 6, 0, 7, 0, - 8, 0, 9, 0, 10, 0, 11, 0, - 12, 0, 13, 0, 14, 0, 15, 14, - 45, 15, 14, 17, 0, 18, 0, 19, - 0, 20, 0, 21, 0, 22, 0, 23, - 0, 45, 0, 25, 0, 26, 0, 27, - 0, 28, 0, 29, 0, 45, 0, 31, - 0, 32, 0, 33, 0, 34, 0, 35, - 0, 36, 0, 37, 0, 38, 0, 39, - 0, 45, 0, 41, 0, 42, 0, 43, - 0, 44, 0, 7, 0, 0, 0 -}; - -static const char _memc_delete_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}; - -static const int memc_delete_start = 1; -static const int memc_delete_first_final = 45; -static const int memc_delete_error = 0; - - - -#line 37 "src/ngx_http_memc_response.rl" - - -#line 39 "src/ngx_http_memc_response.rl" - -#line 473 "src/ngx_http_memc_response.c" -static const char _memc_incr_decr_key_offsets[] = { - 0, 0, 6, 10, 11, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, - 49 -}; - -static const short _memc_incr_decr_trans_keys[] = { - 67, 69, 78, 83, 48, 57, 13, 32, - 48, 57, 10, 13, 32, 76, 73, 69, - 78, 84, 95, 69, 82, 82, 79, 82, - 32, 13, 10, 13, 82, 82, 79, 82, - 13, 10, 79, 84, 95, 70, 79, 85, - 78, 68, 13, 10, 69, 82, 86, 69, - 82, 0 -}; - -static const char _memc_incr_decr_single_lengths[] = { - 0, 4, 2, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 0 -}; - -static const char _memc_incr_decr_range_lengths[] = { - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0 -}; - -static const char _memc_incr_decr_index_offsets[] = { - 0, 0, 6, 10, 12, 15, 17, 19, - 21, 23, 25, 27, 29, 31, 33, 35, - 37, 39, 41, 44, 46, 48, 50, 52, - 54, 56, 58, 60, 62, 64, 66, 68, - 70, 72, 74, 76, 78, 80, 82, 84, - 86 -}; - -static const char _memc_incr_decr_indicies[] = { - 2, 3, 4, 5, 0, 1, 6, 7, - 0, 1, 8, 1, 6, 7, 1, 9, - 1, 10, 1, 11, 1, 12, 1, 13, - 1, 14, 1, 15, 1, 16, 1, 17, - 1, 18, 1, 19, 1, 20, 1, 21, - 20, 22, 21, 20, 23, 1, 24, 1, - 25, 1, 26, 1, 27, 1, 22, 1, - 28, 1, 29, 1, 30, 1, 31, 1, - 32, 1, 33, 1, 34, 1, 35, 1, - 36, 1, 37, 1, 38, 1, 39, 1, - 40, 1, 41, 1, 13, 1, 1, 0 -}; - -static const char _memc_incr_decr_trans_targs[] = { - 2, 0, 5, 19, 25, 35, 3, 4, - 40, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 40, 20, - 21, 22, 23, 24, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 40, 36, 37, - 38, 39 -}; - -static const char _memc_incr_decr_trans_actions[] = { - 1, 0, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 4, 1, 1, - 1, 1 -}; - -static const int memc_incr_decr_start = 1; -static const int memc_incr_decr_first_final = 40; -static const int memc_incr_decr_error = 0; - - - -#line 40 "src/ngx_http_memc_response.rl" - - -u_char ngx_http_memc_end[] = CRLF "END" CRLF; - - -static u_char *parse_memc_storage(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_version(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static ngx_int_t ngx_http_memc_write_simple_response(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx, - ngx_uint_t status, ngx_str_t *resp); - - -ngx_int_t -ngx_http_memc_process_simple_header(ngx_http_request_t *r) -{ - ngx_int_t rc; - int cs; - s_char *p; - s_char *pe; - s_char *orig; - ngx_str_t resp; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_uint_t status; - unsigned done = 0; - int error_state; - int final_state; - - status = NGX_HTTP_OK; - - dd("process simple cmd header"); - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - if (ctx->parser_state == NGX_ERROR) { - dd("reinit state"); - - if (ctx->is_storage_cmd) { - dd("init memc_storage machine..."); - - -#line 91 "src/ngx_http_memc_response.rl" - -#line 613 "src/ngx_http_memc_response.c" - { - cs = memc_storage_start; - } - -#line 92 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_flush_all) { - dd("init memc_flush_all machine..."); - - -#line 97 "src/ngx_http_memc_response.rl" - -#line 626 "src/ngx_http_memc_response.c" - { - cs = memc_flush_all_start; - } - -#line 98 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_version) { - dd("init memc_version machine..."); - - -#line 103 "src/ngx_http_memc_response.rl" - -#line 639 "src/ngx_http_memc_response.c" - { - cs = memc_version_start; - } - -#line 104 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_stats) { - dd("init memc_stats machine..."); - - -#line 109 "src/ngx_http_memc_response.rl" - -#line 652 "src/ngx_http_memc_response.c" - { - cs = memc_stats_start; - } - -#line 110 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_delete) { - dd("init memc_delete machine..."); - - -#line 115 "src/ngx_http_memc_response.rl" - -#line 665 "src/ngx_http_memc_response.c" - { - cs = memc_delete_start; - } - -#line 116 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_incr - || ctx->cmd == ngx_http_memc_cmd_decr) - { - dd("init memc_incr_decr machine..."); - - -#line 123 "src/ngx_http_memc_response.rl" - -#line 680 "src/ngx_http_memc_response.c" - { - cs = memc_incr_decr_start; - } - -#line 124 "src/ngx_http_memc_response.rl" - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unrecognized memcached command in " - "ngx_http_memc_process_simple_header: \"%V\"", - &ctx->cmd_str); - - return NGX_ERROR; /* this results in 500 status */ - } - - } else { - cs = ctx->parser_state; - } - - u = r->upstream; - - orig = (s_char *) u->buffer.pos; - - p = (s_char *) u->buffer.pos; - pe = (s_char *) u->buffer.last; - - dd("buffer len: %d", (int) (pe - p)); - - if (ctx->is_storage_cmd) { - error_state = memc_storage_error; - final_state = memc_storage_first_final; - - p = (s_char *) parse_memc_storage(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_flush_all) { - error_state = memc_flush_all_error; - final_state = memc_flush_all_first_final; - - p = (s_char *) parse_memc_flush_all(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_version) { - error_state = memc_version_error; - final_state = memc_version_first_final; - - p = (s_char *) parse_memc_version(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_stats) { - error_state = memc_stats_error; - final_state = memc_stats_first_final; - - p = (s_char *) parse_memc_stats(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_delete) { - error_state = memc_delete_error; - final_state = memc_delete_first_final; - - p = (s_char *) parse_memc_delete(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_incr - || ctx->cmd == ngx_http_memc_cmd_decr) - { - error_state = memc_incr_decr_error; - final_state = memc_incr_decr_first_final; - - p = (s_char *) parse_memc_incr_decr(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unrecognized memcached command in " - "ngx_http_memc_process_simple_header: \"%V\"", - &ctx->cmd_str); - - return NGX_ERROR; /* this results in 500 status */ - } - - ctx->parser_state = cs; - - resp.data = u->buffer.start; - resp.len = (u_char *) p - resp.data; - - u->buffer.pos = (u_char *) p; - - dd("machine state: %d (done: %d)", cs, done); - dd("memcached response: (len: %d) %s", (int) resp.len, resp.data); - - if (done || cs >= final_state) { - dd("memcached response parsed (resp.len: %d)", (int) resp.len); - - rc = ngx_http_memc_write_simple_response(r, u, ctx, status, &resp); - - return rc; - } - - if (cs == error_state) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid response for command \"%V\" " - "at pos %O: %V", &ctx->cmd_str, (off_t) (p - orig), &resp); - - status = NGX_HTTP_BAD_GATEWAY; - u->headers_in.status_n = status; - u->state->status = status; - - /* u->headers_in.status_n will be the final status */ - return NGX_OK; - } - - dd("we need more data to proceed (returned NGX_AGAIN)"); - - return NGX_AGAIN; -} - - -ngx_int_t -ngx_http_memc_empty_filter_init(void *data) -{ - ngx_http_memc_ctx_t *ctx = data; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - u->length = 0; - - /* to persuade ngx_http_upstream_keepalive (if any) - to cache the connection if the status is neither - 200 nor 404. */ - if (u->headers_in.status_n == NGX_HTTP_CREATED) { - u->headers_in.status_n = NGX_HTTP_OK; - } - - return NGX_OK; -} - -ngx_int_t -ngx_http_memc_empty_filter(void *data, ssize_t bytes) -{ - ngx_http_memc_ctx_t *ctx = data; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - /* recover the buffer for subrequests in memory */ - u->buffer.last += ctx->body_length; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_get_cmd_filter_init(void *data) -{ - ngx_http_memc_ctx_t *ctx = data; - - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - dd("filter init: u->length: %d", (int) u->length); - - u->length = u->headers_in.content_length_n + NGX_HTTP_MEMC_END; - - dd("filter init (2): u->length: %d", (int) u->length); - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_get_cmd_filter(void *data, ssize_t bytes) -{ - ngx_http_memc_ctx_t *ctx = data; - - u_char *last; - ngx_buf_t *b; - ngx_chain_t *cl, **ll; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - b = &u->buffer; - - if (u->length == ctx->rest) { - - if (ngx_strncmp(b->last, - ngx_http_memc_end + NGX_HTTP_MEMC_END - ctx->rest, - bytes) != 0) - { - ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "memcached sent invalid trailer"); - - u->length = 0; - ctx->rest = 0; - - return NGX_OK; - } - - u->length -= bytes; - ctx->rest -= bytes; - -#if defined(nginx_version) && nginx_version >= 1001004 - if (u->length == 0) { - u->keepalive = 1; - } -#endif - - return NGX_OK; - } - - for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { - ll = &cl->next; - } - - cl = ngx_chain_get_free_buf(ctx->request->pool, &u->free_bufs); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf->flush = 1; - cl->buf->memory = 1; - - *ll = cl; - - last = b->last; - cl->buf->pos = last; - b->last += bytes; - cl->buf->last = b->last; - cl->buf->tag = u->output.tag; - - ngx_log_debug4(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0, - "memcached filter bytes:%z size:%z length:%z rest:%z", - bytes, b->last - b->pos, u->length, ctx->rest); - - if (bytes <= (ssize_t) (u->length - NGX_HTTP_MEMC_END)) { - u->length -= bytes; - return NGX_OK; - } - - last += u->length - NGX_HTTP_MEMC_END; - - if (ngx_strncmp(last, ngx_http_memc_end, b->last - last) != 0) { - ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "memcached sent invalid trailer"); - -#if defined(nginx_version) && nginx_version >= 1001004 - b->last = last; - cl->buf->last = last; - u->length = 0; - ctx->rest = 0; - - return NGX_OK; -#endif - } - - ctx->rest -= b->last - last; - b->last = last; - cl->buf->last = last; - u->length = ctx->rest; - -#if defined(nginx_version) && nginx_version >= 1001004 - if (u->length == 0) { - u->keepalive = 1; - } -#endif - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_process_get_cmd_header(ngx_http_request_t *r) -{ - ngx_http_memc_loc_conf_t *conf; - u_char *p, *len; - ngx_str_t line; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_http_variable_value_t *flags_vv; - - u = r->upstream; - - dd("process header: u->length: %u", (unsigned) u->length); - - for (p = u->buffer.pos; p < u->buffer.last; p++) { - if (*p == LF) { - goto found; - } - } - - return NGX_AGAIN; - -found: - - *p = '\0'; - - line.len = p - u->buffer.pos - 1; - line.data = u->buffer.pos; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "memcached: \"%V\"", &line); - - p = u->buffer.pos; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - if (ngx_strncmp(p, "VALUE ", sizeof("VALUE ") - 1) == 0) { - - p += sizeof("VALUE ") - 1; - - if (ngx_strncmp(p, ctx->key.data, ctx->key.len) != 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid key in response \"%V\" " - "for key \"%V\"", - &line, &ctx->key); - - return NGX_HTTP_UPSTREAM_INVALID_HEADER; - } - - p += ctx->key.len; - - if (*p++ != ' ') { - goto no_valid; - } - - /* save flags */ - - flags_vv = ctx->memc_flags_vv; - - if (flags_vv == NULL) { - return NGX_ERROR; - } - - if (flags_vv->not_found) { - flags_vv->not_found = 0; - flags_vv->valid = 1; - flags_vv->no_cacheable = 0; - } - - flags_vv->data = p; - - while (*p) { - if (*p++ == ' ') { - flags_vv->len = p - 1 - flags_vv->data; - conf = ngx_http_get_module_loc_conf(r, ngx_http_memc_module); - - if (conf->flags_to_last_modified) { - r->headers_out.last_modified_time = - ngx_atotm(flags_vv->data, flags_vv->len); - } - - goto length; - } - } - - goto no_valid; - - length: - - len = p; - - while (*p && *p++ != CR) { /* void */ } - -#if defined(nginx_version) && nginx_version >= 1001004 - u->headers_in.content_length_n = ngx_atoof(len, p - len - 1); - if (u->headers_in.content_length_n == -1) { -#else - r->headers_out.content_length_n = ngx_atoof(len, p - len - 1); - if (r->headers_out.content_length_n == -1) { -#endif - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid length in response \"%V\" " - "for key \"%V\"", - &line, &ctx->key); - return NGX_HTTP_UPSTREAM_INVALID_HEADER; - } - - u->headers_in.status_n = NGX_HTTP_OK; - u->state->status = NGX_HTTP_OK; - u->buffer.pos = p + 1; - - return NGX_OK; - } - - if (ngx_strcmp(p, "END\x0d") == 0) { - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "key: \"%V\" was not found by memcached", &ctx->key); - - u->headers_in.status_n = NGX_HTTP_NOT_FOUND; - u->state->status = NGX_HTTP_NOT_FOUND; - -#if defined(nginx_version) && nginx_version >= 1001004 - u->keepalive = 1; -#endif - - return NGX_OK; - } - -no_valid: - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid response: \"%V\"", &line); - - return NGX_HTTP_UPSTREAM_INVALID_HEADER; -} - - -static ngx_int_t -ngx_http_memc_write_simple_response(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx, ngx_uint_t status, - ngx_str_t *resp) -{ - ngx_chain_t *cl, **ll; - - for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { - ll = &cl->next; - } - - cl = ngx_chain_get_free_buf(r->pool, &u->free_bufs); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf->flush = 1; - cl->buf->memory = 1; - cl->buf->pos = resp->data; - cl->buf->last = cl->buf->pos + resp->len; - - *ll = cl; - - /* for subrequests in memory */ - u->buffer.pos = resp->data; - u->buffer.last = resp->data + resp->len; - ctx->body_length = resp->len; - -#if defined(nginx_version) && nginx_version >= 1001004 - u->headers_in.content_length_n = resp->len; - u->keepalive = 1; -#else - r->headers_out.content_length_n = resp->len; -#endif - - u->headers_in.status_n = status; - u->state->status = status; - - return NGX_OK; -} - - -static u_char * -parse_memc_storage(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 577 "src/ngx_http_memc_response.rl" - -#line 578 "src/ngx_http_memc_response.rl" - -#line 1143 "src/ngx_http_memc_response.c" - { - int _klen; - const char *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_storage_trans_keys + _memc_storage_key_offsets[cs]; - _trans = _memc_storage_index_offsets[cs]; - - _klen = _memc_storage_single_lengths[cs]; - if ( _klen > 0 ) { - const char *_lower = _keys; - const char *_mid; - const char *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_storage_range_lengths[cs]; - if ( _klen > 0 ) { - const char *_lower = _keys; - const char *_mid; - const char *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - cs = _memc_storage_trans_targs[_trans]; - - if ( _memc_storage_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_storage_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 4: -#line 31 "src/memc_common.rl" - { - dd("status set to 201"); - - *status_addr = NGX_HTTP_CREATED; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 3: -#line 37 "src/memc_common.rl" - { - dd("status set to 404"); - - *status_addr = NGX_HTTP_NOT_FOUND; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1256 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 579 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 593 "src/ngx_http_memc_response.rl" - -#line 594 "src/ngx_http_memc_response.rl" - -#line 1287 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_flush_all_trans_keys + _memc_flush_all_key_offsets[cs]; - _trans = _memc_flush_all_index_offsets[cs]; - - _klen = _memc_flush_all_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_flush_all_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - _trans = _memc_flush_all_indicies[_trans]; - cs = _memc_flush_all_trans_targs[_trans]; - - if ( _memc_flush_all_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_flush_all_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1375 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 595 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_version(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 609 "src/ngx_http_memc_response.rl" - -#line 610 "src/ngx_http_memc_response.rl" - -#line 1406 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_version_trans_keys + _memc_version_key_offsets[cs]; - _trans = _memc_version_index_offsets[cs]; - - _klen = _memc_version_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_version_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - _trans = _memc_version_indicies[_trans]; - cs = _memc_version_trans_targs[_trans]; - - if ( _memc_version_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_version_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1494 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 611 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr, - unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 625 "src/ngx_http_memc_response.rl" - -#line 626 "src/ngx_http_memc_response.rl" - -#line 1525 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_stats_trans_keys + _memc_stats_key_offsets[cs]; - _trans = _memc_stats_index_offsets[cs]; - - _klen = _memc_stats_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_stats_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - _trans = _memc_stats_indicies[_trans]; - cs = _memc_stats_trans_targs[_trans]; - - if ( _memc_stats_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_stats_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1613 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 627 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr, - unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 641 "src/ngx_http_memc_response.rl" - -#line 642 "src/ngx_http_memc_response.rl" - -#line 1644 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_delete_trans_keys + _memc_delete_key_offsets[cs]; - _trans = _memc_delete_index_offsets[cs]; - - _klen = _memc_delete_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_delete_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - cs = _memc_delete_trans_targs[_trans]; - - if ( _memc_delete_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_delete_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 3: -#line 37 "src/memc_common.rl" - { - dd("status set to 404"); - - *status_addr = NGX_HTTP_NOT_FOUND; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1744 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 643 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 657 "src/ngx_http_memc_response.rl" - -#line 658 "src/ngx_http_memc_response.rl" - -#line 1775 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_incr_decr_trans_keys + _memc_incr_decr_key_offsets[cs]; - _trans = _memc_incr_decr_index_offsets[cs]; - - _klen = _memc_incr_decr_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_incr_decr_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - _trans = _memc_incr_decr_indicies[_trans]; - cs = _memc_incr_decr_trans_targs[_trans]; - - if ( _memc_incr_decr_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_incr_decr_trans_actions[_trans] ) { - case 1: -#line 26 "src/memc_common.rl" - { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - break; - case 3: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } -#line 26 "src/memc_common.rl" - { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - break; - case 2: -#line 31 "src/memc_common.rl" - { - dd("status set to 201"); - - *status_addr = NGX_HTTP_CREATED; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } -#line 26 "src/memc_common.rl" - { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - break; - case 4: -#line 37 "src/memc_common.rl" - { - dd("status set to 404"); - - *status_addr = NGX_HTTP_NOT_FOUND; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } -#line 26 "src/memc_common.rl" - { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - break; -#line 1904 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 659 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.h deleted file mode 100644 index aec26dc..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.h +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_MEMC_RESPONSE_H -#define NGX_HTTP_MEMC_RESPONSE_H - -#include -#include - -ngx_int_t ngx_http_memc_process_get_cmd_header(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_get_cmd_filter_init(void *data); - -ngx_int_t ngx_http_memc_get_cmd_filter(void *data, ssize_t bytes); - -ngx_int_t ngx_http_memc_process_simple_header(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_empty_filter_init(void *data); - -ngx_int_t ngx_http_memc_empty_filter(void *data, ssize_t bytes); - -ngx_int_t ngx_http_memc_process_flush_all_cmd_header(ngx_http_request_t *r); - -#endif /* NGX_HTTP_MEMC_RESPONSE_H */ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.rl deleted file mode 100644 index 31f7c83..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.rl +++ /dev/null @@ -1,663 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_memc_response.h" -#include "ngx_http_memc_module.h" - - -#ifdef s_char -#undef s_char -#endif - -#define s_char signed char - - -%% machine memc_storage; -%% write data; - -%% machine memc_flush_all; -%% write data; - -%% machine memc_version; -%% write data; - -%% machine memc_stats; -%% write data; - -%% machine memc_delete; -%% write data; - -%% machine memc_incr_decr; -%% write data; - - -u_char ngx_http_memc_end[] = CRLF "END" CRLF; - - -static u_char *parse_memc_storage(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_version(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static ngx_int_t ngx_http_memc_write_simple_response(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx, - ngx_uint_t status, ngx_str_t *resp); - - -ngx_int_t -ngx_http_memc_process_simple_header(ngx_http_request_t *r) -{ - ngx_int_t rc; - int cs; - s_char *p; - s_char *pe; - s_char *orig; - ngx_str_t resp; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_uint_t status; - unsigned done = 0; - int error_state; - int final_state; - - status = NGX_HTTP_OK; - - dd("process simple cmd header"); - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - if (ctx->parser_state == NGX_ERROR) { - dd("reinit state"); - - if (ctx->is_storage_cmd) { - dd("init memc_storage machine..."); - - %% machine memc_storage; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_flush_all) { - dd("init memc_flush_all machine..."); - - %% machine memc_flush_all; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_version) { - dd("init memc_version machine..."); - - %% machine memc_version; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_stats) { - dd("init memc_stats machine..."); - - %% machine memc_stats; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_delete) { - dd("init memc_delete machine..."); - - %% machine memc_delete; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_incr - || ctx->cmd == ngx_http_memc_cmd_decr) - { - dd("init memc_incr_decr machine..."); - - %% machine memc_incr_decr; - %% write init; - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unrecognized memcached command in " - "ngx_http_memc_process_simple_header: \"%V\"", - &ctx->cmd_str); - - return NGX_ERROR; /* this results in 500 status */ - } - - } else { - cs = ctx->parser_state; - } - - u = r->upstream; - - orig = (s_char *) u->buffer.pos; - - p = (s_char *) u->buffer.pos; - pe = (s_char *) u->buffer.last; - - dd("buffer len: %d", (int) (pe - p)); - - if (ctx->is_storage_cmd) { - error_state = memc_storage_error; - final_state = memc_storage_first_final; - - p = (s_char *) parse_memc_storage(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_flush_all) { - error_state = memc_flush_all_error; - final_state = memc_flush_all_first_final; - - p = (s_char *) parse_memc_flush_all(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_version) { - error_state = memc_version_error; - final_state = memc_version_first_final; - - p = (s_char *) parse_memc_version(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_stats) { - error_state = memc_stats_error; - final_state = memc_stats_first_final; - - p = (s_char *) parse_memc_stats(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_delete) { - error_state = memc_delete_error; - final_state = memc_delete_first_final; - - p = (s_char *) parse_memc_delete(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_incr - || ctx->cmd == ngx_http_memc_cmd_decr) - { - error_state = memc_incr_decr_error; - final_state = memc_incr_decr_first_final; - - p = (s_char *) parse_memc_incr_decr(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unrecognized memcached command in " - "ngx_http_memc_process_simple_header: \"%V\"", - &ctx->cmd_str); - - return NGX_ERROR; /* this results in 500 status */ - } - - ctx->parser_state = cs; - - resp.data = u->buffer.start; - resp.len = (u_char *) p - resp.data; - - u->buffer.pos = (u_char *) p; - - dd("machine state: %d (done: %d)", cs, done); - dd("memcached response: (len: %d) %s", (int) resp.len, resp.data); - - if (done || cs >= final_state) { - dd("memcached response parsed (resp.len: %d)", (int) resp.len); - - rc = ngx_http_memc_write_simple_response(r, u, ctx, status, &resp); - - return rc; - } - - if (cs == error_state) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid response for command \"%V\" " - "at pos %O: %V", &ctx->cmd_str, (off_t) (p - orig), &resp); - - status = NGX_HTTP_BAD_GATEWAY; - u->headers_in.status_n = status; - u->state->status = status; - - /* u->headers_in.status_n will be the final status */ - return NGX_OK; - } - - dd("we need more data to proceed (returned NGX_AGAIN)"); - - return NGX_AGAIN; -} - - -ngx_int_t -ngx_http_memc_empty_filter_init(void *data) -{ - ngx_http_memc_ctx_t *ctx = data; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - u->length = 0; - - /* to persuade ngx_http_upstream_keepalive (if any) - to cache the connection if the status is neither - 200 nor 404. */ - if (u->headers_in.status_n == NGX_HTTP_CREATED) { - u->headers_in.status_n = NGX_HTTP_OK; - } - - return NGX_OK; -} - -ngx_int_t -ngx_http_memc_empty_filter(void *data, ssize_t bytes) -{ - ngx_http_memc_ctx_t *ctx = data; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - /* recover the buffer for subrequests in memory */ - u->buffer.last += ctx->body_length; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_get_cmd_filter_init(void *data) -{ - ngx_http_memc_ctx_t *ctx = data; - - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - dd("filter init: u->length: %d", (int) u->length); - - u->length = u->headers_in.content_length_n + NGX_HTTP_MEMC_END; - - dd("filter init (2): u->length: %d", (int) u->length); - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_get_cmd_filter(void *data, ssize_t bytes) -{ - ngx_http_memc_ctx_t *ctx = data; - - u_char *last; - ngx_buf_t *b; - ngx_chain_t *cl, **ll; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - b = &u->buffer; - - if (u->length == ctx->rest) { - - if (ngx_strncmp(b->last, - ngx_http_memc_end + NGX_HTTP_MEMC_END - ctx->rest, - bytes) != 0) - { - ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "memcached sent invalid trailer"); - - u->length = 0; - ctx->rest = 0; - - return NGX_OK; - } - - u->length -= bytes; - ctx->rest -= bytes; - -#if defined(nginx_version) && nginx_version >= 1001004 - if (u->length == 0) { - u->keepalive = 1; - } -#endif - - return NGX_OK; - } - - for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { - ll = &cl->next; - } - - cl = ngx_chain_get_free_buf(ctx->request->pool, &u->free_bufs); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf->flush = 1; - cl->buf->memory = 1; - - *ll = cl; - - last = b->last; - cl->buf->pos = last; - b->last += bytes; - cl->buf->last = b->last; - cl->buf->tag = u->output.tag; - - ngx_log_debug4(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0, - "memcached filter bytes:%z size:%z length:%z rest:%z", - bytes, b->last - b->pos, u->length, ctx->rest); - - if (bytes <= (ssize_t) (u->length - NGX_HTTP_MEMC_END)) { - u->length -= bytes; - return NGX_OK; - } - - last += u->length - NGX_HTTP_MEMC_END; - - if (ngx_strncmp(last, ngx_http_memc_end, b->last - last) != 0) { - ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "memcached sent invalid trailer"); - -#if defined(nginx_version) && nginx_version >= 1001004 - b->last = last; - cl->buf->last = last; - u->length = 0; - ctx->rest = 0; - - return NGX_OK; -#endif - } - - ctx->rest -= b->last - last; - b->last = last; - cl->buf->last = last; - u->length = ctx->rest; - -#if defined(nginx_version) && nginx_version >= 1001004 - if (u->length == 0) { - u->keepalive = 1; - } -#endif - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_process_get_cmd_header(ngx_http_request_t *r) -{ - ngx_http_memc_loc_conf_t *conf; - u_char *p, *len; - ngx_str_t line; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_http_variable_value_t *flags_vv; - - u = r->upstream; - - dd("process header: u->length: %u", (unsigned) u->length); - - for (p = u->buffer.pos; p < u->buffer.last; p++) { - if (*p == LF) { - goto found; - } - } - - return NGX_AGAIN; - -found: - - *p = '\0'; - - line.len = p - u->buffer.pos - 1; - line.data = u->buffer.pos; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "memcached: \"%V\"", &line); - - p = u->buffer.pos; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - if (ngx_strncmp(p, "VALUE ", sizeof("VALUE ") - 1) == 0) { - - p += sizeof("VALUE ") - 1; - - if (ngx_strncmp(p, ctx->key.data, ctx->key.len) != 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid key in response \"%V\" " - "for key \"%V\"", - &line, &ctx->key); - - return NGX_HTTP_UPSTREAM_INVALID_HEADER; - } - - p += ctx->key.len; - - if (*p++ != ' ') { - goto no_valid; - } - - /* save flags */ - - flags_vv = ctx->memc_flags_vv; - - if (flags_vv == NULL) { - return NGX_ERROR; - } - - if (flags_vv->not_found) { - flags_vv->not_found = 0; - flags_vv->valid = 1; - flags_vv->no_cacheable = 0; - } - - flags_vv->data = p; - - while (*p) { - if (*p++ == ' ') { - flags_vv->len = p - 1 - flags_vv->data; - conf = ngx_http_get_module_loc_conf(r, ngx_http_memc_module); - - if (conf->flags_to_last_modified) { - r->headers_out.last_modified_time = - ngx_atotm(flags_vv->data, flags_vv->len); - } - - goto length; - } - } - - goto no_valid; - - length: - - len = p; - - while (*p && *p++ != CR) { /* void */ } - -#if defined(nginx_version) && nginx_version >= 1001004 - u->headers_in.content_length_n = ngx_atoof(len, p - len - 1); - if (u->headers_in.content_length_n == -1) { -#else - r->headers_out.content_length_n = ngx_atoof(len, p - len - 1); - if (r->headers_out.content_length_n == -1) { -#endif - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid length in response \"%V\" " - "for key \"%V\"", - &line, &ctx->key); - return NGX_HTTP_UPSTREAM_INVALID_HEADER; - } - - u->headers_in.status_n = NGX_HTTP_OK; - u->state->status = NGX_HTTP_OK; - u->buffer.pos = p + 1; - - return NGX_OK; - } - - if (ngx_strcmp(p, "END\x0d") == 0) { - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "key: \"%V\" was not found by memcached", &ctx->key); - - u->headers_in.status_n = NGX_HTTP_NOT_FOUND; - u->state->status = NGX_HTTP_NOT_FOUND; - -#if defined(nginx_version) && nginx_version >= 1001004 - u->keepalive = 1; -#endif - - return NGX_OK; - } - -no_valid: - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid response: \"%V\"", &line); - - return NGX_HTTP_UPSTREAM_INVALID_HEADER; -} - - -static ngx_int_t -ngx_http_memc_write_simple_response(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx, ngx_uint_t status, - ngx_str_t *resp) -{ - ngx_chain_t *cl, **ll; - - for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { - ll = &cl->next; - } - - cl = ngx_chain_get_free_buf(r->pool, &u->free_bufs); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf->flush = 1; - cl->buf->memory = 1; - cl->buf->pos = resp->data; - cl->buf->last = cl->buf->pos + resp->len; - - *ll = cl; - - /* for subrequests in memory */ - u->buffer.pos = resp->data; - u->buffer.last = resp->data + resp->len; - ctx->body_length = resp->len; - -#if defined(nginx_version) && nginx_version >= 1001004 - u->headers_in.content_length_n = resp->len; - u->keepalive = 1; -#else - r->headers_out.content_length_n = resp->len; -#endif - - u->headers_in.status_n = status; - u->state->status = status; - - return NGX_OK; -} - - -static u_char * -parse_memc_storage(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_storage; - %% include "memc_storage.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_flush_all; - %% include "memc_flush_all.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_version(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_version; - %% include "memc_version.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr, - unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_stats; - %% include "memc_stats.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr, - unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_delete; - %% include "memc_delete.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_incr_decr; - %% include "memc_incr_decr.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.c deleted file mode 100644 index dd19643..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.c +++ /dev/null @@ -1,161 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_memc_util.h" - -ngx_http_memc_cmd_t -ngx_http_memc_parse_cmd(u_char *data, size_t len, ngx_flag_t *is_storage_cmd) -{ - switch (len) { - - case 3: - if (ngx_http_memc_strcmp_const(data, "set") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_set; - } - - if (ngx_http_memc_strcmp_const(data, "add") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_add; - } - - /* - if (ngx_str3cmp(data, 'c', 'a', 's')) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_cas; - } - */ - - if (ngx_http_memc_strcmp_const(data, "get") == 0) { - return ngx_http_memc_cmd_get; - } - - break; - - case 4: - /* - if (ngx_str4cmp(data, 'g', 'e', 't', 's')) { - return ngx_http_memc_cmd_gets; - } - */ - - if (ngx_http_memc_strcmp_const(data, "incr") == 0) { - return ngx_http_memc_cmd_incr; - } - - if (ngx_http_memc_strcmp_const(data, "decr") == 0) { - return ngx_http_memc_cmd_decr; - } - - break; - - case 5: - if (ngx_http_memc_strcmp_const(data, "stats") == 0) { - return ngx_http_memc_cmd_stats; - } - - break; - - case 6: - if (ngx_http_memc_strcmp_const(data, "append") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_append; - } - - if (ngx_http_memc_strcmp_const(data, "delete") == 0) { - return ngx_http_memc_cmd_delete; - } - - break; - - case 7: - if (ngx_http_memc_strcmp_const(data, "replace") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_replace; - } - - if (ngx_http_memc_strcmp_const(data, "prepend") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_prepend; - } - - if (ngx_http_memc_strcmp_const(data, "version") == 0) { - return ngx_http_memc_cmd_version; - } - - break; - - case 9: - if (ngx_http_memc_strcmp_const(data, "flush_all") == 0) { - return ngx_http_memc_cmd_flush_all; - } - - /* - if (ngx_str9cmp(data, 'v', 'e', 'r', 'b', 'o', 's', 'i', 't', 'y')) - { - return ngx_http_memc_cmd_verbosity; - } - */ - - break; - - default: - break; - } - - return ngx_http_memc_cmd_unknown; -} - - -ngx_http_upstream_srv_conf_t * -ngx_http_memc_upstream_add(ngx_http_request_t *r, ngx_url_t *url) -{ - ngx_http_upstream_main_conf_t *umcf; - ngx_http_upstream_srv_conf_t **uscfp; - ngx_uint_t i; - - umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); - - uscfp = umcf->upstreams.elts; - - for (i = 0; i < umcf->upstreams.nelts; i++) { - - if (uscfp[i]->host.len != url->host.len - || ngx_strncasecmp(uscfp[i]->host.data, url->host.data, - url->host.len) != 0) - { - dd("upstream_add: host not match"); - continue; - } - - if (uscfp[i]->port != url->port) { - dd("upstream_add: port not match: %d != %d", - (int) uscfp[i]->port, (int) url->port); - continue; - } - -#if (nginx_version < 1011006) - if (uscfp[i]->default_port && url->default_port - && uscfp[i]->default_port != url->default_port) - { - dd("upstream_add: default_port not match"); - continue; - } -#endif - - return uscfp[i]; - } - - dd("No upstream found: %.*s", (int) url->host.len, url->host.data); - - return NULL; -} - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.h deleted file mode 100644 index e83fbbb..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.h +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_MEMC_UTIL_H -#define NGX_HTTP_MEMC_UTIL_H - -#include -#include -#include "ngx_http_memc_module.h" - -#ifndef NGX_UINT32_LEN -#define NGX_UINT32_LEN (NGX_INT32_LEN - 1) -#endif - -#ifndef NGX_UINT64_LEN -#define NGX_UINT64_LEN (NGX_INT64_LEN - 1) -#endif - -#define ngx_http_memc_strcmp_const(a, b) \ - ngx_strncmp(a, b, sizeof(b) - 1) - -ngx_http_memc_cmd_t ngx_http_memc_parse_cmd(u_char *data, size_t len, - ngx_flag_t *is_storage_cmd); - -ngx_http_upstream_srv_conf_t *ngx_http_memc_upstream_add( - ngx_http_request_t *r, ngx_url_t *url); - - -#endif /* NGX_HTTP_MEMC_UTIL_H */ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/bugs.t b/modules_deb/libnginx-mod-http-memc-0.20/t/bugs.t deleted file mode 100644 index a39260d..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/bugs.t +++ /dev/null @@ -1,240 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; -no_shuffle(); -no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: set only ---- http_config - upstream mc { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location = "/set" { - set $memc_cmd 'set'; - set $memc_key 'jalla'; - set $memc_value 'myvalue'; - set $memc_exptime 24; - memc_pass mc; - } - - - location = "/get" { - set $memc_cmd 'get'; - set $memc_key 'jalla'; - memc_pass mc; - } - - location = "/delete" { - set $memc_cmd 'delete'; - set $memc_key 'jalla'; - memc_pass mc; - } - location = "/flush" { - echo_location /get; - #echo ""; - echo_location /delete; - } ---- request - GET /flush ---- response_body eval -"STORED\r\n" ---- error_code: 201 ---- SKIP - - - -=== TEST 2: set in a subrequest issued from an output filter ---- config - location /memc { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'blah'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - location /main { - default_type 'text/html'; - add_before_body '/memc'; - echo '~~'; - add_after_body '/memc'; - } ---- request -GET /main ---- response_body eval -"STORED\r -~~ -STORED\r -" - - - -=== TEST 3: reuse request body ---- config - location /main { - echo_read_request_body; - - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo'; - echo_subrequest POST '/memc?key=foo&cmd=set'; - - echo 'set bar'; - echo_subrequest POST '/memc?key=bar&cmd=set'; - - echo 'get bar'; - echo_location '/memc?key=bar&cmd=get'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - #set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -Hello ---- response_body eval -"flush_all -status: 200 -exptime: -OK\r -set foo -status: 201 -exptime: 0 -STORED\r -set bar -status: 201 -exptime: 0 -STORED\r -get bar -status: 200 -exptime: -Helloget foo -status: 200 -exptime: -Hello" - - - -=== TEST 4: zero buf when $memc_value is empty -http://github.com/agentzh/memc-nginx-module/issues#issue/2 ---- config - location /memc { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value ''; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc ---- response_body eval -"STORED\r -" ---- error_code: 201 - - - -=== TEST 5: zero buf when $memc_value is empty -http://github.com/agentzh/memc-nginx-module/issues#issue/2 ---- config - location /memc { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value ''; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc ---- response_body eval -"STORED\r -" ---- error_code: 201 - - - -=== TEST 6: set too long keys ---- config - location /memc { - set $memc_cmd 'set'; - set $memc_key 'foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo'; - set $memc_value 'hi'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc ---- response_body eval -"CLIENT_ERROR bad command line format\r -" ---- error_code: 502 - - - -=== TEST 7: get too long keys ---- config - location /memc { - set $memc_cmd 'get'; - set $memc_key 'foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc ---- response_body_like: 502 Bad Gateway ---- error_code: 502 - - - -=== TEST 8: set only ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $echo_request_body; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /memc?key=foo&cmd=set -hello, world ---- response_body eval -"STORED\r\n" ---- error_code: 201 ---- SKIP - - - -=== TEST 9: get ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc?key=foo&cmd=get ---- response_body -hello, world ---- error_code: 200 ---- SKIP - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/cmd.t b/modules_deb/libnginx-mod-http-memc-0.20/t/cmd.t deleted file mode 100644 index 327a0c7..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/cmd.t +++ /dev/null @@ -1,144 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * (2 * blocks() + 3); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: bad cmd ---- config - location /foo { - set $memc_cmd blah; - set $memc_key foo; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /foo ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -ngx_memc: unknown $memc_cmd "blah" - - - -=== TEST 2: no default value for $memc_cmd for method COPY ---- config - location /foo { - set $memc_key foo; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - COPY /foo ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -ngx_memc: $memc_cmd variable not found for HTTP COPY requests - - - -=== TEST 3: bad cmd (case sensitive) ---- config - location /foo { - set $memc_cmd GET; - set $memc_key foo; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /foo ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 4: explicit $memc_cmd in non-empty cmds_allowed list ---- config - location /allow { - set $memc_cmd version; - memc_cmds_allowed get version; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: ^VERSION \d+(\.\d+)+.*?\r\n$ - - - -=== TEST 5: explicit $memc_cmd in non-empty cmds_allowed list (in first) ---- config - location /allow { - set $memc_cmd version; - memc_cmds_allowed version get; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: ^VERSION \d+(\.\d+)+.*?\r\n$ - - - -=== TEST 6: explicit $memc_cmd NOT in non-empty cmds_allowed list ---- config - location /allow { - set $memc_cmd version; - memc_cmds_allowed set get add delete; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 403 Forbidden ---- error_code: 403 ---- error_log -ngx_memc: memcached command "version" not allowed - - - -=== TEST 7: implicit $memc_cmd NOT in non-empty cmds_allowed list ---- config - location /allow { - memc_cmds_allowed set add delete version; - - set $memcached_key foo; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 403 Forbidden ---- error_code: 403 - - - -=== TEST 8: $memc_cmd has its default values when it's an empty string ---- config - location /main { - echo_read_request_body; - echo 'set big2'; - echo_subrequest PUT '/memc?key=big2'; - - echo 'get big2'; - echo_location '/memc?key=big2&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -nice to meet you! ---- response_body eval -"set big2 -STORED\r -get big2 -nice to meet you!" - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/core-bugs.t b/modules_deb/libnginx-mod-http-memc-0.20/t/core-bugs.t deleted file mode 100644 index a9a580c..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/core-bugs.t +++ /dev/null @@ -1,55 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -no_shuffle(); - -#no_diff; -#no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: bug in nginx core? (1) ---- http_config - upstream foo { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- config - location /set { - set $memc_key foo; - set $memc_cmd set; - set $memc_value '[["mafiaclans.eu", 12], ["picfu.net", 5], ["www.test.com", 0], ["www.ayom.com", 0], ["www.21dezember2012.org", 0], ["the-indie.ch", 0], ["spiele-check.de", 0], ["online-right-now.net", 0], ["google.com", 0]]'; - memc_pass foo; - } ---- request -GET /set ---- response_body eval -"STORED\r\n" ---- error_code: 201 - - - -=== TEST 2: bug in nginx core? (2) ---- http_config - upstream foo { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- config - location /get { - set $memcached_key foo; - memcached_pass foo; - } ---- request -GET /get ---- response_body eval -qq{[["mafiaclans.eu", 12], ["picfu.net", 5], ["www.test.com", 0], ["www.ayom.com", 0], ["www.21dezember2012.org", 0], ["the-indie.ch", 0], ["spiele-check.de", 0], ["online-right-now.net", 0], ["google.com", 0]]} - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/delete.t b/modules_deb/libnginx-mod-http-memc-0.20/t/delete.t deleted file mode 100644 index 9fccf37..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/delete.t +++ /dev/null @@ -1,140 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: delete non-existent item ---- config - location /main { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'delete foo'; - echo_location '/memc?key=foo&cmd=delete'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -^flush_all -status: 200 -exptime: -OK\r -delete foo -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 2: set and delete and set ---- config - location /main { - echo 'set foo bar'; - echo_location '/memc?cmd=set&key=foo&val=bar'; - - echo 'delete foo'; - echo_location '/memc?key=foo&cmd=delete'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -^set foo bar -status: 201 -exptime: 0 -STORED\r -delete foo -status: 200 -exptime: -DELETED\r -get foo -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 3: set and delete and set (with exptime) ---- config - location /main { - echo 'set foo bar'; - echo_location '/memc?cmd=set&key=foo&val=bar'; - - echo 'delete foo 1'; - echo_location '/memc?key=foo&cmd=delete&exptime=1'; - - echo 'add foo cat'; - echo_location '/memc?key=foo&cmd=add&val=cat'; - - echo_blocking_sleep 1.6; - - echo 'add foo cat - 2nd'; - echo_location '/memc?key=foo&cmd=add&val=cat'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo bar -status: 201 -exptime: 0 -STORED\r -delete foo 1 -status: 200 -exptime: 1 -DELETED\r -add foo cat -status: 200 -exptime: 0 -NOT_STORED\r -add foo cat - 2nd -status: 201 -exptime: 0 -STORED\r -" ---- SKIP - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/errors.t b/modules_deb/libnginx-mod-http-memc-0.20/t/errors.t deleted file mode 100644 index 1cda000..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/errors.t +++ /dev/null @@ -1,45 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: empty pass -little-endian systems only - ---- config - location /memc { - set $memc_key foo; - set $backend "not-exist"; - memc_pass $backend; - } ---- request -GET /memc ---- error_code: 500 ---- response_body_like: 500 Internal Server Error - - - -=== TEST 2: connection refused -little-endian systems only - ---- config - location /memc { - set $memc_key foo; - set $backend "not-exist"; - memc_pass 127.0.0.1:1; - } ---- request -GET /memc ---- error_code: 502 ---- response_body_like: 502 Bad Gateway - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/eval.t b/modules_deb/libnginx-mod-http-memc-0.20/t/eval.t deleted file mode 100644 index 8736de7..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/eval.t +++ /dev/null @@ -1,118 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # skip_all => 'ngx_memc storage commands do not work with the ngx_eval module'; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -no_long_string(); -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set in eval (NO subrequest in memory) ---- http_config - upstream mc { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location = /main { - echo_location /eval; - echo_location /eval; - } - location = /eval { - eval_subrequest_in_memory off; - eval_override_content_type text/plain; - eval $res { - default_type 'text/plain'; - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'myvalue'; - set $memc_exptime 24; - memc_pass mc; - } - echo [$res]; - } - ---- request - GET /eval ---- response_body -[STORED] ---- timeout: 30 ---- error_code: 200 - - - -=== TEST 2: set in eval (subrequest in memory) ---- http_config - upstream mc { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location = /main { - echo_location /eval; - echo_location /eval; - } - location = /eval { - eval_subrequest_in_memory on; - eval_override_content_type text/plain; - eval $res { - default_type 'text/plain'; - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'myvalue'; - set $memc_exptime 24; - memc_pass mc; - } - echo [$res]; - } - ---- request - GET /eval ---- response_body -[STORED] ---- timeout: 30 ---- error_code: 200 - - - -=== TEST 3: set in eval (subrequest in memory) ---- http_config - upstream mc { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location = /main { - echo_location /get; - echo_location /del?foo; - } - location = /get { - set $memc_cmd get; - set $memc_key foo; - memc_pass mc; - } - location = /del { - eval $res { - set $memc_cmd delete; - set $memc_key $query_string; - memc_pass mc; - } - return 200; - } ---- request - GET /main ---- response_body -[STORED] ---- timeout: 30 ---- error_code: 200 ---- SKIP - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/exptime.t b/modules_deb/libnginx-mod-http-memc-0.20/t/exptime.t deleted file mode 100644 index 0a62190..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/exptime.t +++ /dev/null @@ -1,166 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set exptime ---- config - location /exptime { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo&exptime=1' -b BAR; - - echo 'get foo - 0 sec'; - echo_location '/memc?key=foo'; - echo; - - echo_blocking_sleep 1.1; - - echo 'get foo - 1.1 sec'; - echo_location '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /exptime ---- response_body_like -^flush_all -status: 200 -exptime: -OK\r -set foo BAR -status: 201 -exptime: 1 -STORED\r -get foo - 0 sec -status: 200 -exptime: -BAR -get foo - 1\.1 sec -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 2: test empty flags (default to 0) ---- config - location /flags { - echo 'set foo BAR (exptime: EMPTY)'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo_blocking_sleep 1; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_key $arg_key; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (exptime: EMPTY) -status: 201 -exptime: 0 -STORED\r -get foo -status: 200 -exptime: -BAR" - - - -=== TEST 3: invalid exptime in set ---- config - location /allow { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'nice'; - set $memc_exptime 'my invalid'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -variable "$memc_exptime" takes invalid value: my invalid, - - - -=== TEST 4: invalid exptime in flush_all ---- config - location /allow { - set $memc_cmd 'flush_all'; - set $memc_key 'foo'; - set $memc_value 'nice'; - set $memc_exptime 'invalid'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 5: invalid exptime in delete ---- config - location /allow { - set $memc_cmd 'delete'; - set $memc_key 'foo'; - set $memc_value 'nice'; - set $memc_exptime 'invalid'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 6: set negative exptime ---- config - location /allow { - set $memc_cmd 'set'; - set $memc_key 'sun'; - set $memc_value 'tree'; - set $memc_exptime '-1'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/flags.t b/modules_deb/libnginx-mod-http-memc-0.20/t/flags.t deleted file mode 100644 index aa2b29b..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/flags.t +++ /dev/null @@ -1,263 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 3); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; -no_shuffle; - -run_tests(); - -__DATA__ - -=== TEST 1: set flags and get flags ---- config - location /flags { - echo 'set foo BAR (flag: 1234567890)'; - echo_subrequest PUT '/memc?key=foo&flags=1234567890' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags"; - - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (flag: 1234567890) -status: 201 -flags: 1234567890 -STORED\r -get foo -status: 200 -flags: 1234567890 -BAR" - - - -=== TEST 2: test empty flags (default to 0) ---- config - location /flags { - echo 'set foo BAR (flag: EMPTY)'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags"; - - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (flag: EMPTY) -status: 201 -flags: 0 -STORED\r -get foo -status: 200 -flags: 0 -BAR" - - - -=== TEST 3: test empty flags (default to 0) (another form) ---- config - location /flags { - echo 'set foo BAR (flag: EMPTY)'; - echo_subrequest PUT '/memc?key=foo&flags=' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags"; - - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (flag: EMPTY) -status: 201 -flags: 0 -STORED\r -get foo -status: 200 -flags: 0 -BAR" - - - -=== TEST 4: add flags and get flags ---- config - location /flags { - echo 'flush_all'; - echo_subrequest GET '/memc?cmd=flush_all'; - - echo 'add foo BAR (flag: 54321)'; - echo_subrequest POST '/memc?key=foo&flags=54321' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"flush_all -status: 200 -flags: -OK\r -add foo BAR (flag: 54321) -status: 201 -flags: 54321 -STORED\r -get foo -status: 200 -flags: 54321 -BAR" - - - -=== TEST 5: set invalid flags ---- config - location /allow { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'nice'; - set $memc_flags 'invalid'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -variable "$memc_flags" takes invalid value: invalid, - - - -=== TEST 6: set negative flags ---- config - location /allow { - set $memc_cmd 'set'; - set $memc_key 'sun'; - set $memc_value 'tree'; - set $memc_flags '-1'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 7: set flags and get flags in http time ---- config - location /flags { - echo 'set foo BAR (flag: 1264680563)'; - echo_subrequest PUT '/memc?key=foo&flags=1264680563' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags $memc_flags_as_http_time"; - - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (flag: 1264680563) -status: 201 -flags: 1264680563 Thu, 28 Jan 2010 12:09:23 GMT -STORED\r -get foo -status: 200 -flags: 1264680563 Thu, 28 Jan 2010 12:09:23 GMT -BAR" - - - -=== TEST 8: last-modified (conditional GET) ---- SKIP ---- config - location /memc { - set $memc_key $arg_key; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - - memc_flags_to_last_modified on; - add_header X-Flags $memc_flags; - } ---- request - GET /memc?key=foo ---- more_headers -If-Modified-Since: Thu, 28 Jan 2010 12:09:23 GMT ---- response_headers -Last-Modified: Thu, 28 Jan 2010 12:09:23 GMT -X-Flags: 1264680563 ---- error_code: 304 ---- response_body: - - - -=== TEST 9: last-modified (unconditional GET) ---- config - location /memc { - set $memc_key $arg_key; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - - memc_flags_to_last_modified on; - add_header X-Flags $memc_flags; - } ---- request - GET /memc?key=foo ---- response_headers -Last-Modified: Thu, 28 Jan 2010 12:09:23 GMT -X-Flags: 1264680563 ---- error_code: 200 ---- response_body: BAR - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/flush-all.t b/modules_deb/libnginx-mod-http-memc-0.20/t/flush-all.t deleted file mode 100644 index aeea8dc..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/flush-all.t +++ /dev/null @@ -1,120 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: flush_all ---- config - location /flush { - set $memc_cmd flush_all; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flush ---- response_body eval -"OK\r -" - - - -=== TEST 2: set and flush and get ---- config - location /main { - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val=blah'; - - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -^set foo blah -status: 201 -STORED\r -flush_all -status: 200 -OK\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 3: set exptime ---- config - location /exptime { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'flush_all exptime=2'; - echo_location '/memc?cmd=flush_all&exptime=2'; - - echo 'get foo - 0 sec'; - echo_location '/memc?key=foo'; - echo; - - echo_blocking_sleep 2; - - echo 'get foo - 2 sec'; - echo_location '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /exptime ---- response_body_like -flush_all -status: 200 -exptime: -OK\r -set foo BAR -status: 201 -exptime: 0 -STORED\r -flush_all exptime=2 -status: 200 -exptime: 2 -OK\r -get foo - 0 sec -status: 200 -exptime: -BAR -get foo - 2 sec -status: 404 -exptime: -.*?404 Not Found.*$ ---- timeout: 3 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/if.t b/modules_deb/libnginx-mod-http-memc-0.20/t/if.t deleted file mode 100644 index 89c5859..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/if.t +++ /dev/null @@ -1,30 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * (3 * blocks()); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: bad cmd ---- config - location /foo { - if ($uri ~* 'foo') { - set $memc_cmd flush_all; - } - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /foo ---- response_body eval -"OK\r\n" ---- no_error_log -[error] - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/incr-decr.t b/modules_deb/libnginx-mod-http-memc-0.20/t/incr-decr.t deleted file mode 100644 index 8412ec9..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/incr-decr.t +++ /dev/null @@ -1,292 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: value required for incr ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?cmd=incr&key=foo ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 2: invalid value for incr ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?cmd=incr&key=foo&val=nice ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -variable "$memc_value" is invalid for incr/decr: nice, - - - -=== TEST 3: invalid value (negative intenger) for incr ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?cmd=incr&key=foo&val=-5 ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 4: key required for incr ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?cmd=incr&val=2 ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- SKIP ---- TODO - - - -=== TEST 5: incr ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -incr 51 -status: 201 -exptime: -83\r -get foo -status: 200 -exptime: -83" - - - -=== TEST 6: decr ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'decr 13'; - echo_location '/memc?key=foo&cmd=decr&val=13'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -decr 13 -status: 201 -exptime: -19\r -get foo -status: 200 -exptime: -19" - - - -=== TEST 7: incr an non-existent key ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -^flush all -status: 200 -exptime: -OK\r -incr 51 -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 8: decr ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'decr 13'; - echo_location '/memc?key=foo&cmd=decr&val=13'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -decr 13 -status: 201 -exptime: -19\r -get foo -status: 200 -exptime: -19" - - - -=== TEST 9: incr an non-existent key (with fallback) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - - error_page 404 = /set_and_incr?$query_string; - } - - location /set_and_incr { - internal; - - echo_location /memc?cmd=add&key=$arg_key&val=0; - echo_location /memc?$query_string; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -exptime: -OK\r -incr 51 -status: 201 -exptime: 0 -STORED\r -status: 201 -exptime: -51\r -" - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive.t b/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive.t deleted file mode 100644 index e1292e6..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive.t +++ /dev/null @@ -1,41 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: keepalive ---- http_config - upstream backend { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - #server 127.0.0.1:11985; - #server 127.0.0.1:11986; - keepalive 2; - #hash $arg_key; - } - ---- config - location /memc { - set $memc_cmd set; - set $memc_key $arg_key; - set $memc_value 'value'; - memc_pass backend; - } ---- request - GET /memc?key=dog ---- response_body eval -"STORED\r -" ---- error_code: 201 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/incr-decr.t b/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/incr-decr.t deleted file mode 100644 index b03f1e8..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/incr-decr.t +++ /dev/null @@ -1,306 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -our $http_config = <<'_EOC_'; - upstream foo { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - keepalive 1; - } -_EOC_ - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: value required for incr ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /memc?cmd=incr&key=foo ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 2: invalid value for incr ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /memc?cmd=incr&key=foo&val=nice ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 3: invalid value (negative intenger) for incr ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /memc?cmd=incr&key=foo&val=-5 ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 4: key required for incr ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /memc?cmd=incr&val=2 ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- SKIP ---- TODO - - - -=== TEST 5: incr ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -incr 51 -status: 201 -exptime: -83\r -get foo -status: 200 -exptime: -83" - - - -=== TEST 6: decr ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'decr 13'; - echo_location '/memc?key=foo&cmd=decr&val=13'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -decr 13 -status: 201 -exptime: -19\r -get foo -status: 200 -exptime: -19" - - - -=== TEST 7: incr an non-existent key ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body_like -^flush all -status: 200 -exptime: -OK\r -incr 51 -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 8: decr ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'decr 13'; - echo_location '/memc?key=foo&cmd=decr&val=13'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -decr 13 -status: 201 -exptime: -19\r -get foo -status: 200 -exptime: -19" - - - -=== TEST 9: incr an non-existent key (with fallback) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - - error_page 404 = /set_and_incr?$query_string; - } - - location /set_and_incr { - internal; - - echo_location /memc?cmd=add&key=$arg_key&val=0; - echo_location /memc?$query_string; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -exptime: -OK\r -incr 51 -status: 201 -exptime: 0 -STORED\r -status: 201 -exptime: -51\r -" - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/storage.t b/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/storage.t deleted file mode 100644 index 69c2116..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/storage.t +++ /dev/null @@ -1,749 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() - 1); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -our $http_config = <<'_EOC_'; - upstream foo { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - keepalive 1; - } -_EOC_ - -#no_shuffle(); - -#no_diff; - -log_level('warn'); - -run_tests(); - -__DATA__ - -=== TEST 1: set only ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass foo; - } ---- request - GET /memc?key=foo&cmd=set&val=blah ---- response_body eval -"STORED\r\n" ---- error_code: 201 - - - -=== TEST 2: set and get ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val=blah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo blah -STORED\r -get foo -blah" - - - -=== TEST 3: set UTF-8 and get UTF-8 ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo 你好'; - echo_location '/memc?key=foo&cmd=set&val=你好'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo 你好 -STORED\r -get foo -你好" - - - -=== TEST 4: set and get empty values ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val='; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -OK\r -set foo blah -STORED\r -get foo -" - - - -=== TEST 5: add ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -get foo -status: 200 -added" - - - -=== TEST 6: set using POST ---- http_config eval: $::http_config ---- config - location /main { - echo_read_request_body; - - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo'; - echo_subrequest POST '/memc?key=foo&cmd=set'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass foo; - } ---- request -POST /main -hello, world ---- response_body eval -"flush all -status: 200 -OK\r -set foo -status: 201 -STORED\r -get foo -status: 200 -hello, world" - - - -=== TEST 7: default REST interface when no $memc_cmd is set ---- http_config eval: $::http_config ---- config - location /main { - echo_read_request_body; - - echo 'set foo FOO'; - echo_subrequest PUT '/memc?key=foo' -b FOO; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass foo; - } ---- request -GET /main ---- response_body eval -"set foo FOO -status: 201 -STORED\r -get foo -status: 200 -FOO -set foo BAR -status: 201 -STORED\r -get foo -status: 200 -BAR -" - - - -=== TEST 8: default REST interface when no $memc_cmd is set (read client req body) ---- http_config eval: $::http_config ---- config - location /main { - echo_read_request_body; - - echo 'set foo '; - echo_subrequest PUT '/memc?key=foo'; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass foo; - } ---- request -POST /main -rock ---- response_body eval -"set foo -status: 201 -STORED\r -get foo -status: 200 -rock -set foo BAR -status: 201 -STORED\r -get foo -status: 200 -BAR -" - - - -=== TEST 9: default REST interface when no $memc_cmd is set (read client req body) ---- http_config eval: $::http_config ---- config - location /main { - echo_read_request_body; - - echo 'set foo '; - echo_subrequest PUT '/memc?key=foo'; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'add foo BAR'; - echo_subrequest POST '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass foo; - } ---- request -POST /main -howdy ---- response_body eval -"set foo -status: 201 -STORED\r -get foo -status: 200 -howdy -add foo BAR -status: 200 -NOT_STORED\r -get foo -status: 200 -howdy -" - - - -=== TEST 10: test replace (stored) (without sleep) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - #echo_sleep 0.001; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -replace foo bah -status: 201 -STORED\r -get foo -status: 200 -bah" - - - -=== TEST 11: test replace (stored) (with sleep) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - echo_blocking_sleep 0.001; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - #echo_sleep 0.001; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - #echo_sleep 0.001; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -replace foo bah -status: 201 -STORED\r -get foo -status: 200 -bah" - - - -=== TEST 12: test replace (not stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -replace foo bah -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 13: test append (stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo hello'; - echo_location '/memc?key=foo&cmd=add&val=hello'; - - echo 'append foo ,world'; - echo_location '/memc?key=foo&cmd=append&val=,world'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo hello -status: 201 -STORED\r -append foo ,world -status: 201 -STORED\r -get foo -status: 200 -hello,world" - - - -=== TEST 14: test append (not stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'append foo ,world'; - echo_location '/memc?key=foo&cmd=append&val=,world'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -append foo ,world -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 15: test prepend (stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo hello'; - echo_location '/memc?key=foo&cmd=add&val=hello'; - - echo 'prepend foo world,'; - echo_location '/memc?key=foo&cmd=prepend&val=world,'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo hello -status: 201 -STORED\r -prepend foo world, -status: 201 -STORED\r -get foo -status: 200 -world,hello" - - - -=== TEST 16: test prepend (not stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'prepend foo world,'; - echo_location '/memc?key=foo&cmd=prepend&val=world,'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -prepend foo world, -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 17: set and get big value ---- http_config eval: $::http_config ---- config - location /big { - echo_read_request_body; - - client_body_buffer_size 1k; - client_max_body_size 100k; - - echo 'set big'; - echo_subrequest POST '/memc?key=big&cmd=set'; - - echo 'get big'; - echo_location '/memc?key=big&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass foo; - } ---- request eval -"POST /big\n" . - 'a' x (1024 * 1) . 'efg' - ---- response_body eval -"set big -STORED\r -get big -" . 'a' x (1024 * 1) . 'efg' ---- timeout: 5 - - - -=== TEST 18: set and get too big values ---- http_config eval: $::http_config ---- config - location /big { - client_body_buffer_size 1k; - client_max_body_size 100k; - - echo 'set big'; - echo_subrequest POST '/memc?key=big&cmd=set'; - - echo 'get big'; - echo_location '/memc?key=big&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass foo; - } ---- request eval -"POST /big\n" . - 'a' x (1024 * 100) . 'efg' ---- ignore_response ---- error_log -client intended to send too large body: 102403 bytes ---- timeout: 5 - - - -=== TEST 19: replace non-existent item ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'replace foo bar'; - echo_location '/memc?key=foo&cmd=replace&val=bar'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush_all -status: 200 -exptime: -OK\r -replace foo bar -status: 200 -exptime: 0 -NOT_STORED\r -" - - - -=== TEST 20: eval + memc ---- http_config eval: $::http_config ---- config - location /main { - eval $data { - proxy_pass $scheme://127.0.0.1:$server_port/foo; - } - set $memc_cmd set; - set $memc_key /foo; - set $memc_value $data; - memc_pass foo; - } - location /foo { - echo hello; - } ---- request - GET /main ---- response_body ---- SKIP - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/stats.t b/modules_deb/libnginx-mod-http-memc-0.20/t/stats.t deleted file mode 100644 index f412b42..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/stats.t +++ /dev/null @@ -1,45 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; -log_level('error'); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- timeout: 5 ---- config - location /stats { - set $memc_cmd stats; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /stats ---- response_body_like: ^(?:STAT [^\r]*\r\n)*END\r\n$ - - - -=== TEST 2: timeout ---- config - memc_connect_timeout 10ms; - memc_send_timeout 10ms; - location /stats { - set $memc_cmd stats; - memc_pass 127.0.0.2:12345; - } ---- request - GET /stats ---- response_body_like: 504 Gateway Time-out ---- timeout: 1 ---- error_code: 504 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/storage.t b/modules_deb/libnginx-mod-http-memc-0.20/t/storage.t deleted file mode 100644 index ee0706b..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/storage.t +++ /dev/null @@ -1,740 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_shuffle(); - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set only ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?key=foo&cmd=set&val=blah ---- response_body eval -"STORED\r\n" ---- error_code: 201 - - - -=== TEST 2: set and get ---- config - location /main { - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val=blah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo blah -STORED\r -get foo -blah" - - - -=== TEST 3: set UTF-8 and get UTF-8 ---- config - location /main { - echo 'set foo 你好'; - echo_location '/memc?key=foo&cmd=set&val=你好'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo 你好 -STORED\r -get foo -你好" - - - -=== TEST 4: set and get empty values ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val='; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -OK\r -set foo blah -STORED\r -get foo -" - - - -=== TEST 5: add ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -get foo -status: 200 -added" - - - -=== TEST 6: set using POST ---- config - location /main { - echo_read_request_body; - - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo'; - echo_subrequest POST '/memc?key=foo&cmd=set'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -hello, world ---- response_body eval -"flush all -status: 200 -OK\r -set foo -status: 201 -STORED\r -get foo -status: 200 -hello, world" - - - -=== TEST 7: default REST interface when no $memc_cmd is set ---- config - location /main { - echo 'set foo FOO'; - echo_subrequest PUT '/memc?key=foo' -b FOO; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /main ---- response_body eval -"set foo FOO -status: 201 -STORED\r -get foo -status: 200 -FOO -set foo BAR -status: 201 -STORED\r -get foo -status: 200 -BAR -" - - - -=== TEST 8: default REST interface when no $memc_cmd is set (read client req body) ---- config - location /main { - echo_read_request_body; - echo 'set foo '; - echo_subrequest PUT '/memc?key=foo'; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -rock ---- response_body eval -"set foo -status: 201 -STORED\r -get foo -status: 200 -rock -set foo BAR -status: 201 -STORED\r -get foo -status: 200 -BAR -" - - - -=== TEST 9: default REST interface when no $memc_cmd is set (read client req body) ---- config - location /main { - echo_read_request_body; - echo 'set foo '; - echo_subrequest PUT '/memc?key=foo'; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'add foo BAR'; - echo_subrequest POST '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -howdy ---- response_body eval -"set foo -status: 201 -STORED\r -get foo -status: 200 -howdy -add foo BAR -status: 200 -NOT_STORED\r -get foo -status: 200 -howdy -" - - - -=== TEST 10: test replace (stored) (without sleep) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - #echo_sleep 0.001; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -replace foo bah -status: 201 -STORED\r -get foo -status: 200 -bah" - - - -=== TEST 11: test replace (stored) (with sleep) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - echo_blocking_sleep 0.001; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - #echo_sleep 0.001; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - #echo_sleep 0.001; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -replace foo bah -status: 201 -STORED\r -get foo -status: 200 -bah" - - - -=== TEST 12: test replace (not stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -replace foo bah -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 13: test append (stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo hello'; - echo_location '/memc?key=foo&cmd=add&val=hello'; - - echo 'append foo ,world'; - echo_location '/memc?key=foo&cmd=append&val=,world'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo hello -status: 201 -STORED\r -append foo ,world -status: 201 -STORED\r -get foo -status: 200 -hello,world" - - - -=== TEST 14: test append (not stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'append foo ,world'; - echo_location '/memc?key=foo&cmd=append&val=,world'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -append foo ,world -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 15: test prepend (stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo hello'; - echo_location '/memc?key=foo&cmd=add&val=hello'; - - echo 'prepend foo world,'; - echo_location '/memc?key=foo&cmd=prepend&val=world,'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo hello -status: 201 -STORED\r -prepend foo world, -status: 201 -STORED\r -get foo -status: 200 -world,hello" - - - -=== TEST 16: test prepend (not stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'prepend foo world,'; - echo_location '/memc?key=foo&cmd=prepend&val=world,'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -prepend foo world, -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 17: set and get big value ---- config - location /big { - client_body_buffer_size 1k; - client_max_body_size 100k; - - echo_read_request_body; - echo 'set big'; - echo_subrequest POST '/memc?key=big&cmd=set'; - - echo 'get big'; - echo_location '/memc?key=big&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request eval -"POST /big\n" . - 'a' x (1024 * 1) . 'efg' - ---- response_body eval -"set big -STORED\r -get big -" . 'a' x (1024 * 1) . 'efg' ---- timeout: 2 - - - -=== TEST 18: set and get too big values ---- config - location /big { - client_body_buffer_size 1k; - client_max_body_size 100k; - - echo 'set big'; - echo_subrequest POST '/memc?key=big&cmd=set'; - - echo 'get big'; - echo_location '/memc?key=big&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request eval -"POST /big\n" . - 'a' x (1024 * 100) . 'efg' - ---- response_body_like: 413 Request Entity Too Large ---- error_code: 413 ---- timeout: 10 - - - -=== TEST 19: replace non-existent item ---- config - location /main { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'replace foo bar'; - echo_location '/memc?key=foo&cmd=replace&val=bar'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush_all -status: 200 -exptime: -OK\r -replace foo bar -status: 200 -exptime: 0 -NOT_STORED\r -" - - - -=== TEST 20: eval + memc ---- config - location /main { - eval $data { - proxy_pass $scheme://127.0.0.1:$server_port/foo; - } - set $memc_cmd set; - set $memc_key /foo; - set $memc_value $data; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - location /foo { - echo hello; - } ---- request - GET /main ---- response_body ---- SKIP - - - -=== TEST 21: set and get (binary data containing \0) ---- config - location /main { - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val=blah%00blah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set_unescape_uri $memc_key $arg_key; - set_unescape_uri $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo blah -STORED\r -get foo -blah\0blah" - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/upstream.t b/modules_deb/libnginx-mod-http-memc-0.20/t/upstream.t deleted file mode 100644 index a50fcac..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/upstream.t +++ /dev/null @@ -1,78 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- http_config - upstream backend { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location /stats { - set $memc_cmd stats; - memc_pass backend; - } ---- request - GET /stats ---- response_body_like: ^(?:STAT [^\r]*\r\n)*END\r\n$ ---- timeout: 3 - - - -=== TEST 2: sanity ---- http_config - upstream backend { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - server 127.0.0.1:11985; - server 127.0.0.1:11986; - #keepalive 2; - #hash $arg_key; - } - ---- config - location /memc { - set $memc_cmd set; - set $memc_key $arg_key; - set $memc_value 'value'; - memc_pass backend; - } ---- request - GET /memc?key=dog ---- response_body ---- error_code: 201 ---- timeout: 3 ---- SKIP - - - -=== TEST 3: sanity with dynamic backend ---- http_config - upstream backend { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location /stats { - set $memc_cmd stats; - memc_pass $arg_target; - } ---- request - GET /stats?target=backend ---- response_body_like: ^(?:STAT [^\r]*\r\n)*END\r\n$ ---- timeout: 3 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/used.t b/modules_deb/libnginx-mod-http-memc-0.20/t/used.t deleted file mode 100644 index 4e7b2ae..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/used.t +++ /dev/null @@ -1,67 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * (4 * blocks()); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: module not used ---- config - location /t { - content_by_lua ' - local v = ngx.var - ngx.say(v.memc_cmd, v.memc_exptime, v.memc_value, v.memc_key, v.memc_flags) - '; - } ---- request - GET /t ---- stap -F(ngx_http_memc_add_variable) { - printf("memc add variable \"%s\"\n", user_string_n($name->data, $name->len)) -} ---- stap_out ---- response_body -nilnilnilnilnil ---- no_error_log -[error] - - - -=== TEST 2: module used ---- config - location /t { - content_by_lua ' - local v = ngx.var - ngx.say(v.memc_cmd, v.memc_exptime, v.memc_value, v.memc_key, v.memc_flags) - '; - } - location /bah { - set $memc_key foo; - memc_pass 127.0.0.1:11211; - } ---- request - GET /t ---- stap -F(ngx_http_memc_add_variable) { - printf("memc add variable \"%s\"\n", user_string_n($name->data, $name->len)) -} ---- stap_out -memc add variable "memc_key" -memc add variable "memc_cmd" -memc add variable "memc_flags" -memc add variable "memc_exptime" -memc add variable "memc_value" - ---- response_body -nilnilnilnilnil ---- no_error_log -[error] - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/version.t b/modules_deb/libnginx-mod-http-memc-0.20/t/version.t deleted file mode 100644 index ae26ec8..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/version.t +++ /dev/null @@ -1,25 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: the "version" command ---- config - location /ver { - set $memc_cmd version; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /ver ---- response_body_like: ^VERSION \d+(\.\d+)+.*?\r\n$ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/util/build.sh b/modules_deb/libnginx-mod-http-memc-0.20/util/build.sh deleted file mode 100755 index 7defa6e..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/util/build.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# this file is mostly meant to be used by the author himself. - -ragel -I src -T1 src/ngx_http_memc_response.rl || exit 1 -util/fix-clang-warnings - -if [ $? != 0 ]; then - echo 'Failed to generate the memcached response parser.' 1>&2 - exit 1; -fi - -root=`pwd` -version=$1 -home=~ -force=$2 - -ngx-build $force $version \ - --with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB:/usr/local/lib" \ - --with-cc-opt="-O2" \ - --with-http_addition_module \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --without-http_upstream_ip_hash_module \ - --without-http_empty_gif_module \ - --without-http_referer_module \ - --without-http_autoindex_module \ - --without-http_auth_basic_module \ - --without-http_userid_module \ - --add-module=$root $opts \ - --add-module=$root/../ndk-nginx-module \ - --add-module=$root/../eval-nginx-module \ - --add-module=$root/../echo-nginx-module \ - --add-module=$root/../set-misc-nginx-module \ - --add-module=$root/../lua-nginx-module \ - --with-select_module \ - --with-poll_module \ - --with-debug - #--add-module=$home/work/nginx/nginx_upstream_hash-0.3 \ - #--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!) - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/util/fix-clang-warnings b/modules_deb/libnginx-mod-http-memc-0.20/util/fix-clang-warnings deleted file mode 100755 index 6b1bda6..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/util/fix-clang-warnings +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use File::Temp 'tempfile'; - -my $infile = "src/ngx_http_memc_response.c"; -my ($out, $outfile) = tempfile(); -open my $in, $infile - or die "Cannot open $infile for reading: $!\n"; -my $hits = 0; -while (<$in>) { - if (/ \b memc_ (?: storage | flush_all | version | stats | delete | incr_decr ) - _en_main \b /x) - { - #warn "HIT!"; - $hits++; - next; - } - print $out $_; -} -close $in; -close $out; -if ($hits) { - my $cmd = "cp $outfile $infile"; - system($cmd) == 0 - or die "Cannot run command \"$cmd\": $!"; -} -#die; - -__END__ - -This script is to fix the following clang warnings when using Ragel 6.8/6.9/etc: - -src/ngx_http_memc_response.c:33:18: error: unused variable 'memc_storage_en_main' [-Werror,-Wunused-const-variable] -static const int memc_storage_en_main = 1; - ^ -src/ngx_http_memc_response.c:46:18: error: unused variable 'memc_flush_all_en_main' [-Werror,-Wunused-const-variable] -static const int memc_flush_all_en_main = 1; - ^ -src/ngx_http_memc_response.c:59:18: error: unused variable 'memc_version_en_main' [-Werror,-Wunused-const-variable] -static const int memc_version_en_main = 1; - ^ -src/ngx_http_memc_response.c:72:18: error: unused variable 'memc_stats_en_main' [-Werror,-Wunused-const-variable] -static const int memc_stats_en_main = 1; - ^ -src/ngx_http_memc_response.c:85:18: error: unused variable 'memc_delete_en_main' [-Werror,-Wunused-const-variable] -static const int memc_delete_en_main = 1; - ^ -src/ngx_http_memc_response.c:98:18: error: unused variable 'memc_incr_decr_en_main' [-Werror,-Wunused-const-variable] -static const int memc_incr_decr_en_main = 1; - ^ -6 errors generated. diff --git a/modules_deb/libnginx-mod-http-memc-0.20/util/update-readme.sh b/modules_deb/libnginx-mod-http-memc-0.20/util/update-readme.sh deleted file mode 100755 index fd9c9d8..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/util/update-readme.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -perl util/wiki2pod.pl doc/readme.wiki > /tmp/a.pod \ - && pod2text /tmp/a.pod > README \ - && perl -i -pe 's{(https?://.*?)>}{$1 >}g' README - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/util/wiki2pod.pl b/modules_deb/libnginx-mod-http-memc-0.20/util/wiki2pod.pl deleted file mode 100644 index cdd33a2..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/util/wiki2pod.pl +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use bytes; - -my @nl_counts; -my $last_nl_count_level; - -my @bl_counts; -my $last_bl_count_level; - -sub fmt_pos ($) { - (my $s = $_[0]) =~ s{\#(.*)}{/"$1"}; - $s; -} - -sub fmt_mark ($$) { - my ($tag, $s) = @_; - my $max_level = 0; - while ($s =~ /([<>])\1*/g) { - my $level = length $&; - if ($level > $max_level) { - $max_level = $level; - } - } - - my $times = $max_level + 1; - if ($times > 1) { - $s = " $s "; - } - return $tag . ('<' x $times) . $s . ('>' x $times); -} - -print "=encoding utf-8\n\n"; - -while (<>) { - if ($. == 1) { - # strip the leading U+FEFF byte in MS-DOS text files - my $first = ord(substr($_, 0, 1)); - #printf STDERR "0x%x", $first; - #my $second = ord(substr($_, 2, 1)); - #printf STDERR "0x%x", $second; - if ($first == 0xEF) { - substr($_, 0, 1, ''); - #warn "Hit!"; - } - } - s{\[(http[^ \]]+) ([^\]]*)\]}{$2 (L<$1>)}gi; - s{ \[\[ ( [^\]\|]+ ) \| ([^\]]*) \]\] }{"L<$2|" . fmt_pos($1) . ">"}gixe; - s{(.*?)}{fmt_mark('C', $1)}gie; - s{'''(.*?)'''}{fmt_mark('B', $1)}ge; - s{''(.*?)''}{fmt_mark('I', $1)}ge; - if (s{^\s*<[^>]+>\s*$}{}) { - next; - } - - if (/^\s*$/) { - print "\n"; - next; - } - -=begin cmt - - if ($. == 1) { - warn $_; - for my $i (0..length($_) - 1) { - my $chr = substr($_, $i, 1); - warn "chr ord($i): ".ord($chr)." \"$chr\"\n"; - } - } - -=end cmt -=cut - - if (/(=+) (.*) \1$/) { - #warn "HERE! $_" if $. == 1; - my ($level, $title) = (length $1, $2); - collapse_lists(); - - print "\n=head$level $title\n\n"; - } elsif (/^(\#+) (.*)/) { - my ($level, $txt) = (length($1) - 1, $2); - if (defined $last_nl_count_level && $level != $last_nl_count_level) { - print "\n=back\n\n"; - } - $last_nl_count_level = $level; - $nl_counts[$level] ||= 0; - if ($nl_counts[$level] == 0) { - print "\n=over\n\n"; - } - $nl_counts[$level]++; - print "\n=item $nl_counts[$level].\n\n"; - print "$txt\n"; - } elsif (/^(\*+) (.*)/) { - my ($level, $txt) = (length($1) - 1, $2); - if (defined $last_bl_count_level && $level != $last_bl_count_level) { - print "\n=back\n\n"; - } - $last_bl_count_level = $level; - $bl_counts[$level] ||= 0; - if ($bl_counts[$level] == 0) { - print "\n=over\n\n"; - } - $bl_counts[$level]++; - print "\n=item *\n\n"; - print "$txt\n"; - } else { - collapse_lists(); - print; - } -} - -collapse_lists(); - -sub collapse_lists { - while (defined $last_nl_count_level && $last_nl_count_level >= 0) { - print "\n=back\n\n"; - $last_nl_count_level--; - } - undef $last_nl_count_level; - undef @nl_counts; - - while (defined $last_bl_count_level && $last_bl_count_level >= 0) { - print "\n=back\n\n"; - $last_bl_count_level--; - } - undef $last_bl_count_level; - undef @bl_counts; -} - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/valgrind.suppress b/modules_deb/libnginx-mod-http-memc-0.20/valgrind.suppress deleted file mode 100644 index a10fd57..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/valgrind.suppress +++ /dev/null @@ -1,93 +0,0 @@ -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_add_event -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_add_connection -} -{ - - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_init - fun:ngx_event_process_init -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_notify_init - fun:ngx_epoll_init -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_test_rdhup -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_worker_process_init - fun:ngx_worker_process_cycle -} -{ - - Memcheck:Param - epoll_pwait(sigmask) - fun:epoll_pwait - fun:epoll_wait - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - - Memcheck:Param - epoll_pwait(sigmask) - fun:epoll_pwait - fun:epoll_wait - fun:ngx_epoll_test_rdhup - fun:ngx_epoll_init - fun:ngx_event_process_init -} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/.gitignore b/modules_deb/libnginx-mod-http-ndk-0.3.4/.gitignore deleted file mode 100644 index 0fd79d0..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -tags -cscope.* -*~ -*.swp diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/LICENSE b/modules_deb/libnginx-mod-http-ndk-0.3.4/LICENSE deleted file mode 100644 index e1a5221..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2010-2018, Marcus Clyne - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/README.md b/modules_deb/libnginx-mod-http-ndk-0.3.4/README.md deleted file mode 100644 index d9d3972..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/README.md +++ /dev/null @@ -1,254 +0,0 @@ -Name -==== - -Nginx Development Kit (NDK) - -Table of Contents -================= - -* [Name](#name) -* [Synopsis](#synopsis) -* [Status](#status) -* [Features](#features) -* [Design](#design) - * [modular](#modular) - * [auto-generated & easily extensible](#auto-generated--easily-extensible) -* [Usage for users](#usage-for-users) - * [Building as a dynamic module](#building-as-a-dynamic-module) -* [Usage for developers](#usage-for-developers) - * [Warning: using NDK_ALL](#warning-using-ndk_all) -* [Modules using NDK](#modules-using-ndk) -* [TODO](#todo) -* [License](#license) -* [Contributing / Feedback](#contributing--feedback) -* [Authors](#authors) -* [Special Thanks](#special-thanks) - -Synopsis -======== - -The NDK is an Nginx module that is designed to extend the core functionality of the -excellent Nginx webserver in a way that can be used as a basis of other Nginx modules. - -It has functions and macros to deal with generic tasks that don't currently have -generic code as part of the core distribution. The NDK itself adds few features -that are seen from a user's point of view - it's just designed to help reduce the -code that Nginx module developers need to write. - -Nginx module developers wishing to use any of the features in the NDK should specify -that the NDK is a dependency of their module, and that users will need to compile -it as well when they compile their own modules. They will also need to declare in -their own modules which features of the NDK they wish to use (explained below). - -If you are not an Nginx module developer, then the only useful part of this project -will be the 'usage for users' section below. - -[Back to TOC](#table-of-contents) - -Status -====== - -The NDK is now considered to be stable. It is already being used in quite a few third -party modules (see list below). - -[Back to TOC](#table-of-contents) - -Features -======== - -* additional conf_set functions for regexes, complex/script values, paths... -* macros to simplify tasks like checking for NULL values when doing ngx_array_push -* patches to the main source code -* ngx_auto_lib_core generic external library handler is included (see separate readme) - -[Back to TOC](#table-of-contents) - -Design -====== - -modular -------- - -The kit itself is designed in a modular way, so that only the required code is compiled. -It's possible to add just a single NDK module, a few or all of them. - -[Back to TOC](#table-of-contents) - -auto-generated & easily extensible ----------------------------------- - -Many of the macros available in the NDK are auto-generated from simple configuration -files. This makes creating similar macros for your own code very simple - it's usually -just the case of adding an extra line to a config file and re-running the build script. - -[Back to TOC](#table-of-contents) - -Usage for users -=============== - -If another Nginx module you wish to use specifies that the NDK is a dependency, you -will need to do the following : - -1. download the source (https://github.com/simpl/ngx_devel_kit) -2. unpack the source (tar -xzf $name) -3. compile Nginx with the following extra option `--add-module=/path/to/ngx_devel_kit`. - -e.g. - -```bash -./configure --add-module=/path/to/ngx_devel_kit \ - --add-module=/path/to/another/module -``` - -[Back to TOC](#table-of-contents) - -Building as a dynamic module ----------------------------- - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ndk_http_module.so; -load_module /path/to/another/module.so; -``` - -[Back to TOC](#table-of-contents) - -Usage for developers -==================== - -To use the NDK in your own module, you need to add the following: - -1. add this line to your module - -```C -#include -``` - -Note: since the NDK includes the following lines - -```C -#include -#include -#include -``` - -you can replace these with the single include above. -2. add the following line in the config file for your module: - -```bash -have=NDK_[module_name] . auto/have -``` - -for each NDK module that you wish to use (you need to include auto/have multiple -times if you wish to use multiple NDK modules. - -Note: the old method of setting - -```config -CFLAGS="$CFLAGS -DNDK_[module_name]" -``` - -is now deprecated. It will still work, but results in unnecessary lines being -displayed when compiling Nginx. - -[Back to TOC](#table-of-contents) - -Warning: Using NDK_ALL ----------------------- - -You can also set `NDK_ALL` to include all the NDK modules. This is primarily as -a convenience in the early stages of development of another module. However, - -DO NOT LEAVE `NDK_ALL` IN YOUR CONFIG FILE WHEN PUBLISHING - -Although the NDK is fairly small now, it could in time become a large repository -of code that would, if using NDK_ALL, result in considerably more code being compiled -than is necessary. - -[Back to TOC](#table-of-contents) - -Modules using NDK -================= - -The following 3rd-party modules make use of NDK. - -* [ngx_http_lua_module](https://github.com/openresty/lua-nginx-module#readme) -* [ngx_http_set_misc_module](https://github.com/openresty/set-misc-nginx-module#readme) -* [ngx_http_encrypted_session_module](https://github.com/openresty/encrypted-session-nginx-module#readme) -* [ngx_http_form_input_module](https://github.com/calio/form-input-nginx-module#readme) -* [ngx_http_iconv_module](https://github.com/calio/iconv-nginx-module#readme) -* [ngx_http_array_var_module](https://github.com/openresty/array-var-nginx-module#readme) - -If you would like to add your module to this list, please let us know. - -[Back to TOC](#table-of-contents) - -TODO -==== - -* documentation for modules that don't already have it -* additional phase-handler functions -* generically testing for needing to add a handler -* remove dependency of set_var on OpenSSL being compiled in -* for backward compatability, add the ndk_macros - -[Back to TOC](#table-of-contents) - -License -======= - -Copyright (c) 2010-2018, Marcus Clyne - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are -permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, this list of -conditions and the following disclaimer in the documentation and/or other materials -provided with the distribution. -3. Neither the name of the copyright holder nor the names of its contributors may be used -to endorse or promote products derived from this software without specific prior -written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[Back to TOC](#table-of-contents) - -Contributing / Feedback -======================= - -If you are an Nginx module developer, and have developed some functions that are -generic in nature (or would be easily adapted to be so), then please send them to -me at the address below, and I'll addmclyne to the kit. - -[Back to TOC](#table-of-contents) - -Author -====== - -[Marcus Clyne](https://github.com/mclyne) - -[Back to TOC](#table-of-contents) - - -Special Thanks -============== - -A special thanks goes to [Yichun Zhang](https://github.com/agentzh) for helping to maintain -this module. - -[Back to TOC](#table-of-contents) diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/README_AUTO_LIB.md b/modules_deb/libnginx-mod-http-ndk-0.3.4/README_AUTO_LIB.md deleted file mode 100644 index f2c3371..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/README_AUTO_LIB.md +++ /dev/null @@ -1,394 +0,0 @@ -Nginx Auto Lib Core -=================== - -Nginx Auto Lib Core is a generic external library-handler that has been designed to -facilitate the inclusion of external libraries in modules for the Nginx web server. -It has been written both for the benefit of Nginx module developers and for the end -users of those Nginx modules, and can provide a consistent, intelligent, flexible -cross-platform way to include external libraries. - -Any developers of Nginx modules are encouraged to use Auto Lib Core to handle library -dependencies for their modules rather than writing their own custom handler from scratch. - -Note : The latest version can be found [here](https://github.com/simplresty/ngx_auto_lib). - - -Information for end users -========================= - -To include external libraries using Auto Lib to you may need or wish to export some -variables before you run configure. e.g. - -$ export MOZJS=/path/to/mozjs -$ export MOZJS_SHARED=NO -$ ./configure ... - -In all cases below [PFX] should be replaced with the name of the library (e.g. MOZJS). The -specific value for [PFX] should be mentioned in the README file for the module that -uses Auto Lib Core. - - -Search order for paths ----------------------- - -(1) [PFX]_INC and [PFX]_LIB -(2) [PFX] (source or install dir) -(3) any dirs under [PFX]_BASE (see below) -(4) any dirs under the parent directory of the Nginx source dir beginning with '[pfx]-' -(5) standard system paths (including /usr/local, /usr, /opt/local, /opt, /usr/pkg) - -If any of 1-3 are specified, then any set values will be searched, and the the Nginx -source's parent directory and system paths are not searched unless [PFX]_SEARCH_[PLACE] -variable is set to YES, where PLACE ::= PARENT | SYSTEM. e.g. - -$ export OPENSSL_LIB=/path/to/openssl/lib -$ export OPENSSL_INC=/path/to/openssl/inc -$ ./configure - -will search only in the lib and include paths specified, and - -$ export OPENSSL_LIB=/path/to/openssl/lib -$ export OPENSSL_INC=/path/to/openssl/inc -$ export OPENSSL_BASE=/path/to/openssl/base -$ export OPENSSL_SEARCH_PARENT=YES -$ ./configure --with-openssl=/path/to/openssl - -will search first in the lib & inc dirs specified, then in /path/to/openssl, then will -look for directories in /path/to/openssl/base and then in the Nginx source parent -directory, but will skip checking the system paths. - -Note : apart from system paths, all dirs are checked as both source and install directories, -so static versions of installed OpenSSL, PCRE, Zlib etc libraries can be used with Nginx -if desired. - - -Specifying a path to find a library ------------------------------------ - -If the version of a library you wish to include is in any of the standard paths (e.g. -/usr/local, /usr ...), you will not need to specify a path to include the library. - -If you do wish to specify a specific path, in most cases just specifying -[PFX]=/path/to/library will be sufficient. e.g. - -$ export MOZJS=/path/to/mozjs -$ ./configure ... - -The path can be either a source directory or an install directory. Auto Lib will search - - -Searching under base paths --------------------------- - -Rather than specifying a specific path to find new libraries in non-standard locations, -you may wish to specify a base path (or just let Auto Lib search the directory that the -Nginx source is located in). This will then automatically find the most recent versions -of libraries and check them before older versions. - -e.g. - -You have installations - -/openssl/version/0.9.8m -/openssl/version/1.0.0a -... - -$ export OPENSSL_BASE=/openssl/version -$ ./configure ... - -Any directories under /openssl/version will be searched IN REVERSE ORDER, i.e. most recent -version first. Here /openssl/version/1.0.0a would be searched before /openssl/version/0.9.8m. - -If [PFX]_BASE_SEARCH_PREFIX=YES, then only directories beginning with '[pfx]-' are searched. -If [PFX]_BASE_SEARCH_PREFIX=something, then only directories beginning with 'something' are -searched. - -When searching under [PFX]_BASE no prefix is added to the search, but when searching under -the directory that the Nginx source is located in, the prefix [pfx]- is automatically added. - -Note : there is currently a minor bug (due to the implementation of the 'sort' command) -means versions that include hyphens (e.g. 1.0.0-beta5) are checked before versions like -1.0.0a. This will be fixed soon, and searching of -build folders before normal source ones -will be added too. - - - -Shared or static? ------------------ - -The default for most libraries is to look for shared libraries, though this can be overridden -by the user by setting [PFX]_SHARED=NO. - -In the near future the default action will be to look for shared libraries then to look -for static libraries in each directory searched unless one of [PFX]_SHARED and/or -[PFX]_STATIC = NO. If both are set to NO, then Auto Lib will not be used at all. - - - -Variables that users can set to help find libraries ---------------------------------------------------- - -[PFX] Location of dir where the library can be found (PATH, see below) -[PFX]_INC Include dir for library headers (PATH) -[PFX]_LIB Lib dir for library archive/shared objects (PATH) -[PFX]_BASE Base dir under which to search for other dirs (PATH) -[PFX]_SEARCH_LIB_INC Search in [PFX]_INC and [PFX]_LIB if set (YES|NO, def=YES) -[PFX]_SEARCH_DIR Search [PFX] if set (YES|NO, def=YES) -[PFX]_SEARCH_BASE Search under [PFX]_BASE if set (YES|NO, def=YES) -[PFX]_SEARCH_PARENT Search under the dir that the Nginx source is in (YES|NO, see above) -[PFX]_SEARCH_SYSTEM Search in standard system paths (YES|NO, see above) -[PFX]_SHARED Use shared library rather than static (YES|NO, def=YES) -[PFX]_SYSTEM_DIRS System dirs to search in (PATHS, space-separated, overrides the defaults) -USE_[PFX] Whether or not to install the library (YES|NO, def=YES) - - -Note : for libraries that have configure options (e.g. --with-openssl=/path), the [PFX] -variable is set automatically by configure, so will not be used if exported. - - - -Information for module developers -================================= - -How Auto Lib Core works ------------------------ - -Auto Lib Core works as an interface layer between the module and the auto/feature part of -the Nginx source. This is the file that results in the 'checking for ...' lines that you -see when you call ./configure. - -auto/feature works by using a few key variables (see below) to generate some C code, trying -to compile it to see if it works and optionally running the code. This output file is called -autotest.c (located under the objs/ directory whilst configure is running, but is deleted -after each call to auto/feature). - -Normally, whenever an external library is required, a module developer will write a number -of calls to auto/feature manually in their config files - e.g. to check under a range of -different possible locations to find a library. Apart from being tedious, this is obviously -potentially error-prone. - -Auto Lib Core will automatically generate all the calls to auto/feature for you, and will -take into account different operating systems etc in a consistent way, 'intelligent' way. - - -Including Nginx Auto Lib Core with custom modules -------------------------------------------------- - -Option 1 : - -- include ngx_auto_lib_core in the same directory that your module config file is - located -- add the following line to your config file - - . $ngx_addon_dir/ngx_auto_lib_core - -NOTE : if you want to include the file in a different directory to your config -file, you will need to change both the include line in your config file AND -the line in the ngx_auto_lib_core file that points to the file (it's the line that -has $ngx_addon_dir/ngx_auto_lib_core in it) - -Option 2 : - -- make the Nginx Development Kit (github.com/simpl-it/ngx_devel_kit) a dependency - for your module (Auto Lib Core is included automatically with it) - - -Recommended way of including Auto Lib Core ------------------------------------------- - -If the Nginx Development Kit (NDK) is already a dependency for your module, then you do -not need to do anything - just follow the 'using Auto Lib Core' instructions below. - -If the NDK is not a dependency for your module, then it is recommended to include a -copy of ngx_auto_lib_core with your module, but to recommend to users of your module -to include the NDK when compiling. If the module is not required for anything else, this -will not make any difference to the Nginx binary that they compile, but will mean they -will get the latest version of Auto Lib Core (which probably won't change much anyway, -but you never know). - -You will also probably want to include a copy of this readme file for Auto Lib Core -(at least the user section), and mention what the relevant [PFX] you use for your module -is in your module's readme file so that users will know what to write for any variables -that they might use to control the search paths for libraries (see above user section). - - -Using Auto Lib Core -------------------- - -To use Auto Lib Core, you should do the following in your config file for each -external library that you want to include : - -1 - Call ngx_auto_lib_init -2 - Define any variables used for testing -3 - Define any hooks (custom functions) -4 - Call ngx_auto_lib_run - - -Calling ngx_auto_lib_init() and ngx_auto_lib_run() --------------------------------------------------- - -You can pass either one or two variables to ngx_auto_lib_init(). The first is the name of -the library as it will appear when running ./configure, the second is the prefix that is -used for internal variables and looking for directory prefixes. If the second is not -specified, it defaults to the first. - -The init function resets all key variables and functions, so it must be called before -setting any other variables or functions that are to be used as hooks (see the notes below). - -ngx_auto_lib_run() should be called in the config files after all the variables and hooks -have been defined. This will then run through all the tests to try to find the external -library. - - -Variables you can set in your config files ------------------------------------------- - -All the variables that you set in Auto Lib Core are similar to the ones you set for -including libraries in the normal way. - - name description ----------------------------------------------------------------------------------------- - -core variables (i.e. the ones in the core Nginx source) - -ngx_feature_inc_path CFLAGS and include path info (including -I) -ngx_feature_incs Include/define code inserted before main() in autotest.c -ngx_feature_libs External libraries to add (see below) -ngx_feature_path Space-separated include path -ngx_feature_run Whether to run the autotest binary (default = no) -ngx_feature_test C-code inserted inside main() in autotest.c - -extended variables (only work in NALC) : - -ngx_feature_add_libs Add libraries (but do not add include files) -ngx_feature_add_path Add extra directories to include path -ngx_feature_build_dirs Sub dirs that builds might be found -ngx_feature_build_inc_dirs Sub dirs that include files might be found -ngx_feature_build_lib_dirs Sub dirs that lib files might be found -ngx_feature_check_macros_defined Lib required only if one of these macros is defined -ngx_feature_check_macros_non_zero Lib required only if one of these macros is non-zero -ngx_feature_defines Define these macros if the library is found -ngx_feature_deps Deps to add (e.g. to CORE_DEPS) if the library is found -ngx_feature_exit_if_not_found Quit configure if the library is not found -ngx_feature_haves Set these macros to 1 if the library is found -ngx_feature_inc_names Names for include files (not including the .h) -ngx_feature_lib_files Add these files under the lib dir for static inclusions -ngx_feature_lib_names Names for lib files (not including -l or .a) -ngx_feature_modules Modules to add if the library is found -ngx_feature_srcs Sources to add (e.g. to ADDON_SRCS) if the lib is found -ngx_feature_shared If set to 'no', then only use static lib versions -ngx_feature_test_libs Add these libs when testing, but not to the final binary -ngx_feature_variables Set these variables if the library is found - -standard variables that are completely over-written (i.e. they won't work with NALC) : - -ngx_feature_name Message that is displayed after 'checking for' in configure - - -Using these variables ---------------------- - -You do not need to set most of these variables, since 'intelligent' guesses are made that -will work for most cases. With the exception of ngx_feature_test, you should generally use -the extended variables rather than the core ones, since sensible core variables will be -automatically generated from them, and will work for both static and shared libraries. - - -Variable defaults ------------------ - -ngx_feature_incs for i in $ngx_feature_inc_names { #include <$i.h> } -ngx_feature_libs for l in $ngx_feature_lib_names { -l$l or $LIB/lib$l.a } - + $ngx_feature_add_libs -ngx_feature_inc_names $ngx_feature_lib_names -ngx_feature_lib_names $pfx -pfx str_to_lower (if two variables are passed to ngx_auto_lib_init, then - then $2, otherwise, $1) - -The easiest way to understand how all the defaults work is probably to look at the source code -of ngx_auto_lib_test_setup() and to look at the examples in the standard Nginx Auto Lib module -which has code for OpenSSL, PCRE, Zlib, MD5 and SHA1. - - -Hooks ------ - -To facilitate using Auto Lib Core in a flexible way, a number of 'hooks' have been -placed in the testing cycle. These hooks are implemented as functions that you define -in your config file which are called if required by the core library. In the core -library they are left as empty functions that return either 0 or 1. Any functions -you write will - -Note : ngx_auto_lib_init() resets the variables and functions each time it is called, so -you must DEFINE HOOKS AFTER YOU CALL ngx_auto_lib_init. - -Note : an update on what hooks are available will be added later. To see what hooks are -available, just look in the source code of ngx_auto_lib_core for any functions that just -return 0 or 1. - -See the MD5 and SHA1 libraries of Nginx Auto Lib module for examples. - - - -Checking that a library is required ------------------------------------ - -Although in most cases Auto Lib Core will be used where external libraries are -definitely required (for a module to work), this may not always be the case. In the -standard Nginx Auto Lib module (github.com/simpl-it/ngx_auto_lib) - which is designed -to improve the inclusion of OpenSSL, PCRE and Zlib libraries and increase compilation -speed where possible - the libraries are not always required, so checks are made to -see if it is necessary. - - - -How Auto Lib Core checks if a library is required - ngx_auto_lib_check_require() ------------------------------------------------------------------------------------- - -- search for USE_[PFX]=YES (it is set to YES by default for most modules) -- search for any external libraries that have been included in the CORE_LIBS or ADDON_LIBS - variables that use the same lib name as any set in ngx_feature_lib_names -- search for any macros that have been defined either in the CFLAGS variable or using - auto/have or auto/define as set in the ngx_feature_check_macros_defined and - ngx_feature_ngx_macros_non_zero variables -- any custom checks implemented by creating an ngx_auto_lib_check hook function (which - should return 0 if the library is required and return 1 at the end if the module is - not required) - - - -Guaranteeing that the correct version of a shared library is linked at run time -------------------------------------------------------------------------------- - -Sometimes users will want to use shared libraries that are in non-standard locations -that the linker may have a problem in locating at run time - even if the correct -linker path (-L/path/to/lib) is supplied when checking. To make sure that the linker -can find the library at run time, and to make sure that the linker will use the correct -version of a library if the library is also located in a standard directory, a run path -is added to the linker flags (using -Wl,--rpath -Wl,/path/to/lib/dir). In most cases this -will guarantee that the correct library is used when linking - though care should be taken -by any users specifying specific paths for libraries that the correct version of the -library has been linked at run time (e.g. using ldd etc). - -As an additional check when running auto/feature, as well as the compilation of the -autotest.c file, a check is made by ldd to see that the path of the shared library -that the linker links to is the same as the one specified. This is done because - - -To do ------ - -- Change how library paths are searched to include both shared and static libraries -- Touch up documentation - - -License -------- - - BSD - - -Copyright ---------- - - [Marcus Clyne](https://github.com/mclyne) (c) 2010 diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/array b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/array deleted file mode 100644 index 04cd889..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/array +++ /dev/null @@ -1,10 +0,0 @@ - -array_create (a,pl,n,sz) a = %1%_array_create (pl,n,sz); if (a == NULL) %A% -array_init (a,pl,n,sz) if (%1%_array_init (a,pl,n,sz) == %E%) %A% -array_push (p,a) p = %1%_array_push (a); if (p == NULL) %A% -array_push_clean (p,a) p = %1%_array_push (a); if (p == NULL) %A%; %2%_zerop (p) -array_push_n (p,a,n) p = %1%_array_push_n (a,n); if (p == NULL) %A% -array_push_n_clean (p,a,n) p = %1%_array_push_n (a,n); if (p == NULL) %A%; %2%_zeropn (p,n) - - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/palloc b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/palloc deleted file mode 100644 index 6d430bd..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/palloc +++ /dev/null @@ -1,8 +0,0 @@ - -palloc (p,pl,sz) p = %1%_palloc (pl,sz); if (p == NULL) %A% -pallocp (p,pl) %2%_pallocp (p,pl); if (p == NULL) %A% -pallocpn (p,pl,n) %2%_pallocpn (p,pl,n); if (p == NULL) %A% -pcalloc (p,pl,sz) p = %1%_pcalloc (pl,sz); if (p == NULL) %A% -pcallocp (p,pl) %2%_pcallocp (p,pl); if (p == NULL) %A% -pcallocpn (p,pl,n) %2%_pcallocpn (p,pl,n); if (p == NULL) %A% - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/build b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/build deleted file mode 100644 index feb84b3..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/build +++ /dev/null @@ -1,597 +0,0 @@ -#! /bin/bash - -cd `dirname $0` - -if [ $# -eq 2 ]; -then - if [ `expr $2 : /` -eq 1 ]; - then - output_dir=$2 - else - output_dir=$1/$2 - fi -else - output_dir=../objs -fi - -list_file=data/action_list -types_file=data/action_types -reps_file=data/action_replacements -prefix_file=data/prefixes -header_file=data/header_files -optional_modules_file=data/modules_optional -headers_file=data/headers -module_dependencies_file=data/module_dependencies -conf_macros_file=data/conf_macros -conf_locs_file=data/conf_locs -conf_args_file=data/conf_args - -autogen_notice=text/autogen - -actions_dir=actions -srcs_dir=src -include_prefix= -file_prefix=ndk_ -auto_file_name=config -auto_includes_name=includes - -conf_merge_filename=conf_merge.h -conf_cmd_basic_filename=conf_cmd_basic.h -conf_cmd_extra_filename=conf_cmd_extra.h - - -spacer=¬ - -sed_delete_empty_lines='t_NEL;d;:_NEL' - - -function trim_lines { - sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' -} - - -function strtoupper { - [ $# -eq 1 ] || return 1 - local _str _cu _cl _x - _cu=(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) - _cl=(a b c d e f g h i j k l m n o p q r s t u v w x y z) - _str=$1 - for ((_x=0;_x<${#_cl[*]};_x++)); do - _str=${_str//${_cl[$_x]}/${_cu[$_x]}} - done - echo $_str -} - - -function sed_pad_right { - len=$1 - spacer=$2 - prefix=_PR$3 - - # returns a SED script that pads out (spaces) to the right to alignment $len - # this script should be used inside a call to sed - # NOTE : a spacer character $spacer should have already been written into the parsed string - - echo "t${prefix}a;:${prefix}a;s/^[^$spacer]{$len}/&/;\ -t${prefix}b;s/^[^$spacer]*/& /;t${prefix}a;:${prefix}b;s/$spacer/ /" -} - - -function sed_pad_left { - - len=$1 - spacer=$2 - prefix=_PL$3 - - # echo "t${prefix}a;:${prefix}a;s/^[^$spacer]{$len}/& /;t${prefix}a" # NOT CORRECT? -} - - -function add_notice { - - echo > $1 - cat $autogen_notice | trim_lines >> $1 - echo >> $1 - echo >> $1 -} - -function add_non_generated_content { - - file=src/$1.h - [ ! -f $file ] && return - - echo "/* Non-generated macros */" >> $2 - echo >> $2 - - cat $file | trim_lines >> $2 - - echo >> $2 - echo >> $2 -} - - -function add_action_macros { - - list_file=$actions_dir/$1 - - [ ! -f $list_file ] && return - - out=$2 - - - # alignment settings - - align1=20 - align2=35 - align3=62 - base_shrink=12 - define="#define " - - - - # base macros - - echo "/* base action macro macros */" >> $out - echo >> $out - - cat $list_file | trim_lines | sed -r \ - -e "s/^[ ]*([a-zA-Z0-9_]+)([ ]*)\(([a-zA-Z0-9_,]+)\)([ ]*)(.*)/$define%2%_\1_ac(\3,ac)\2\4 {\5;}/" \ - -e "s/[ ]{$base_shrink}\{/\{/" \ - -e 's/%A%/ac/g' \ - >> $out - - echo >> $out - echo >> $out - - - - # generated macros - - echo "/* generated action macros */" >> $out - echo >> $out - - cat -s $list_file | while read list_line; do - - [ "x`echo $list_line`" = 'x' ] && continue - - cat $types_file | while read type_line; do - - [ "x`echo $type_line`" = 'x' ] && continue - - #ext=`echo $type_line | grep -E '^[a-zA-Z0-9_]+' | cut -d " " -f1` - ext=`echo $type_line | sed -r 's/^([a-zA-Z0-9_]+).*/\1/'` - params=`echo $type_line | sed -r 's/^[a-zA-Z0-9_]+[ ]*\((.*)\).*/\1/;ta;d;:a'` - act=`echo $type_line | sed -r 's/^[a-zA-Z0-9_]+[ ]*(\(.*\))?(.*)/\2/'` - [ "x$params" != "x" ] && params=",$params" - - echo $list_line | sed -r \ - -e "s/^([a-zA-Z0-9_]+)[ ]*\(([a-zA-Z0-9_,]+)\).*/%2%_\1_$ext(\2$params)$spacer%2%_\1_ac$spacer(\2,$act)/" \ - -e 's/[ ]*,[ ]*/,/g' \ - -e "`sed_pad_right $align2 $spacer 1`" \ - -e "`sed_pad_right $align3 $spacer 2`" \ - -e "s/.*/$define&/" \ - >> $out - done - echo >> $out - done -} - - -function replace_prefixes { - - temp=.temp - - file=`cat $prefix_file` - - prefix1= - prefix2= - - for prefix in $file ; do - [ "x$prefix2" != "x" ] && echo "Too many prefixes in prefix file $prefix_file" && exit 1 - [ "x$prefix1" != "x" ] && prefix2=$prefix && continue - prefix1=$prefix - done - - sed -r "s/%1%/$prefix1/g;s/%2%/$prefix2/g" < $1 > $temp - - mv -f $temp $1 -} - - -function replace_other_strings { - - temp=.temp - - cat $reps_file | while read line; do - - rep1= - rep2= - - for rep in $line ; do - [ "x$rep2" != "x" ] && echo "Too many replacments in replacements file $reps_file" && exit 1 - [ "x$rep1" != "x" ] && rep2=$rep && continue - rep1=$rep - done - - sed -r "s/%$rep1%/$rep2/g" < $1 > $temp - mv -f $temp $1 - done -} - - -function generate_header_file { - - name=$1 - out=$output_dir/$file_prefix$name.h - - add_notice $out - add_non_generated_content $name $out - add_action_macros $name $out - replace_prefixes $out - replace_other_strings $out -} - - -function add_auto_include { - echo "#include <${file_prefix}$2>" >> $1 -} - - -function add_include { - echo "#include <${include_prefix}${file_prefix}$2>" >> $1 -} - - -function generate_non_optional_h_includes { - - # TODO : split into auto-generated and non-auto-generated ones - - echo "/* non-optional includes */" >> $1 - echo >> $1 - - for mod in `cat $headers_file | sort`; do - - add_auto_include $1 $mod.h - done - - echo >> $1 - echo >> $1 -} - - -function generate_include_all_includes { - - echo "/* include all optional modules */" >> $1 - echo >> $1 - echo "#ifdef NDK_ALL" >> $1 - echo >> $1 - - modules=`cat $optional_modules_file | sed 's/*//g' | sort` - - for mod in $modules; do - def="NDK_`strtoupper $mod`" - echo "#ifndef $def" >> $1 - echo "#define $def 1" >> $1 - echo "#endif" >> $1 - done - - echo >> $1 - echo "#endif" >> $1 - echo >> $1 - echo >> $1 -} - - -function generate_dependent_includes { - - echo "/* module dependencies */" >> $1 - echo >> $1 - - cat $module_dependencies_file | while read line; do - - first=1 - - for mod in $line; do - - def="NDK_`strtoupper $mod`" - - if [ $first = 1 ] ; then - - echo "#ifdef $def" >> $1 - first=0 - else - echo "#ifndef $def" >> $1 - echo "#define $def 1" >> $1 - echo "#endif" >> $1 - fi - done - - [ $first = 0 ] && echo "#endif" >> $1 - done - - echo >> $1 - echo >> $1 -} - - - -function generate_optional_h_includes { - - echo "/* optional includes */" >> $1 - echo >> $1 - - for mod in $modules; do - def="NDK_`strtoupper $mod`" - echo "#if ($def)" >> $1 - add_include $1 $mod.h - echo "#endif" >> $1 - done - - echo >> $1 - echo >> $1 -} - - - - - -function generate_conf_merge_macros_file { - - file=$conf_merge_filename - out_file=${file_prefix}$file - out=$output_dir/$out_file - - add_notice $out - - echo "/* conf-merge-value macros */" >> $out - echo >> $out - - cat $srcs_dir/$file | trim_lines >> $out - echo >> $out - echo >> $out - - echo "/* conf-merge-prop macros */" >> $out - echo >> $out - - echo "#define ndk_conf_merge_prop(prop,default)\\" >> $out - echo " ndk_conf_merge_value\\" >> $out - echo " (conf->prop, prev->prop, default)" >> $out - echo >> $out - - # loads macros, removes empty elements, sorts and translates to merge-prop macros - - cat $conf_macros_file | sed -r 's/^[A-Z0-9_]+[ ]*[A-Z0-9_]+[ ]*([a-z0-9_]+).*$/\1/;ta;d;:a' \ - | sort | sed -r \ - 's/(.*)/#define ndk_conf_merge_\1_prop(prop,default,...)\\\ - ndk_conf_merge_\1_value\\\ - (conf->prop, prev->prop, default,##__VA_ARGS__)\ - /' \ - >> $out - - add_auto_include $1 $file -} - - - - -function generate_conf_cmd_basic_file { - - temp=.rep - file=$conf_cmd_basic_filename - out_file=${file_prefix}$file - out=$output_dir/$out_file - - align1=35 - - # initial text - - add_notice $out - - - # add ndk bitmasks - - echo "/* conf cmd core values/bitmasks */" >> $out - echo >> $out - - - cat $conf_args_file | sort | trim_lines | sed -r \ - -e "s/^([A-Z0-9_]+)/${define}NDK_\1${spacer}NGX_\1/" \ - -e $sed_delete_empty_lines \ - -e "`sed_pad_right $align1 $spacer`" \ - >> $out - - echo >> $out - echo >> $out - - - # add additional bitmasks stored in file - - echo "/* conf cmd bitmasks */" >> $out - echo >> $out - - cat $srcs_dir/$conf_cmd_basic_filename | trim_lines >> $out - - echo >> $out - echo >> $out - - echo "/* conf cmd basic macros */" >> $out - echo >> $out - - - # build replacement string - - echo -n "s/^([A-Z0-9_]+)$/" > $temp - - cat $conf_locs_file | sed \ - -r -e 's/^([A-Z0-9_]+) *([A-Z0-9_]+).*/#define NDK_\1_CONF_\\1\(name,func,off1,off2,post)\\\\\\\ - {ngx_string (name),\\\\\\\ - NGX_CONF_\\1|NDK_\1_CONF,\\\\\\\ - func, off1, off2, post},\\\ -\\/' -e $sed_delete_empty_lines \ - >> $temp - - echo -n "/;$sed_delete_empty_lines" >> $temp - - - # apply the replacement string to the - - cat $conf_args_file | sort | trim_lines | sed -rf $temp >> $out - rm -f $temp - - add_auto_include $1 $file -} - - - -function generate_conf_cmd_extra_file { - - temp=.rep - file=$conf_cmd_extra_filename - out=$output_dir/${file_prefix}$file - - align1=35 - - # initial text - - add_notice $out - - echo "/* conf command macros */" >> $out - echo >> $out - - - # build replacement string - - echo -n 's/^([A-Z0-9_]+)[ ]*([A-Z0-9_]+)[ ]*([a-z0-9_]+).*$/' > $temp - - cat $conf_locs_file | sed \ - -r -e 's/^([A-Z0-9_]+)[ ]*([A-Z0-9_]+)[ ]*([a-zA-Z0-9_]+)/#define NDK_\1_CONF_\\1(name,p,post\)\\\\\\\ - NDK_\1_CONF_\\2\\\\\\\ - (name,\\\\\\\ - ndk_conf_set_\\3_slot,\\\\\\\ - NGX_\2_CONF_OFFSET,\\\\\\\ - offsetof (ndk_module_\3_conf_t, p),\\\\\\\ - post)\\\ -\\/' -e $sed_delete_empty_lines \ - >> $temp - - echo -n "/;$sed_delete_empty_lines" >> $temp - #echo -n ";`sed_pad_right 60 $spacer`" >> $temp - - - # apply the replacement string to the - - cat $conf_macros_file | sort | trim_lines | sed -rf $temp -e "`sed_pad_right 60 $spacer`" >> $out - rm -f $temp - - add_auto_include $1 $file -} - - - -function generate_auto_generated_h_includes { - - echo "/* auto-generated headers */" >> $1 - echo >> $1 - - for name in `cat $header_file | sort` ; do - - generate_header_file $name - add_auto_include $1 $name.h - done - - generate_conf_merge_macros_file $1 - generate_conf_cmd_basic_file $1 - generate_conf_cmd_extra_file $1 - - echo >> $1 - echo >> $1 -} - - - -function generate_optional_c_includes { - - echo "/* optional includes */" >> $1 - echo >> $1 - - modules=`cat $optional_modules_file | sed 's/*//g' | sort` - - for mod in $modules; do - def="NDK_`strtoupper "$mod"`" - echo "#if ($def)" >> $1 - add_include $1 $mod.c - echo "#endif" >> $1 - done - - echo >> $1 - echo >> $1 -} - - -function generate_commands { - - echo "/* module commands */" >> $1 - echo >> $1 - echo "static ngx_command_t ndk_http_commands[] = {" >> $1 - - cat $optional_modules_file | sort | while read line; do - - cmds=`echo "$line" | grep -E '\*'` - - [ "x$cmds" = "x" ] && continue - - mod=`echo "$line" | grep -E '^[a-zA-Z0-9_]+' | cut -d " " -f1` - up=`strtoupper $mod` - def="NDK_$up" - defcmd="NDK_${up}_CMDS" - - echo "#if ($def)" >> $1 - echo "#define $defcmd 1" >> $1 - add_include $1 $mod.h - echo "#undef $defcmd" >> $1 - echo "#endif" >> $1 - - done - - echo -e " ngx_null_command\n};" >> $1 -} - - -function generate_all_h_files { - - out=$output_dir/${file_prefix}$auto_file_name.h - - add_notice $out - - generate_include_all_includes $out - generate_dependent_includes $out - - out=$output_dir/${file_prefix}$auto_includes_name.h - - generate_optional_h_includes $out - generate_non_optional_h_includes $out - generate_auto_generated_h_includes $out $list -} - - -function generate_all_c_files { - - out=$output_dir/${file_prefix}$auto_file_name.c - - add_notice $out - generate_optional_c_includes $out - generate_commands $out -} - - - -function generate_all_files { - - mkdir -p $output_dir - rm -f $output_dir/* - - generate_all_h_files - generate_all_c_files -} - -generate_all_files diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_replacements b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_replacements deleted file mode 100644 index f419bc3..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_replacements +++ /dev/null @@ -1,5 +0,0 @@ - -OK NGX_OK -E NGX_ERROR -CE NGX_CONF_ERROR -COK NGX_CONF_OK diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_types b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_types deleted file mode 100644 index 284a5cb..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_types +++ /dev/null @@ -1,12 +0,0 @@ -r0 return 0 -r1 return 1 -r_1 return -1 -rok return %OK% -rce return %CE% -rcok return %COK% -re return %E% -rn return NULL -rse {ngx_script_error (e); return;} -sce {ngx_script_configure_error (c); return;} -g(_lb) goto _lb -ge goto error diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_args b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_args deleted file mode 100644 index 752b533..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_args +++ /dev/null @@ -1,22 +0,0 @@ - -TAKE1 -TAKE2 -TAKE3 -TAKE4 -TAKE5 -TAKE6 -TAKE7 -TAKE8 -TAKE12 -TAKE13 -TAKE23 -TAKE123 -TAKE1234 -1MORE -2MORE -ANY -FLAG -BLOCK -MULTI -ARGS_NUMBER - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_locs b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_locs deleted file mode 100644 index f5352c3..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_locs +++ /dev/null @@ -1,25 +0,0 @@ - -HTTP_MAIN HTTP_MAIN main -HTTP_SRV HTTP_SRV srv -HTTP_SIF HTTP_SRV srv -HTTP_LOC HTTP_LOC loc -HTTP_LIF HTTP_LOC loc - -HTTP_MAIN_SRV HTTP_SRV srv -HTTP_MAIN_SIF HTTP_SRV srv -HTTP_MAIN_LOC HTTP_LOC loc -HTTP_MAIN_LIF HTTP_LOC loc - -HTTP_SRV_LOC HTTP_LOC loc -HTTP_SRV_LIF HTTP_LOC loc -HTTP_SIF_LOC HTTP_LOC loc -HTTP_SIF_LIF HTTP_LOC loc - -HTTP_MAIN_SRV_LOC HTTP_LOC loc -HTTP_MAIN_SRV_LIF HTTP_LOC loc -HTTP_MAIN_SIF_LOC HTTP_LOC loc -HTTP_MAIN_SRV_SIF_LOC HTTP_LOC loc -HTTP HTTP_LOC loc -HTTP_UPS HTTP_LOC loc -HTTP_ANY HTTP_LOC loc -ANY HTTP_LOC loc diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_macros b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_macros deleted file mode 100644 index f42206a..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_macros +++ /dev/null @@ -1,35 +0,0 @@ - -BITMASK 1MORE bitmask -BUFS TAKE1 bufs -COMPLEX_KEYVAL TAKE2 http_complex_keyval -COMPLEX_PATH TAKE1 http_complex_path -COMPLEX_VALUE TAKE1 http_complex_value -COMPLEX_VALUE_ARRAY 1MORE http_complex_value_array -ENCODING TAKE1 encoding -ENUM TAKE1 enum -FALSE NOARGS false -FULL_PATH TAKE1 full_path -KEYVAL TAKE2 keyval -KEYVAL1 TAKE2 keyval1 -MSEC TAKE1 msec -NULL NOARGS null -NUM TAKE1 num -NUM64 TAKE1 num64 -NUM_FLAG TAKE1 num_flag -ONOFF FLAG flag -OFF TAKE1 off -PATH TAKE1 split_path -REXEX TAKE1 regex -REGEX_CL TAKE1 regex_caseless -REGEX_ARRAY 1MORE regex_array -REGEX_ARRAY_CL 1MORE regex_array_caseless -PTR NOARGS ptr -SEC TAKE1 sec -SEC_FLAG TAKE2 sec_flag -SIZE TAKE1 size -STR TAKE1 str -STR_ARRAY 1MORE str_array_multi -STR_ARRAY1 TAKE1 str_array -TRUE NOARGS true - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/contexts b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/contexts deleted file mode 100644 index e7e8ff0..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/contexts +++ /dev/null @@ -1,22 +0,0 @@ - -MAIN -SRV -SIF -LOC -LIF - -MAIN_SRV -MAIN_SIF -MAIN_LOC -MAIN_LIF -SRV_LOC -SRV_LIF -SIF_LOC -SIF_LIF - -MAIN_SRV_LOC -MAIN_SRV_LIF -MAIN_SIF_LOC -MAIN_SIF_LIF -ANY_MAIN - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/header_files b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/header_files deleted file mode 100644 index aa0f11c..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/header_files +++ /dev/null @@ -1,3 +0,0 @@ -array -palloc - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/headers b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/headers deleted file mode 100644 index 7583cb9..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/headers +++ /dev/null @@ -1,4 +0,0 @@ -http_headers -log -parse -string_util diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/module_dependencies b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/module_dependencies deleted file mode 100644 index a179316..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/module_dependencies +++ /dev/null @@ -1,5 +0,0 @@ -complex_path complex_value path -conf_file string -hash string -set_var rewrite -upstream_list http_create_main_conf diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/modules_optional b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/modules_optional deleted file mode 100644 index bbd6ec5..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/modules_optional +++ /dev/null @@ -1,15 +0,0 @@ -buf -complex_path -complex_value -conf_file -encoding -hash -http -path -process -regex -rewrite -set_var -string -upstream_list * -uri diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/prefixes b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/prefixes deleted file mode 100644 index ee53474..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/prefixes +++ /dev/null @@ -1,2 +0,0 @@ -ngx -ndk diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/array.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/array.h deleted file mode 100644 index a583759..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/array.h +++ /dev/null @@ -1,7 +0,0 @@ - -#define %2%_array_count(a) ((a)->nelts) -#define %2%_array_get_first(a) ((a)->elts) -#define %2%_array_get_index(a,n) ((void*) ((char*) (a)->elts + (a)->size * n)) -#define %2%_array_get_last(a) ((void*) ((char*) (a)->elts + (a)->size * ((a)->nelts - 1))) -#define %2%_array_get_reverse_index(a,n) ((void*) ((char*) (a)->elts + (a)->size * ((a)->nelts - 1 - n))) -#define %2%_array_push_clean(p,a) {p = %1%_array_push (a); %2%_zerop (p);} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_cmd_basic.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_cmd_basic.h deleted file mode 100644 index 38743a6..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_cmd_basic.h +++ /dev/null @@ -1,43 +0,0 @@ - -/* TODO : finish this */ - -#define NDK_HTTP_MAIN_CONF NGX_HTTP_MAIN_CONF -#define NDK_HTTP_SRV_CONF NGX_HTTP_SRV_CONF -#define NDK_HTTP_SIF_CONF NGX_HTTP_SIF_CONF -#define NDK_HTTP_LOC_CONF NGX_HTTP_LOC_CONF -#define NDK_HTTP_LIF_CONF NGX_HTTP_LIF_CONF -#define NDK_HTTP_UPS_CONF NGX_HTTP_UPS_CONF -#define NDK_MAIN_CONF NGX_MAIN_CONF -#define NDK_ANY_CONF NGX_ANY_CONF - - -/* compound locations */ - -#define NDK_HTTP_MAIN_SRV_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_CONF -#define NDK_HTTP_MAIN_SIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_SIF_CONF -#define NDK_HTTP_MAIN_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_MAIN_LIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_LOC_LIF_CONF - -#define NDK_HTTP_SRV_SIF_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_SIF_CONF -#define NDK_HTTP_SRV_LOC_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_SRV_LOC_LIF_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_LOC_LIF_CONF -#define NDK_HTTP_SRV_SIF_LOC_CONF NDK_HTTP_SRV_SIF_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_SRV_SIF_LOC_LIF_CONF NDK_HTTP_SRV_SIF_CONF|NDK_HTTP_LOC_LIF_CONF - -#define NDK_HTTP_LOC_LIF_CONF NDK_HTTP_LOC_CONF|NDK_HTTP_LIF_CONF - -#define NDK_HTTP_MAIN_SRV_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_LOC_CONF -#define NDK_HTTP_MAIN_SRV_LIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_LIF_CONF -#define NDK_HTTP_MAIN_SIF_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SIF_LOC_CONF -#define NDK_HTTP_MAIN_SRV_SIF_LOC_LIF_CONF NDK_HTTP_SRV_SIF_LOC_LIF_CONF|NDK_MAIN_CONF -#define NDK_HTTP_CONF NDK_HTTP_MAIN_SRV_SIF_LOC_LIF_CONF -#define NDK_HTTP_ANY_CONF NDK_HTTP_CONF|NDK_HTTP_UPS_CONF - - -/* property offsets NOTE : ngx_module_main_conf_t etc should be defined in the module's .c file before the commands */ - -#define NDK_HTTP_MAIN_CONF_PROP(p) NGX_HTTP_MAIN_CONF_OFFSET, offsetof (ndk_module_main_conf_t, p) -#define NDK_HTTP_SRV_CONF_PROP(p) NGX_HTTP_SRV_CONF_OFFSET, offsetof (ndk_module_srv_conf_t, p) -#define NDK_HTTP_LOC_CONF_PROP(p) NGX_HTTP_LOC_CONF_OFFSET, offsetof (ndk_module_loc_conf_t, p) - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_merge.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_merge.h deleted file mode 100644 index 1e3ba70..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_merge.h +++ /dev/null @@ -1,78 +0,0 @@ - -/* TODO : check that all the main types have a corresponding merge function */ - -#define ndk_conf_merge_value ngx_conf_merge_value -#define ndk_conf_merge_off_value ngx_conf_merge_off_value -#define ndk_conf_merge_ptr_value ngx_conf_merge_ptr_value -#define ndk_conf_merge_str_value ngx_conf_merge_str_value -#define ndk_conf_merge_size_value ngx_conf_merge_size_value - - -#define ndk_conf_merge_keyval_value(conf,prev,default) \ - \ - conf = prev ? prev : default; - -#define ndk_conf_merge_str_array_value(conf,prev,val1,...) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - if (prev == NGX_CONF_UNSET_PTR) { \ - if (val1 == NULL) { \ - conf = NULL; \ - } else { \ - char * elts[] = {val1,##__VA_ARGS__}; \ - int n = sizeof(elts)/sizeof(char*); \ - \ - conf = ndk_str_array_create (cf->pool, elts, n); \ - \ - if (conf == NULL) \ - return NGX_CONF_ERROR; \ - } \ - } else { \ - conf = prev; \ - } \ - } - -#define ndk_conf_merge_http_complex_value_value(conf,prev,default) \ - \ - if (!conf.str.len) { \ - if (prev.str.len) { \ - conf = prev; \ - } else { \ - conf.str.data = (u_char *) default; \ - conf.str.len = sizeof (default) - 1; \ - \ - if (ndk_http_complex_value_compile (cf, &conf)) \ - return NGX_CONF_ERROR; \ - } \ - } - -#define ndk_conf_merge_http_complex_value_array_value(conf,prev,val1,...) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - if (prev == NGX_CONF_UNSET_PTR) { \ - if (val1 == NULL) \ - conf = NULL; \ - else { \ - char * elts[] = {val1,##__VA_ARGS__}; \ - int n = sizeof(elts)/sizeof(char*); \ - \ - conf = ndk_http_complex_value_array_create (cf, elts, n); \ - \ - if (conf == NULL) \ - return NGX_CONF_ERROR; \ - } \ - } else { \ - conf = prev; \ - } \ - } - -#define ndk_conf_merge_http_complex_path_value(conf,prev,...) \ - ndk_conf_merge_http_complex_value_array_value (conf.a, prev.a, __VA_ARGS__) - -#define ndk_conf_merge_split_path_value(conf,prev,path) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - conf = (prev == NGX_CONF_UNSET_PTR ? \ - ndk_split_path_create_raw (cf, path) : prev); \ - } - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/palloc.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/palloc.h deleted file mode 100644 index 798e360..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/palloc.h +++ /dev/null @@ -1,6 +0,0 @@ - -#define %2%_pallocp(p,pl) p = %1%_palloc (pl,sizeof(*p)) -#define %2%_pallocpn(p,pl,n) p = %1%_palloc (pl,sizeof(*p)*(n)) - -#define %2%_pcallocp(p,pl) p = %1%_pcalloc (pl,sizeof(*p)) -#define %2%_pcallocpn(p,pl,n) p = %1%_pcalloc (pl,sizeof(*p)*(n)) diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/text/autogen b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/text/autogen deleted file mode 100644 index 6a244c2..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/text/autogen +++ /dev/null @@ -1,12 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/config b/modules_deb/libnginx-mod-http-ndk-0.3.4/config deleted file mode 100644 index 8cb7ad0..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/config +++ /dev/null @@ -1,65 +0,0 @@ - -############### -## FUNCTIONS ## -############### - -# TODO : provide information about checking versions of sed etc -# TODO : an optional patch function - -ndk_generate_files() { - echo "building Nginx Development Kit utility functions and macros ..." - - autobuild="$ngx_addon_dir/auto/build" - chmod +x $autobuild - $autobuild `pwd` $NGX_OBJS/addon/ndk || exit 1 -} - -ndk_get_nginx_version() { - # We get the Nginx version number from the string form rather than - # nginx_version because it is available in more (every?) version - - cat src/core/nginx.h | - grep '#define NGINX_VERSION' | - sed -r \ - -e 's/[^0-9.]*([0-9.]+).*/\1/' \ - -e 's/([0-9]+\.[0-9]+\.)([0-9]{1})$/\100\2/' \ - -e 's/([0-9]+\.[0-9]+\.)([0-9]{2})$/\10\2/' \ - -e 's/\.//g' \ - -e 's/^0+(.*)/\1/' -} - -##################### -## CONFIG SETTINGS ## -##################### - -ngx_addon_name=ngx_devel_kit -ngx_objs_dirs="$ngx_addon_dir/objs $NGX_OBJS/addon/ndk" - -NDK_SRCS="$ngx_addon_dir/src/ndk.c" -NDK_DEPS="$ngx_addon_dir/src/ndk.h" -NDK_INCS="$ngx_addon_dir/src $ngx_objs_dirs" - -CORE_INCS="$CORE_INCS $ngx_objs_dirs" -HTTP_INCS="$HTTP_INCS $ngx_addon_dir/src $ngx_objs_dir" - -if test -n "$ngx_module_link"; then - ngx_module_type=HTTP - ngx_module_name="ndk_http_module" - ngx_module_srcs="$NDK_SRCS" - ngx_module_deps="$NDK_DEPS" - ngx_module_incs="$NDK_INCS" - - . auto/module -else - HTTP_MODULES="$HTTP_MODULES ndk_http_module" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $NDK_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_SRCS $NDK_DEPS" -fi - -have=NDK . auto/have - -############## -## INCLUDES ## -############## - -. $ngx_addon_dir/ngx_auto_lib_core diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/changelog b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/changelog deleted file mode 100644 index 93ab9b1..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/changelog +++ /dev/null @@ -1,58 +0,0 @@ -libnginx-mod-http-ndk (1:0.3.4-2) unstable; urgency=medium - - * d/control: bump Standards-Version: 4.7.2, no changes - - -- Jan Mojžíš Fri, 11 Apr 2025 14:27:01 +0200 - -libnginx-mod-http-ndk (1:0.3.4-1) unstable; urgency=medium - - * New upstream version 0.3.4 - * d/{control,copyright}: update my email to "janmojzis@debian.org" - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - * d/control: bump Standards-Version: 4.7.0, no changes - * d/gbp.conf: add [pull] track-missing = True - - -- Jan Mojžíš Fri, 21 Mar 2025 08:50:27 +0100 - -libnginx-mod-http-ndk (1:0.3.3-1) unstable; urgency=medium - - * New upstream version 0.3.3 - - -- Jan Mojžíš Mon, 18 Dec 2023 16:23:15 +0100 - -libnginx-mod-http-ndk (1:0.3.2-5) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:27 +0200 - -libnginx-mod-http-ndk (1:0.3.2-4) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:39 +0200 - -libnginx-mod-http-ndk (1:0.3.2-3) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: bump my copyright year - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:32 +0100 - -libnginx-mod-http-ndk (1:0.3.2-2) unstable; urgency=medium - - * d/rules: enabled NDK upstream list module NDK_UPSTREAM_LIST - * d/control: added Multi-Arch: foreign - - -- Jan Mojžíš Tue, 06 Dec 2022 17:28:22 +0100 - -libnginx-mod-http-ndk (1:0.3.2-1) experimental; urgency=medium - - * Initial release. (Closes: 1024150) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:55 +0100 diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/control b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/control deleted file mode 100644 index b5eec8e..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/control +++ /dev/null @@ -1,47 +0,0 @@ -Source: libnginx-mod-http-ndk -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, -Standards-Version: 4.7.2 -Homepage: https://github.com/simpl/ngx_devel_kit -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-ndk.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-ndk -Rules-Requires-Root: no - -Package: libnginx-mod-http-ndk -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Nginx Development Kit module - The NDK is an Nginx module that is designed to extend the core functionality of - the excellent Nginx webserver in a way that can be used as a basis of other - Nginx modules. - . - It has functions and macros to deal with generic tasks that don't currently - have generic code as part of the core distribution. The NDK itself adds few - features that are seen from a user's point of view - it's just designed to help - reduce the code that Nginx module developers need to write. - -Package: libnginx-mod-http-ndk-dev -Architecture: all -Multi-Arch: foreign -Depends: libnginx-mod-http-ndk (<< ${source:Version}.1~), - libnginx-mod-http-ndk (>= ${source:Version}), - ${misc:Depends}, - ${shlibs:Depends}, -Description: Nginx Development Kit module - development files - The NDK is an Nginx module that is designed to extend the core functionality of - the excellent Nginx webserver in a way that can be used as a basis of other - Nginx modules. - . - This package provides development headers and necessary config scripts - for the Nginx development kit module, useful to develop and link third party - additions to the Debian nginx web/proxy server packages using Nginx - development kit module. - . - Development files. diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright deleted file mode 100644 index 50da8f9..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright +++ /dev/null @@ -1,155 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ngx_devel_kit -Upstream-Contact: Marcus Clyne -Source: https://github.com/simpl/ngx_devel_kit - -Files: * -Copyright: 2010-2018, Marcus Clyne -License: BSD-3-clause - -Files: auto/text/* -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022 - 2025, Jan Mojzis -License: BSD-3-clause - -Files: docs/patches/* -Copyright: Brian Moran - bmoran@onehub.com -License: BSD-3-clause - -Files: examples/* -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: examples/http/* -Copyright: 2010-2018, Marcus Clyne -License: BSD-3-clause - -Files: examples/http/set_var/ngx_http_set_var_examples_module.c -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: notes/* -Copyright: 2010, Marcus Clyne, Simpl (simpl.it) -License: BSD-3-clause - -Files: notes/CHANGES -Copyright: 2010-2018, Marcus Clyne -License: BSD-3-clause - -Files: objs/* -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: objs/ndk_includes.h -Copyright: 2010-2018, Marcus Clyne -License: BSD-3-clause - -Files: patches/expose_rewrite_functions -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: src/hash/* -Copyright: 1995-1998, Eric Young (eay@cryptsoft.com) -License: SSLeay - -Files: src/hash/murmurhash2.c -Copyright: Austin Appleby -License: BSD-3-clause - -Files: src/ndk.c - src/ndk.h - src/ndk_set_var.h -Copyright: Marcus Clyne -License: BSD-3-clause - -License: BSD-3-clause - All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -License: SSLeay - This software is Copyright (c) 2022 by X. Ample. - . - This is free software, licensed under: - . - Original SSLeay License - . - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - . - This library is free for commercial and non-commercial use as long as - the following conditions are aheared to. The following conditions - apply to all code found in this distribution, be it the RC4, RSA, - lhash, DES, etc., code; not just the SSL code. The SSL documentation - included with this distribution is covered by the same copyright terms - except that the holder is Tim Hudson (tjh@cryptsoft.com). - . - Copyright remains Eric Young’s, and as such any Copyright notices in the code - are not to be removed. If this package is used in a product, Eric Young - should be given attribution as the author of the parts of the library used. - This can be in the form of a textual message at program startup or in - documentation (online or textual) provided with the package. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - . - 1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - “This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)” - The word ‘cryptographic’ can be left out if the rouines from the library - being used are not cryptographic related :-). - 4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an - acknowledgement: “This product includes software written by Tim Hudson - (tjh@cryptsoft.com)” - . - THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ‘‘AS IS’’ AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - . - The licence and distribution terms for any publically available version or - derivative of this code cannot be changed. i.e. this code cannot simply be - copied and put under another distribution licence - [including the GNU Public Licence.] diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright-scan-patterns.yml b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright-scan-patterns.yml deleted file mode 100644 index 044c11d..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright-scan-patterns.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -ignore: - pattern: - - README_AUTO_LIB\.md diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/fix.scanned.copyright b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/fix.scanned.copyright deleted file mode 100644 index b5e57b8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/fix.scanned.copyright +++ /dev/null @@ -1 +0,0 @@ -! copyright Files:"docs/patches/*" Copyright=~s/\s\(.*// diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/gbp.conf b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/gbp.conf deleted file mode 100644 index 97cd209..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/gbp.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk-dev.install b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk-dev.install deleted file mode 100644 index d9988f1..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk-dev.install +++ /dev/null @@ -1,5 +0,0 @@ -debian/build-src/auto usr/share/nginx-ndk/src/ -debian/build-src/config usr/share/nginx-ndk/src/ -debian/build-src/ngx_auto_lib_core usr/share/nginx-ndk/src/ -debian/build-src/objs usr/share/nginx-ndk/src/ -debian/build-src/src usr/share/nginx-ndk/src/ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.install b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.install deleted file mode 100644 index c7a20b4..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ndk_http_module.so diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.nginx b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.nginx deleted file mode 100644 index ec2f484..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.nginx +++ /dev/null @@ -1 +0,0 @@ -mod debian/mod-http-ndk.conf 10 diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/mod-http-ndk.conf b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/mod-http-ndk.conf deleted file mode 100644 index 3908af6..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/mod-http-ndk.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ndk_http_module.so; diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/rules b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/rules deleted file mode 100755 index 42e9c85..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/rules +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -BUILDDIR_SRC = $(CURDIR)/debian/build-src -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) - -%: - dh $@ - -override_dh_auto_configure: - dh_auto_configure --buildsystem=nginx_mod - for have in NDK_SET_VAR NDK_UPSTREAM_LIST; do \ - ( \ - echo "#ifndef $$have"; \ - echo "#define $$have 1"; \ - echo "#endif"; \ - echo; \ - ) >> $(objdir)/ngx_auto_config.h; \ - done - -override_dh_auto_build: build.src - dh_auto_build --buildsystem=nginx_mod - -build.src: - mkdir -p $(BUILDDIR_SRC) - cp -Pa $(CURDIR)/auto config ngx_auto_lib_core $(BUILDDIR_SRC)/ - for i in src objs; do \ - find $(CURDIR)/$$i -type f -name '*.h' -printf "$$i/%P\0" | tar -C $(CURDIR) --null --files-from - -c | tar -C $(BUILDDIR_SRC)/ -x; \ - done - -override_dh_clean: - rm -rf $(BUILDDIR_SRC) - dh_clean diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/source/format b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/control b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/control deleted file mode 100644 index ca20b9f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/control +++ /dev/null @@ -1,6 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/generic b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/upstream/metadata b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/upstream/metadata deleted file mode 100644 index 51ef420..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/simpl/ngx_devel_kit/issues -Bug-Submit: https://github.com/simpl/ngx_devel_kit/issues/new -Repository-Browse: https://github.com/simpl/ngx_devel_kit \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/watch b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/watch deleted file mode 100644 index e0b5b75..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/simpl/ngx_devel_kit/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/action_macros b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/action_macros deleted file mode 100644 index 802eb1f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/action_macros +++ /dev/null @@ -1,63 +0,0 @@ - - GENERAL NOTES - ------------- - - These functions and macros have been provided as a tool for Nginx module developers. They have - been created with four main purposes: - - - to speed up code-writing - - to reduce the code you have to read on file - - to add additional generic functionality similar to exising Nginx functions - - to reduce code errors - - Most of the utility macros are just wrappers around commonly used code, especially checking for - NULL and returning a value, zeroing data etc. The functions add things like extra conf_set_X_slot - functions that don't exist in the standard Nginx distribution, but which might be useful in more - than one module. - - A consistent approach has been taken to creating the macros, so that in theory you should be able - to 'know' the macro name from using the few rules below and your knowledge of the existing Nginx - functions. As much as possible, the ordering of variables used within the underlying functions - remain the same, to reduce the learning time. Also, a constent naming pattern has been used to - make it easier to read the macros above. - - Obviously not all programmers will want to use all or any of these macros, but they are provided - as a tool for those who wish to use them. - - If you have any comments about them, including any additions or errors please let me know at - 'eugaia at gmail dot com'. I don't promise to include all additions people send, but if they seem - like they could be of use to multiple developers, I will. - - - UTILITY MACRO PARAMS - -------------------- - p pointer - used to set the result of a function to a pointer - a array - pl pool - n multiplication factor - for allocating multiple pointers & pushing 'n' elts in arrays etc - sz size - l log - rv return value - - - - UTILITY MACRO FUNCTION SUFFIXES - ------------------------------- - - - general - - p p = [FUNCTION] () - _r [ if result of function is NULL | NGX_ERROR (as appropriate) ] return rv - _rce rv = NGX_CONF_ERROR - _re rv = NGX_ERROR - _rn rv = NULL - - - (p)(c)alloc functions - - p p = [function] (pool, sizeof (*p)) - pn p = [function] (pool, sizeof (*p) * n) - - - UTILITY MACRO PARAMS ORDER - -------------------------- - p, pl|a, sz|n, l, rv diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/conf_cmds b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/conf_cmds deleted file mode 100644 index 70978b1..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/conf_cmds +++ /dev/null @@ -1,62 +0,0 @@ - -Conf command macros -------------------- - -The build script generates a large number of macros for reducing the code required for command -definitions. - -There are basically three types of macros : - -- combination bitmasks - - e.g. NDK_HTTP_MAIN_SRV_CONF = (NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF) - -- base command structures - - e.g. NDK_HTTP_MAIN_CONF_TAKE1 - -- conf-set command structures - - e.g. NDK_HTTP_CONF_STR - - -Combination bitmasks --------------------- - -Basically combinations of existing bitmasks for locations, with general > specific order - -NDK_HTTP_CONF = (NGX_HTTP_MAIN_CONF | NGX_HTTP_SVR_CONF | NGX_HTTP_SIF_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF) - - -Base command structures ------------------------ - -These macros are basically there as wrappers for the conf-set command structures, and but incorporate -the bitmask element into the name of the macro. - - -Conf-set command structures ---------------------------- - -These macros simplify creating commands that use any of the build-in conf-set functions or any of those -added by the NDK. - -e.g. NGX_HTTP_MAIN_SRV_STR ("name", prop, NULL) - -where prop is the name of the property that is a ngx_str_t. Whether this is in the loc conf, main conf -or svr conf is generated automatically in by the macro. - -NOTE : you need to set the following if they will be used (using macro definitions) : - -ndk_module_main_conf_t -ndk_module_srv_conf_t -ndk_module_loc_conf_t - -e.g - -#define ndk_module_loc_conf_t ngx_http_my_module_loc_conf_t - - -TODO ----- -Much better documentation for this diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/modules/set_var b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/modules/set_var deleted file mode 100644 index 6be5c0f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/modules/set_var +++ /dev/null @@ -1,124 +0,0 @@ - -set var tools -============= - -OVERVIEW --------- -This collection of tools is designed to make it easier to set Nginx variables -using a common interface. It works by plugging into and extending the features -of the internal rewrite module, and operations performed by this module are -therefore done at the rewrite phase of handling. - - -ADVANTAGES OF USING THIS MODULE -------------------------------- - -- simple interface - you don't have to worry about lots of http script compiling -- it plugs into the rewrite module, so setting (and getting) vars will happen - in the order you expect based on how they appear in the configuration file -- you do not have to worry about overriding the v->get_handler (useful if - a variable of a specific name could be set in multiple different ways) - - -WHEN TO USE THIS AND WHEN TO USE v->get_handler = my_func ---------------------------------------------------------- - -- if you want a variable to always be generated using a specific function, - and should not be over-ridden by 'set' functions (e.g. $request_uri, - $document_root), then you should use v->get_handler - -- if you want to allow a variable to be set using many possible methods, - including using the 'set' directive, then this module provides an easy way - for you to do so (if you use the v->get_handler method in this case, you may - run into problems because the get_handler may over-ride previous uses of the - set directive) - - -USAGE ------ - -- decide on the type of function you'll need to write - - type use when there are these requirements - ---- ------------------------------------- - NDK_SET_VAR_BASIC 0 variable values, no extra data - NDK_SET_VAR_DATA 0 variable values, extra data - NDK_SET_VAR_VALUE 1 variable value, no extra data - NDK_SET_VAR_VALUE_DATA 1 variable value, extra data - NDK_SET_VAR_MULTI_VALUE 2+ variable values, no extra data - NDK_SET_VAR_MULTI_VALUE_DATA 2+ variable values, extra data - NDK_SET_VAR_HASH the space needed for the result string - value is known in advance (usually - used in a hash function) - - NOTE : if none of these generic calling types suit your needs, it is - easy to extend the list of types in the .c file (and you if you let me know - I'll add them to the list - - -- define the filter function with the respective prototype - - type prototype - ---- --------- - NDK_SET_VAR_BASIC ndk_set_var_pt - NDK_SET_VAR_DATA ndk_set_var_data_pt - NDK_SET_VAR_VALUE ndk_set_var_value_pt - NDK_SET_VAR_DATA_VALUE ndk_set_var_value_data_pt - NDK_SET_VAR_MULTI_VALUE ndk_set_var_value_pt - NDK_SET_VAR_MULTI_VALUE_DATA ndk_set_var_value_data_pt - NDK_SET_VAR_HASH ndk_set_var_hash_pt - - (See ngx_tools_module.h for the prototype definitions.) - - Note : For the multi_value functions, the variable value pointer is to the - first value (with the others being in an array following it) - - -to use one of the default setup functions ------------------------------------------ - -- define one or multiple ngx_http_var_filter_t's at the global scope, setting : - - type = (one of types above) - func = function to call - size = (for multi value) the number of variable values - (for hash) length of buffer to allocate - data = (for data functions) additional data (see note below) - -- define a configuration directive (see in the .c file for examples), where the - function is 'ngx_http_set_var' and the 'post' is a pointer your filter definition - - -to setup in a customized way ----------------------------- - -- define a configuration directive which has your own specific configuration function - -- inside your config function, define one or several ngx_http_var_filter_t's like - above, and call one of the ngx_http_set_var_..._core functions, passing the - variable name and value pointers as appropriate - see examples section - -Note : if you're passing extra data to the function, then you will probably want -to use this second method and store the data either in the loc conf, or just -allocate the space for it using one of the ngx_palloc functions. - -If the values that will be used for processing are in the same order as in the -config file and there aren't any additional values that are input, then you can -just use the (ngx_str_t *) (cf->args->elts) + 1 as your base for the values or -possibly not use the _core versions of the functions. - - -That's it! - - -FEEDBACK --------- - -If you have any comments (good/bad), or have found any bugs, please let me know at: -ngx.eugaia AT gmail DOT com - - -TODO ----- -- add more documentation/examples - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/patches/more_logging_info b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/patches/more_logging_info deleted file mode 100644 index 3685916..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/patches/more_logging_info +++ /dev/null @@ -1,48 +0,0 @@ -When tracking down some potential issues in the nginx constellation, -we've found it useful to understand where particular error messages -are coming from, since many of the same messages are repeated in -various places. This patch will write the source file from which the -message originated, the function name, and the line number if you're -using GCC to compile nginx. Here's an example: - -Old Output: -2010/01/12 14:43:10 [notice] 67772#0: nginx/0.7.64 -2010/01/12 14:43:10 [notice] 67772#0: built by gcc 4.0.1 (Apple Inc. build 5490) -2010/01/12 14:43:10 [notice] 67772#0: OS: Darwin 9.8.0 -2010/01/12 14:43:10 [notice] 67772#0: hw.ncpu: 2 -2010/01/12 14:43:10 [notice] 67772#0: net.inet.tcp.sendspace: 65536 -2010/01/12 14:43:10 [notice] 67772#0: kern.ipc.somaxconn: 128 -2010/01/12 14:43:10 [notice] 67772#0: getrlimit(RLIMIT_NOFILE): -256:9223372036854775807 -2010/01/12 14:43:10 [notice] 67772#0: start worker processes -2010/01/12 14:43:10 [notice] 67772#0: start worker process 67785 -2010/01/12 14:43:16 [notice] 67772#0: signal 20 (SIGCHLD) received - -New Output: -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_posix_init.c -ngx_os_status( 80) nginx/0.7.64 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_posix_init.c -ngx_os_status( 83) built by gcc 4.0.1 (Apple Inc. build 5490) -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_darwin_init.c -ngx_os_specific_status( 153) OS: Darwin 9.8.0 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_darwin_init.c -ngx_os_specific_status( 166) hw.ncpu: 2 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_darwin_init.c -ngx_os_specific_status( 166) net.inet.tcp.sendspace: 65536 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_darwin_init.c -ngx_os_specific_status( 166) kern.ipc.somaxconn: 128 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_posix_init.c -ngx_os_status( 92) getrlimit(RLIMIT_NOFILE): -2560:9223372036854775807 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_process_cycle.c -ngx_start_worker_processes( 337) start worker processes -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_process.c -ngx_spawn_process( 201) start worker process 27254 -2010/01/14 16:35:14 [notice] 27241#0: src/os/unix/ngx_process.c -ngx_signal_handler( 420) signal 20 (SIGCHLD) received - -Formatting the filename and function name fields into fixed-width -fields would be nicer, however that would require further changes in -src/core/ngx_string.c - -(C) Brian Moran - bmoran@onehub.com (posted to nginx-devel mailing list on 15/01/10) diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/upstream/list b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/upstream/list deleted file mode 100644 index 3ad485d..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/upstream/list +++ /dev/null @@ -1,45 +0,0 @@ - -NDK_UPSTREAM_LIST ------------------ - -This submodule provides a directive that creates a list of upstreams, with -optional weighting. This list can then be used by other modules to hash over -the upstreams however they choose. - - -USAGE IN CONF FILE ------------------- - -e.g. upstream_list name backend1 4:backend2 3:backend3; - - - -USAGE WITH OTHER MODULES ------------------------- - -Add a line like - -CFLAGS="$CFLAGS -DNDK_UPSTREAM_LIST" - -to the config file of your module. - - - -INTEGRATING WITH YOUR MODULE ----------------------------- - -The upstream lists are stored in the array given in the lists.h file, which is -an array of ndk_upstream_list_t elts. The elts are currently all pointers to -strings which have been distributed according to the weight - so if there are -two backends, with weight 3 and 4 respectively, there will be 7 pointers in -total with the first 3 pointing to the first backend and the last 4 to the -second. - - - -TODO ----- -- replace strings with pointers to upstreams if they are available (and if - this is possible) -- add additional 'http://' to strings if necessary -- improve this documentation diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/README b/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/README deleted file mode 100644 index 22e2417..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/README +++ /dev/null @@ -1,12 +0,0 @@ - -2010 (C) Marcus Clyne - - -Examples --------- - -In this section there are a number of examples of the various features of the tools -module. These have been given in the form of dummy modules, to make it easier to -use as templates for your own module should you choose to do so. - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/config b/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/config deleted file mode 100644 index aa58f77..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/config +++ /dev/null @@ -1,4 +0,0 @@ -ngx_addon_name=ngx_http_set_var_examples_module -HTTP_MODULES="$HTTP_MODULES ngx_http_set_var_examples_module" -NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_set_var_examples_module.c" -have=NDK_SET_VAR . auto/have \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/ngx_http_set_var_examples_module.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/ngx_http_set_var_examples_module.c deleted file mode 100644 index 7a4daae..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/ngx_http_set_var_examples_module.c +++ /dev/null @@ -1,136 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - */ - - -#include - - -static ngx_int_t ngx_http_set_var_concat2 (ngx_http_request_t *r, ngx_str_t *val, ngx_http_variable_value_t *v); -static char * ngx_http_set_prepend_hello (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - - -static ndk_set_var_t ngx_http_var_set_concat2 = { - NDK_SET_VAR_MULTI_VALUE, - ngx_http_set_var_concat2, - 2, - NULL -}; - - -static ngx_command_t ngx_http_set_var_examples_commands[] = { - { - ngx_string ("set_concat2"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ndk_set_var_multi_value, - 0, - 0, - &ngx_http_var_set_concat2 - }, - { - ngx_string ("set_prepend_hello"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_set_prepend_hello, - 0, - 0, - NULL - }, - ngx_null_command -}; - - -ngx_http_module_t ngx_http_set_var_examples_module_ctx = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; -ngx_module_t ngx_http_set_var_examples_module = { - - NGX_MODULE_V1, - &ngx_http_set_var_examples_module_ctx, // module context - ngx_http_set_var_examples_commands, // module directives - NGX_HTTP_MODULE, // module type - NULL, // init master - NULL, // init module - NULL, // init process - NULL, // init thread - NULL, // exit thread - NULL, // exit process - NULL, // exit master - NGX_MODULE_V1_PADDING -}; - - -/* - This function is called by both examples, takes two variable values and concatenates them - to give a third string. -*/ - -static ngx_int_t -ngx_http_set_var_concat2 (ngx_http_request_t *r, ngx_str_t *val, ngx_http_variable_value_t *v) -{ - size_t len; - ngx_http_variable_value_t *v2; - u_char *p; - - v2 = v + 1; - - len = v->len + v2->len; - - /* - * NDK provided abbreviation for the following code: - * - * p = ngx_palloc (r->pool, len); - * if (p == NULL) - * return NGX_ERROR; - * - * */ - ndk_palloc_re(p, r->pool, len); - - val->data = p; - val->len = len; - - ngx_memzero (p, len); - - p = ngx_cpymem (p, v->data, v->len); - ngx_memcpy (p, v2->data, v2->len); - - return NGX_OK; -} - - - -/* - This function demonstrates using the 'core' function in a function that appends the word - 'hello_' to the beginning of a variable. - - set $var world; - set_prepend_hello $var $var; - - If the arguments used in the variable value filter do not all come directly from the conf - file, or are not given in the order - - direcive $var_name val1 "val2 string $var" ... - - then the _core functions should be used inside the function that is called when the directive - is read. -*/ - -static char * -ngx_http_set_prepend_hello (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t s[2], *var_name; - ndk_set_var_t filter; - - var_name = cf->args->elts; - var_name++; - - s[0].data = (u_char*) "hello_"; - s[0].len = 6; - - s[1] = *(var_name + 1); - - filter.type = NDK_SET_VAR_MULTI_VALUE; - filter.func = ngx_http_set_var_concat2; - filter.size = 2; - - return ndk_set_var_multi_value_core (cf, var_name, (ngx_str_t *) s, &filter); -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/ngx_auto_lib_core b/modules_deb/libnginx-mod-http-ndk-0.3.4/ngx_auto_lib_core deleted file mode 100644 index d5441fb..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/ngx_auto_lib_core +++ /dev/null @@ -1,797 +0,0 @@ - -## Directories to search for usable builds: -## -## - [$PFX]_INC and [$PFX]_LIB -## - the dir specified by --with-[$pfx]=* -## - each dir named [$pfx]-* under [$PFX]_BASE (descending order) -## - each dir named [$pfx]-* under $ngx_src_dir/.. (descending order) -## - system_paths (see below) -## -## Note : specifying [$PFX]_INC or [$PFX]_LIB prevents other dirs being tried -## specifying --with-[$pfx]= prevents autodiscovery of dirs -## -## Note : if this file is not in the same directory as the config file, the value -## for ngx_auto_lib_file should be changed to a relative path from that file -## e.g. : $ngx_addon_dir/libs/ngx_auto_lib -## -## TODO : explain hooks - -############# -## VERSION ## -############# - -ngx_auto_lib_version=1001 - -if [ ! $ngx_auto_lib_file_version ] || [ $ngx_auto_lib_file_version -lt $ngx_auto_lib_version ]; then - - if [ ! $ngx_addon_dir ]; then - ngx_addon_dir=`cd $(dirname $0); pwd` - fi - - ngx_auto_lib_file="$ngx_addon_dir/ngx_auto_lib_core" - ngx_auto_lib_file_version="$ngx_auto_lib_version" -fi - -############### -## VARIABLES ## -############### - -v= -v="$v inc_path" -v="$v incs" -v="$v libs" -v="$v name" -v="$v path" -v="$v run" -v="$v test" -ev= -ev="$ev add_libs" -ev="$ev add_path" -ev="$ev build_dirs" -ev="$ev build_inc_dirs" -ev="$ev build_lib_dirs" -ev="$ev check_macros_defined" -ev="$ev check_macros_non_zero" -ev="$ev defines" -ev="$ev deps" -ev="$ev exit_if_not_found" -ev="$ev haves" -ev="$ev inc_names" -ev="$ev lib_files" -ev="$ev lib_names" -ev="$ev libs_to_add" -ev="$ev modules" -ev="$ev srcs" -ev="$ev shared" -ev="$ev test_libs" -ev="$ev variables" - -ngx_feature_vars="$v" -ngx_feature_extra_vars="$ev" -ngx_feature_all_vars="$v $ev" - -NGX_AUTO_LIB_DEFAULT_SYSTEM_DIRS='/usr/local /usr /opt/local /opt /usr/pkg' - -#################### -## UTIL FUNCTIONS ## -#################### - -to_upper() { - echo "$@" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -} - -to_lower() { - echo "$@" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' -} - -#################### -## INIT FUNCTIONS ## -#################### - -ngx_auto_lib_init() { - - . $ngx_auto_lib_file - - ngx_auto_lib_init_latest $@ -} - -ngx_auto_lib_init_latest() { - - # set name and prefixes - - if [ ! $1 ]; then - echo "ngx_auto_lib_init() requires that a name be passed" - exit 1 - fi - - ngx_auto_lib_name=$1 - ngx_auto_lib_module_name=$2 - - if [ $2 ]; then - NGX_AUTO_LIB_PFX=`to_upper $2` - else - NGX_AUTO_LIB_PFX=`to_upper $1` - fi - - ngx_auto_lib_pfx=`to_lower $NGX_AUTO_LIB_PFX` - - ngx_auto_lib_clean_feature_vars -} - -ngx_auto_lib_clean_feature_vars() { - for var in $ngx_feature_all_vars; do - eval ngx_feature_$var= - done -} - -ngx_auto_lib_get_variables() { - - local pfx=$ngx_auto_lib_pfx - local PFX=$NGX_AUTO_LIB_PFX - - eval NGX_AUTO_LIB_INC=\"\$${PFX}_INC\" - eval NGX_AUTO_LIB_LIB=\"\$${PFX}_LIB\" - eval NGX_AUTO_LIB_DIR=\"\$${PFX}\" - eval NGX_AUTO_LIB_BASE=\"\$${PFX}_BASE\" - eval NGX_AUTO_LIB_SEARCH_LIB_INC=\"\$${PFX}_SEARCH_LIB_INC\" - eval NGX_AUTO_LIB_SEARCH_DIR=\"\$${PFX}_SEARCH_DIR\" - eval NGX_AUTO_LIB_SEARCH_BASE=\"\$${PFX}_SEARCH_BASE\" - eval NGX_AUTO_LIB_SEARCH_BASE_PREFIX=\"\$${PFX}_SEARCH_BASE_PREFIX\" - eval NGX_AUTO_LIB_SEARCH_PARENT=\"\$${PFX}_SEARCH_PARENT\" - eval NGX_AUTO_LIB_SEARCH_SYSTEM=\"\$${PFX}_SEARCH_SYSTEM\" - eval NGX_AUTO_LIB_SHARED=\"\$${PFX}_SHARED\" - eval NGX_AUTO_LIB_SYSTEM_DIRS=\"\$${PFX}_SYSTEM_DIR\" - eval USE_NGX_AUTO_LIB=\"\$USE_${LIB}\" - - if [ ! "$NGX_AUTO_LIB_DIR" ]; then - NGX_AUTO_LIB_DIR=NONE - fi - - if [ ! "$USE_NGX_AUTO_LIB" ]; then - if [ $ngx_feature_check_macros_defined -o $ngx_feature_check_macros_non_zero ]; then - USE_NGX_AUTO_LIB=MAYBE - elif [ "$ngx_feature_required" = no ]; then - USE_NGX_AUTO_LIB=MAYBE - else - USE_NGX_AUTO_LIB=YES - fi - fi - - if [ ! "$NGX_AUTO_LIB_SYSTEM_DIRS" ]; then - NGX_AUTO_LIB_SYSTEM_DIRS=$NGX_AUTO_LIB_DEFAULT_SYSTEM_DIRS - fi - - # TODO : add _STATIC, and do searches for both static and shared libs - - if [ ! "$NGX_AUTO_LIB_SHARED" ]; then - if [ "$ngx_feature_shared" = no ]; then - NGX_AUTO_LIB_SHARED=NO - else - NGX_AUTO_LIB_SHARED=YES - fi - fi - - NGX_AUTO_LIB_SEARCH_DEP=NO - - # set default search methods - # Note : these can be over-ridden by setting NGX_AUTO_LIB_SEARCH_[type]=YES|NO - - local auto=y - - if [ "$NGX_AUTO_LIB_INC" ] || [ "$NGX_AUTO_LIB_LIB" ]; then - ngx_auto_lib_search LIB_INC YES - auto=n - fi - - if [ "$NGX_AUTO_LIB_DIR" != NONE ]; then - ngx_auto_lib_search DIR YES - auto=n - fi - - if [ "$NGX_AUTO_LIB_BASE" ]; then - ngx_auto_lib_search BASE YES - auto=n - fi - - if [ $auto = y ]; then - ngx_auto_lib_search PARENT YES - ngx_auto_lib_search SYSTEM YES - fi - - ngx_auto_lib_search LIB_INC NO - ngx_auto_lib_search DIR NO - ngx_auto_lib_search BASE NO - ngx_auto_lib_search PARENT NO - ngx_auto_lib_search SYSTEM NO - - if [ ! "$ngx_feature_lib_names" ]; then - ngx_feature_lib_names=$pfx - fi - - if [ ! "$ngx_feature_inc_names" ]; then - ngx_feature_inc_names=$ngx_feature_lib_names - fi - - if [ ! "$ngx_feature_exit_if_not_found" ]; then - ngx_feature_exit_if_not_found=yes - fi -} - -####################### -## DEFAULT FUNCTIONS ## -####################### - -ngx_auto_lib_set_default() { - - local suffix= - if [ $1 ]; then - suffix="_$1" - fi - - local def=$2 - local var="NGX_AUTO_LIB$suffix" - - val= - if [ ! `eval echo '$'$var` ]; then - eval $var=\"$def\" - fi - - #eval echo "$var = \$$var" -} - -ngx_auto_lib_search() { - ngx_auto_lib_set_default "SEARCH_$1" $2 -} - -#################### -## SAVE FUNCTIONS ## -#################### - -ngx_auto_lib_save_vars() { - OLD_CORE_DEPS=$CORE_DEPS - OLD_CORE_INCS=$CORE_INCS - OLD_CORE_LIBS=$CORE_LIBS - OLD_CORE_SRCS=$CORE_SRCS - OLD_LINK_DEPS=$LINK_DEPS - - CORE_DEPS= - CORE_INCS= - CORE_LIBS= - CORE_SRCS= - LINK_DEPS= -} - -ngx_auto_lib_reset_vars() { - CORE_DEPS=$OLD_CORE_DEPS - CORE_INCS=$OLD_CORE_INCS - CORE_LIBS=$OLD_CORE_LIBS - CORE_SRCS=$OLD_CORE_SRCS - LINK_DEPS=$OLD_LINK_DEPS -} - -ngx_auto_lib_save_feature_vars() { - for var in $ngx_feature_all_vars; do - eval main_ngx_feature_$var=\"\$ngx_feature_$var\" - done -} - -ngx_auto_lib_reset_feature_vars() { - for var in $ngx_feature_all_vars; do - eval ngx_feature_$var=\"\$main_ngx_feature_$var\" - done -} - -######################## -## CHECKING FUNCTIONS ## -######################## - -ngx_auto_lib_check_auto_config() { - - ngx_auto_lib_save_feature_vars - ngx_auto_lib_clean_feature_vars - - ngx_feature=$1 - ngx_feature_inc_path="`echo $CFLAGS | tr ' ' '\n' | grep -- -D | tr '\n' ' '`" - ngx_feature_incs="#include <$NGX_AUTO_CONFIG_H>" - ngx_feature_libs= - ngx_feature_path=`pwd` - ngx_feature_run=no - ngx_feature_test=$2 - - #ngx_auto_lib_print_feature_vars - - . auto/feature - - if [ $ngx_found = yes ]; then - rv=0 - else - rv=1 - fi - - ngx_auto_lib_reset_feature_vars - - return $rv -} - -ngx_auto_lib_check_macro_defined() { - - for m in $@; do - ngx_auto_lib_check_auto_config "$m" " - #ifndef $m - rubbish - #endif" && return 0 - done - - return 1 -} - -ngx_auto_lib_check_macro_non_zero() { - - for m in $@; do - ngx_auto_lib_check_auto_config "$m" " - #if !($m) - rubbish - #endif" && return 0 - done - - return 1 -} - -ngx_auto_lib_check_require() { - - if [ $USE_NGX_AUTO_LIB = YES ]; then - return 0 - elif [ $USE_NGX_AUTO_LIB = NO ]; then - return 1 - fi - - - # check if the libraries are required elsewhere - - for l in $ngx_feature_lib_names; do - [ ! "`echo $CORE_LIBS $ADDON_LIBS | grep -w -- -l$l`" ] && return 0 - done - - - - # check that any required macros are set - - local d=$ngx_feature_check_macros_defined - local nz=$ngx_feature_check_macros_non_zero - - if [ "$d" ] || [ "$nz" ]; then - - ngx_auto_lib_check_macro_defined $d && return 0 - ngx_auto_lib_check_macro_non_zero $nz && return 0 - fi - - - ngx_auto_lib_check -} - -ngx_auto_lib_check() { - return 1 -} - -################################## -## TEST PHASE HANDLER FUNCTIONS ## -################################## - -ngx_auto_lib_test() { - ngx_auto_lib_test_pre_setup "$@" - ngx_auto_lib_test_setup "$@" - ngx_auto_lib_test_post_setup "$@" - ngx_auto_lib_test_feature -} - -ngx_auto_lib_test_pre_setup() { - return 0 -} - -ngx_auto_lib_test_setup() { - - local INC=$1 - local LIB=$2 - - ngx_auto_lib_inc_dir=$INC - ngx_auto_lib_lib_dir=$LIB - - ngx_auto_lib_reset_feature_vars - - if [ ! "$ngx_feature_path" ]; then - ngx_feature_path="$INC" - fi - - ngx_feature_path="$ngx_feature_path $ngx_feature_add_path" - - for sfx in $ngx_feature_path_suffixes; do - ngx_feature_path="$ngx_feature_path $INC/$sfx" - done - - - local inc= - local lib= - local incs="$ngx_feature_inc_names" - local libs="$ngx_feature_lib_names" - local lib_files="$ngx_feature_lib_files" - - for inc in $incs; do - ngx_feature_incs="$ngx_feature_incs -#include <$inc.h>" - done - - - if [ ! "$ngx_feature_libs" ]; then - - if [ $NGX_AUTO_LIB_SHARED = YES ]; then - if [ $NGX_RPATH = YES ]; then - ngx_feature_libs="-R$LIB" - fi - ngx_feature_libs="$ngx_feature_libs -L$LIB" - - for lib in $libs; do - ngx_feature_libs="$ngx_feature_libs -l$lib" - done - - # TODO : only add --rpath when the path is not a standard system path - warn if /usr - - ngx_feature_libs="$ngx_feature_libs -Wl,--rpath -Wl,$LIB" - - else - - for lib in $lib_files; do - ngx_feature_libs="$ngx_feature_libs $LIB/$lib" - done - - for lib in $libs; do - ngx_feature_libs="$ngx_feature_libs $LIB/lib$lib.a" - done - fi - fi - - if [ ! $ngx_feature_run ]; then - ngx_feature_run=no - fi - - if [ $NGX_AUTO_LIB_SHARED = YES ]; then - - # Add a test to be called in auto/feature after compilation that will check - # whether any libraries that are linked are in fact using the path provided to - # link libraries rather than a standard path. Note : this test will work on - # all linked shared objects, even if supplied directly by setting - # $ngx_feature_libs instead of usign $ngx_feature_lib_names - - # TODO : allow for some libraries to not be checked here if desired - if part of system paths - - libs="`echo $ngx_feature_libs | tr ' ' '\n' | grep -- -l | sed 's|-l||g'`" - - local test=" - for l in $libs; do - o="'\`ldd '$NGX_AUTOTEST' | grep '$LIB'/lib\$l\\.so\`; - if [ ! \"\$o\" ]; then - chmod -x $NGX_AUTOTEST; - echo Linker does not link to correct version - else - chmod +x $NGX_AUTOTEST; - fi - done' - test="`echo "$test" | tr '\n' ' '`" - - ngx_feature_test_libs="$ngx_feature_test_libs; $test" - fi - - ngx_feature_libs="$ngx_feature_libs $ngx_feature_add_libs" - ngx_feature_libs_to_add="$ngx_feature_libs" - ngx_feature_libs="$ngx_feature_libs $ngx_feature_test_libs" - ngx_feature="$ngx_auto_lib_name library $ngx_feature" -} - -ngx_auto_lib_test_post_setup() { - return 0 -} - -ngx_auto_lib_test_feature() { - #ngx_auto_lib_print_feature_vars - . auto/feature - [ $ngx_found = yes ] && return 0 - return 1 -} - -######################## -## TEST DIR FUNCTIONS ## -######################## - -ngx_auto_lib_test_dir_pair() { - ngx_auto_lib_test_inc_dir=$1 - ngx_auto_lib_test_lib_dir=$2 - - if [ $1 = $2 ]; then - ngx_feature="in $1$3" - else - ngx_feature="in $1 and $2$3" - fi - ngx_auto_lib_test "$1" "$2" "$3" -} - -ngx_auto_lib_test_dir_pairs() { - ngx_auto_lib_test_dir_pair "$1/include" "$2/lib" "$3" && return 0 - ngx_auto_lib_test_dir_pair "$1" "$2" "$3" && return 0 - return 1 -} - -ngx_auto_lib_test_dirs() { - - local msg="$1" - local bdir idir ldir - - local bdirs=$ngx_feature_build_dirs - local idirs=$ngx_feature_build_inc_dirs - local ldirs=$ngx_feature_build_lib_dirs - - shift - - for dir in "$@"; do - ngx_auto_lib_test_dir=$dir - - for ldir in $ldirs; do - for idir in $idirs; do - ngx_auto_lib_test_dir_pair "$dir/$idir" "$dir/$ldir" "$msg" && return 0 - done - done - - for ldir in $ldirs; do - ngx_auto_lib_test_dir_pair "$dir" "$dir/$ldir" "$msg" && return 0 - done - - for idir in $idirs; do - ngx_auto_lib_test_dir_pair "$dir/$idir" "$dir" "$msg" && return 0 - done - - for bdir in $bdirs; do - ngx_auto_lib_test_dir_pairs "$dir/$bdir" "$dir/$bdir" "$msg" && return 0 - done - - ngx_auto_lib_test_dir_pairs "$dir" "$dir" "$msg" && return 0 - ngx_auto_lib_test_dir= - done - - return 1 -} - -ngx_auto_lib_test_install_dirs() { - - local msg="$1" - local dir= - - shift - - for dir in "$@"; do - ngx_auto_lib_test_dir=$dir - ngx_auto_lib_test_dir_pair "$dir/include" "$dir/lib" "$msg" && return 0 - ngx_auto_lib_test_dir= - done - - return 1 -} - -ngx_auto_lib_run_tests() { - - local name="$ngx_auto_lib_name" - local pfx="$ngx_auto_lib_pfx" - local PFX="$NGX_AUTO_LIB_PFX" - local INC="$NGX_AUTO_LIB_INC" - local LIB="$NGX_AUTO_LIB_LIB" - local DIR="$NGX_AUTO_LIB_DIR" - local BASE="$NGX_AUTO_LIB_BASE" - local MSG="$NGX_AUTO_LIB_MSG" - - - ngx_found=no - - - # dependency - - if [ $NGX_AUTO_LIB_SEARCH_DEP = YES ]; then - ngx_auto_lib_test_dir_pair "$INC" "$LIB" "$MSG" - return $? - fi - - - # lib and include dirs set explicitly (e.g. $OPENSSL_INC, $OPENSSL_LIB) - - if [ $NGX_AUTO_LIB_SEARCH_LIB_INC = YES ]; then - ngx_auto_lib_test_dir_pair "$INC" "$LIB" " (specified by \$${PFX}_INC and \$${PFX}_LIB)" && return 0 - fi - - - # path specified by ${PFX} (e.g. $OPENSSL, $PCRE) - # Note : these will be set automatically by configure for OpenSSL, PCRE, Zlib etc - # TODO : change to searching more than one path - - if [ $NGX_AUTO_LIB_SEARCH_DIR = YES ] && [ $DIR != NONE ]; then - ngx_auto_lib_test_dirs " (specified by \$${PFX})" $DIR && return 0 - fi - - - # directories beginning with '$pfx-' that are in $NGX_AUTO_LIB_BASE (e.g. $OPENSSL_BASE) - - if [ $NGX_AUTO_LIB_SEARCH_BASE = YES ] && [ $BASE ]; then - - p=$NGX_AUTO_LIB_SEARCH_BASE_PREFIX - - if [ "$p" = YES ]; then - p="!ame $pfx-*" - elif [ "$p" ]; then - p="!ame $p*" - fi - - ngx_auto_lib_test_dirs " (found under \$${PFX}_BASE)" \ - `find $BASE/* -maxdepth 0 -type d $p 2> /dev/null | sort -r` && return 0 - fi - - - # directories beginning with '$pfx-' that are in the same directory as the Nginx source - - if [ $NGX_AUTO_LIB_SEARCH_PARENT = YES ]; then - local src_dir=`cd ..; pwd` - ngx_auto_lib_test_dirs " (found under Nginx source parent dir)" \ - `find $src_dir/* -maxdepth 0 -type d !ame $pfx-* 2> /dev/null | sort -r` && return 0 - fi - - - # system folders - - if [ $NGX_AUTO_LIB_SEARCH_SYSTEM = YES ]; then - ngx_auto_lib_test_install_dirs "" $NGX_AUTO_LIB_SYSTEM_DIRS && return 0 - fi - - return 1 -} - -####################### -## HANDLER FUNCTIONS ## -####################### - -ngx_auto_lib_run() { - ngx_auto_lib_get_variables - eval AUTO_$NGX_AUTO_LIB_PFX=NO - - ngx_auto_lib_check_require || return - ngx_auto_lib_setup || return - ngx_auto_lib_save_feature_vars - ngx_auto_lib_run_tests - ngx_auto_lib_post_tests || return - ngx_auto_lib_finalize -} - -ngx_auto_lib_print_feature_vars() { - echo ---------------------------- - for var in $ngx_feature_vars; do - eval "echo ngx_feature_$var = \$ngx_feature_$var" - done - echo ---------------------------- -} - -ngx_auto_lib_setup() { - return 0 -} - -ngx_auto_lib_post_tests() { - return 0 -} - -############################# -## SET VARIABLES FUNCTIONS ## -############################# - -# TODO : add HTTP/ADDON settings too - -ngx_auto_lib_set_core_variables() { - # TODO : don't add includes / libs more than once - - eval CORE_DEPS=\"$CORE_DEPS $ngx_feature_deps\" - eval CORE_INCS=\"$CORE_INCS $ngx_feature_path\" - eval CORE_LIBS=\"$CORE_LIBS $ngx_feature_libs_to_add\" - eval CORE_SRCS=\"$CORE_SRCS $ngx_feature_srcs\" -} - -ngx_auto_lib_set_generic_variables() { - local INC=$ngx_auto_lib_test_inc_dir - local LIB=$ngx_auto_lib_test_lib_dir - - modules="$modules $ngx_feature_modules" - - for have in $ngx_feature_haves; do - . auto/have - done - - set - $ngx_feature_defines - - while [ $1 ]; do - have=$1 - value=$2 - . auto/define - done - - local PFX=$NGX_AUTO_LIB_PFX - - eval USE_$PFX=NO - - if [ $ngx_auto_lib_test_dir ]; then - eval $PFX=$ngx_auto_lib_test_dir - else - eval $PFX=$ngx_auto_lib_lib_dir - fi - - if [ $NGX_AUTO_LIB_SHARED != YES ]; then - for l in $ngx_feature_lib_names; do - CORE_LIBS=`echo $CORE_LIBS | sed 's|-\||g'` - ADDON_LIBS=`echo $ADDON_LIBS | sed 's|-\||g'` - done - fi - - eval ${PFX}_INC=$INC - eval ${PFX}_LIB=$LIB - eval ${PFX}_SHARED=$NGX_AUTO_LIB_SHARED - eval AUTO_$PFX=YES -} - -ngx_auto_lib_set_custom_variables() { - return 0 -} - -######################## -## FINALIZE FUNCTIONS ## -######################## - -ngx_auto_lib_finalize() { - ngx_auto_lib_finalize_core -} - -ngx_auto_lib_finalize_core() { - - if [ $ngx_found = yes ]; then - - ngx_auto_lib_set_core_variables - ngx_auto_lib_set_generic_variables - - if [ "$ngx_feature_variables" ]; then - eval $ngx_feature_variables - fi - - ngx_auto_lib_set_custom_variables - - elif [ $ngx_feature_exit_if_not_found = yes ]; then - - if [ $ngx_auto_lib_module_name ]; then - module_txt=" by the $ngx_auto_lib_module_name module" - else - module_text= - fi - - lib=$ngx_auto_lib_name - pfx=$ngx_auto_lib_pfx - PFX=$NGX_AUTO_LIB_PFX - -cat << END - -$0: error: the $lib library is required$module_txt, but cannot -be found using the current configuration. In order for the compilation to succeed, -you will need to install the library using your system's package installer or point -the configure script to the library using one of the following variables : - -to define a dir to find $pfx library (source or install dir) $PFX -to define $pfx lib and include dirs separately ${PFX}_LIB & ${PFX}_INC -to define a base dir to search for dirs beginning with $pfx- ${PFX}_BASE - -e.g. - -$ export ${PFX}_LIB=/path/to/library/lib -$ export ${PFX}_LIB=/path/to/library/include -$ $0 ... - -END - exit 1 - fi -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/CHANGES b/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/CHANGES deleted file mode 100644 index eaaef0b..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/CHANGES +++ /dev/null @@ -1,17 +0,0 @@ -Changelog ---------- - -0.1 feature : set_var functions -0.1.1 feature : upstream_list directive and functions -0.2 feature : conf merge functions - feature : conf command macros - feature : 'action' macros -0.2.1 bugfix : ndk_map_uri_to_path_add_suffix -0.2.2 feature : regex conf functions -0.2.3 feature : version number -0.2.4 change : the auto/build script is now executed automatically on compilation -0.2.9 feature : ngx_auto_lib included with source -0.2.11 bugfix : hash functions did not display properly -0.2.12 feature : patches for rewrite functions and rewrite phase handler -0.2.13 change : revert to old behaviour rewrite functions - change : pre-generated config and macro files now provided \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/LICENSE b/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/LICENSE deleted file mode 100644 index 7074f57..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2010, Marcus Clyne, Simpl (simpl.it) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organization (Simpl) nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL MARCUS CLYNE OR SIMPL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_array.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_array.h deleted file mode 100644 index 4e0d518..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_array.h +++ /dev/null @@ -1,113 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* Non-generated macros */ - -#define ndk_array_count(a) ((a)->nelts) -#define ndk_array_get_first(a) ((a)->elts) -#define ndk_array_get_index(a,n) ((void*) ((char*) (a)->elts + (a)->size * n)) -#define ndk_array_get_last(a) ((void*) ((char*) (a)->elts + (a)->size * ((a)->nelts - 1))) -#define ndk_array_get_reverse_index(a,n) ((void*) ((char*) (a)->elts + (a)->size * ((a)->nelts - 1 - n))) -#define ndk_array_push_clean(p,a) {p = ngx_array_push (a); ndk_zerop (p);} - - -/* base action macro macros */ - -#define ndk_array_create_ac(a,pl,n,sz,ac) {a = ngx_array_create (pl,n,sz); if (a == NULL) ac;} -#define ndk_array_init_ac(a,pl,n,sz,ac) {if (ngx_array_init (a,pl,n,sz) == NGX_ERROR) ac;} -#define ndk_array_push_ac(p,a,ac) {p = ngx_array_push (a); if (p == NULL) ac;} -#define ndk_array_push_clean_ac(p,a,ac) {p = ngx_array_push (a); if (p == NULL) ac; ndk_zerop (p);} -#define ndk_array_push_n_ac(p,a,n,ac) {p = ngx_array_push_n (a,n); if (p == NULL) ac;} -#define ndk_array_push_n_clean_ac(p,a,n,ac) {p = ngx_array_push_n (a,n); if (p == NULL) ac; ndk_zeropn (p,n);} - - -/* generated action macros */ - -#define ndk_array_create_r0(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return 0) -#define ndk_array_create_r1(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return 1) -#define ndk_array_create_r_1(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return -1) -#define ndk_array_create_rok(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NGX_OK) -#define ndk_array_create_rce(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NGX_CONF_ERROR) -#define ndk_array_create_rcok(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NGX_CONF_OK) -#define ndk_array_create_re(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NGX_ERROR) -#define ndk_array_create_rn(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NULL) -#define ndk_array_create_rse(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,{ngx_script_error (e); return;}) -#define ndk_array_create_sce(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,{ngx_script_configure_error (c); return;}) -#define ndk_array_create_g(a,pl,n,sz,_lb) ndk_array_create_ac (a,pl,n,sz,goto _lb) -#define ndk_array_create_ge(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,goto error) - -#define ndk_array_init_r0(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return 0) -#define ndk_array_init_r1(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return 1) -#define ndk_array_init_r_1(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return -1) -#define ndk_array_init_rok(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NGX_OK) -#define ndk_array_init_rce(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NGX_CONF_ERROR) -#define ndk_array_init_rcok(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NGX_CONF_OK) -#define ndk_array_init_re(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NGX_ERROR) -#define ndk_array_init_rn(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NULL) -#define ndk_array_init_rse(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,{ngx_script_error (e); return;}) -#define ndk_array_init_sce(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,{ngx_script_configure_error (c); return;}) -#define ndk_array_init_g(a,pl,n,sz,_lb) ndk_array_init_ac (a,pl,n,sz,goto _lb) -#define ndk_array_init_ge(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,goto error) - -#define ndk_array_push_r0(p,a) ndk_array_push_ac (p,a,return 0) -#define ndk_array_push_r1(p,a) ndk_array_push_ac (p,a,return 1) -#define ndk_array_push_r_1(p,a) ndk_array_push_ac (p,a,return -1) -#define ndk_array_push_rok(p,a) ndk_array_push_ac (p,a,return NGX_OK) -#define ndk_array_push_rce(p,a) ndk_array_push_ac (p,a,return NGX_CONF_ERROR) -#define ndk_array_push_rcok(p,a) ndk_array_push_ac (p,a,return NGX_CONF_OK) -#define ndk_array_push_re(p,a) ndk_array_push_ac (p,a,return NGX_ERROR) -#define ndk_array_push_rn(p,a) ndk_array_push_ac (p,a,return NULL) -#define ndk_array_push_rse(p,a) ndk_array_push_ac (p,a,{ngx_script_error (e); return;}) -#define ndk_array_push_sce(p,a) ndk_array_push_ac (p,a,{ngx_script_configure_error (c); return;}) -#define ndk_array_push_g(p,a,_lb) ndk_array_push_ac (p,a,goto _lb) -#define ndk_array_push_ge(p,a) ndk_array_push_ac (p,a,goto error) - -#define ndk_array_push_clean_r0(p,a) ndk_array_push_clean_ac (p,a,return 0) -#define ndk_array_push_clean_r1(p,a) ndk_array_push_clean_ac (p,a,return 1) -#define ndk_array_push_clean_r_1(p,a) ndk_array_push_clean_ac (p,a,return -1) -#define ndk_array_push_clean_rok(p,a) ndk_array_push_clean_ac (p,a,return NGX_OK) -#define ndk_array_push_clean_rce(p,a) ndk_array_push_clean_ac (p,a,return NGX_CONF_ERROR) -#define ndk_array_push_clean_rcok(p,a) ndk_array_push_clean_ac (p,a,return NGX_CONF_OK) -#define ndk_array_push_clean_re(p,a) ndk_array_push_clean_ac (p,a,return NGX_ERROR) -#define ndk_array_push_clean_rn(p,a) ndk_array_push_clean_ac (p,a,return NULL) -#define ndk_array_push_clean_rse(p,a) ndk_array_push_clean_ac (p,a,{ngx_script_error (e); return;}) -#define ndk_array_push_clean_sce(p,a) ndk_array_push_clean_ac (p,a,{ngx_script_configure_error (c); return;}) -#define ndk_array_push_clean_g(p,a,_lb) ndk_array_push_clean_ac (p,a,goto _lb) -#define ndk_array_push_clean_ge(p,a) ndk_array_push_clean_ac (p,a,goto error) - -#define ndk_array_push_n_r0(p,a,n) ndk_array_push_n_ac (p,a,n,return 0) -#define ndk_array_push_n_r1(p,a,n) ndk_array_push_n_ac (p,a,n,return 1) -#define ndk_array_push_n_r_1(p,a,n) ndk_array_push_n_ac (p,a,n,return -1) -#define ndk_array_push_n_rok(p,a,n) ndk_array_push_n_ac (p,a,n,return NGX_OK) -#define ndk_array_push_n_rce(p,a,n) ndk_array_push_n_ac (p,a,n,return NGX_CONF_ERROR) -#define ndk_array_push_n_rcok(p,a,n) ndk_array_push_n_ac (p,a,n,return NGX_CONF_OK) -#define ndk_array_push_n_re(p,a,n) ndk_array_push_n_ac (p,a,n,return NGX_ERROR) -#define ndk_array_push_n_rn(p,a,n) ndk_array_push_n_ac (p,a,n,return NULL) -#define ndk_array_push_n_rse(p,a,n) ndk_array_push_n_ac (p,a,n,{ngx_script_error (e); return;}) -#define ndk_array_push_n_sce(p,a,n) ndk_array_push_n_ac (p,a,n,{ngx_script_configure_error (c); return;}) -#define ndk_array_push_n_g(p,a,n,_lb) ndk_array_push_n_ac (p,a,n,goto _lb) -#define ndk_array_push_n_ge(p,a,n) ndk_array_push_n_ac (p,a,n,goto error) - -#define ndk_array_push_n_clean_r0(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return 0) -#define ndk_array_push_n_clean_r1(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return 1) -#define ndk_array_push_n_clean_r_1(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return -1) -#define ndk_array_push_n_clean_rok(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NGX_OK) -#define ndk_array_push_n_clean_rce(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NGX_CONF_ERROR) -#define ndk_array_push_n_clean_rcok(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NGX_CONF_OK) -#define ndk_array_push_n_clean_re(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NGX_ERROR) -#define ndk_array_push_n_clean_rn(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NULL) -#define ndk_array_push_n_clean_rse(p,a,n) ndk_array_push_n_clean_ac (p,a,n,{ngx_script_error (e); return;}) -#define ndk_array_push_n_clean_sce(p,a,n) ndk_array_push_n_clean_ac (p,a,n,{ngx_script_configure_error (c); return;}) -#define ndk_array_push_n_clean_g(p,a,n,_lb) ndk_array_push_n_clean_ac (p,a,n,goto _lb) -#define ndk_array_push_n_clean_ge(p,a,n) ndk_array_push_n_clean_ac (p,a,n,goto error) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_basic.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_basic.h deleted file mode 100644 index c2db894..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_basic.h +++ /dev/null @@ -1,2203 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* conf cmd core values/bitmasks */ - -#define NDK_1MORE NGX_1MORE -#define NDK_2MORE NGX_2MORE -#define NDK_ANY NGX_ANY -#define NDK_ARGS_NUMBER NGX_ARGS_NUMBER -#define NDK_BLOCK NGX_BLOCK -#define NDK_FLAG NGX_FLAG -#define NDK_MULTI NGX_MULTI -#define NDK_TAKE1 NGX_TAKE1 -#define NDK_TAKE12 NGX_TAKE12 -#define NDK_TAKE123 NGX_TAKE123 -#define NDK_TAKE1234 NGX_TAKE1234 -#define NDK_TAKE13 NGX_TAKE13 -#define NDK_TAKE2 NGX_TAKE2 -#define NDK_TAKE23 NGX_TAKE23 -#define NDK_TAKE3 NGX_TAKE3 -#define NDK_TAKE4 NGX_TAKE4 -#define NDK_TAKE5 NGX_TAKE5 -#define NDK_TAKE6 NGX_TAKE6 -#define NDK_TAKE7 NGX_TAKE7 -#define NDK_TAKE8 NGX_TAKE8 - - -/* conf cmd bitmasks */ - -/* TODO : finish this */ - -#define NDK_HTTP_MAIN_CONF NGX_HTTP_MAIN_CONF -#define NDK_HTTP_SRV_CONF NGX_HTTP_SRV_CONF -#define NDK_HTTP_SIF_CONF NGX_HTTP_SIF_CONF -#define NDK_HTTP_LOC_CONF NGX_HTTP_LOC_CONF -#define NDK_HTTP_LIF_CONF NGX_HTTP_LIF_CONF -#define NDK_HTTP_UPS_CONF NGX_HTTP_UPS_CONF -#define NDK_MAIN_CONF NGX_MAIN_CONF -#define NDK_ANY_CONF NGX_ANY_CONF - - -/* compound locations */ - -#define NDK_HTTP_MAIN_SRV_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_CONF -#define NDK_HTTP_MAIN_SIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_SIF_CONF -#define NDK_HTTP_MAIN_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_MAIN_LIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_LOC_LIF_CONF - -#define NDK_HTTP_SRV_SIF_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_SIF_CONF -#define NDK_HTTP_SRV_LOC_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_SRV_LOC_LIF_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_LOC_LIF_CONF -#define NDK_HTTP_SRV_SIF_LOC_CONF NDK_HTTP_SRV_SIF_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_SRV_SIF_LOC_LIF_CONF NDK_HTTP_SRV_SIF_CONF|NDK_HTTP_LOC_LIF_CONF - -#define NDK_HTTP_LOC_LIF_CONF NDK_HTTP_LOC_CONF|NDK_HTTP_LIF_CONF - -#define NDK_HTTP_MAIN_SRV_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_LOC_CONF -#define NDK_HTTP_MAIN_SRV_LIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_LIF_CONF -#define NDK_HTTP_MAIN_SIF_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SIF_LOC_CONF -#define NDK_HTTP_MAIN_SRV_SIF_LOC_LIF_CONF NDK_HTTP_SRV_SIF_LOC_LIF_CONF|NDK_MAIN_CONF -#define NDK_HTTP_CONF NDK_HTTP_MAIN_SRV_SIF_LOC_LIF_CONF -#define NDK_HTTP_ANY_CONF NDK_HTTP_CONF|NDK_HTTP_UPS_CONF - - -/* property offsets NOTE : ngx_module_main_conf_t etc should be defined in the module's .c file before the commands */ - -#define NDK_HTTP_MAIN_CONF_PROP(p) NGX_HTTP_MAIN_CONF_OFFSET, offsetof (ndk_module_main_conf_t, p) -#define NDK_HTTP_SRV_CONF_PROP(p) NGX_HTTP_SRV_CONF_OFFSET, offsetof (ndk_module_srv_conf_t, p) -#define NDK_HTTP_LOC_CONF_PROP(p) NGX_HTTP_LOC_CONF_OFFSET, offsetof (ndk_module_loc_conf_t, p) - - -/* conf cmd basic macros */ - -#define NDK_HTTP_MAIN_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_ANY_CONF,\ - func, off1, off2, post}, - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_extra.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_extra.h deleted file mode 100644 index 68e276f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_extra.h +++ /dev/null @@ -1,5423 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* conf command macros */ - -#define NDK_HTTP_MAIN_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_BITMASK(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_BITMASK(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_BITMASK(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_BITMASK(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_BUFS(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_BUFS(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_BUFS(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_BUFS(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_BUFS(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_COMPLEX_PATH(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_ENCODING(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_ENCODING(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_ENCODING(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_ENCODING(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_ENUM(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_ENUM(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_ENUM(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_ENUM(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_ENUM(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_FALSE(name,p,post)\ - NDK_HTTP_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_FALSE(name,p,post)\ - NDK_HTTP_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_FALSE(name,p,post)\ - NDK_HTTP_UPS_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_FALSE(name,p,post)\ - NDK_HTTP_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_FALSE(name,p,post)\ - NDK_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_FULL_PATH(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_KEYVAL1(name,p,post)\ - NDK_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_KEYVAL(name,p,post)\ - NDK_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_MSEC(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_MSEC(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_MSEC(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_MSEC(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_MSEC(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_NULL(name,p,post)\ - NDK_HTTP_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_NULL(name,p,post)\ - NDK_HTTP_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_NULL(name,p,post)\ - NDK_HTTP_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_NULL(name,p,post)\ - NDK_HTTP_UPS_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_NULL(name,p,post)\ - NDK_HTTP_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_NULL(name,p,post)\ - NDK_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_NUM64(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_NUM64(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_NUM64(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_NUM64(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_NUM64(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_NUM_FLAG(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_NUM(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_NUM(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_NUM(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_NUM(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_NUM(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_NUM(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_OFF(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_OFF(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_OFF(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_OFF(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_OFF(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_OFF(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SRV_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_ONOFF(name,p,post)\ - NDK_HTTP_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_ONOFF(name,p,post)\ - NDK_HTTP_UPS_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_ONOFF(name,p,post)\ - NDK_HTTP_ANY_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_ONOFF(name,p,post)\ - NDK_ANY_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_PATH(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_PATH(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_PATH(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_PATH(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_PATH(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_PATH(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_PTR(name,p,post)\ - NDK_HTTP_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_PTR(name,p,post)\ - NDK_HTTP_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_PTR(name,p,post)\ - NDK_HTTP_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_PTR(name,p,post)\ - NDK_HTTP_UPS_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_PTR(name,p,post)\ - NDK_HTTP_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_PTR(name,p,post)\ - NDK_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_REGEX_ARRAY(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_REGEX_CL(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_REXEX(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_REXEX(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_REXEX(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_REXEX(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_REXEX(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_SEC_FLAG(name,p,post)\ - NDK_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_SEC(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_SEC(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_SEC(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_SEC(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_SEC(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_SEC(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_SIZE(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_SIZE(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_SIZE(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_SIZE(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_SIZE(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_STR_ARRAY(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_STR_ARRAY1(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_STR(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_STR(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_STR(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_STR(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_STR(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_STR(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_TRUE(name,p,post)\ - NDK_HTTP_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_TRUE(name,p,post)\ - NDK_HTTP_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_TRUE(name,p,post)\ - NDK_HTTP_UPS_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_TRUE(name,p,post)\ - NDK_HTTP_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_TRUE(name,p,post)\ - NDK_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_merge.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_merge.h deleted file mode 100644 index 4f7855f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_merge.h +++ /dev/null @@ -1,227 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* conf-merge-value macros */ - -/* TODO : check that all the main types have a corresponding merge function */ - -#define ndk_conf_merge_value ngx_conf_merge_value -#define ndk_conf_merge_off_value ngx_conf_merge_off_value -#define ndk_conf_merge_ptr_value ngx_conf_merge_ptr_value -#define ndk_conf_merge_str_value ngx_conf_merge_str_value -#define ndk_conf_merge_size_value ngx_conf_merge_size_value - - -#define ndk_conf_merge_keyval_value(conf,prev,default) \ - \ - conf = prev ? prev : default; - -#define ndk_conf_merge_str_array_value(conf,prev,val1,...) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - if (prev == NGX_CONF_UNSET_PTR) { \ - if (val1 == NULL) { \ - conf = NULL; \ - } else { \ - char * elts[] = {val1,##__VA_ARGS__}; \ - int n = sizeof(elts)/sizeof(char*); \ - \ - conf = ndk_str_array_create (cf->pool, elts, n); \ - \ - if (conf == NULL) \ - return NGX_CONF_ERROR; \ - } \ - } else { \ - conf = prev; \ - } \ - } - -#define ndk_conf_merge_http_complex_value_value(conf,prev,default) \ - \ - if (!conf.str.len) { \ - if (prev.str.len) { \ - conf = prev; \ - } else { \ - conf.str.data = (u_char *) default; \ - conf.str.len = sizeof (default) - 1; \ - \ - if (ndk_http_complex_value_compile (cf, &conf)) \ - return NGX_CONF_ERROR; \ - } \ - } - -#define ndk_conf_merge_http_complex_value_array_value(conf,prev,val1,...) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - if (prev == NGX_CONF_UNSET_PTR) { \ - if (val1 == NULL) \ - conf = NULL; \ - else { \ - char * elts[] = {val1,##__VA_ARGS__}; \ - int n = sizeof(elts)/sizeof(char*); \ - \ - conf = ndk_http_complex_value_array_create (cf, elts, n); \ - \ - if (conf == NULL) \ - return NGX_CONF_ERROR; \ - } \ - } else { \ - conf = prev; \ - } \ - } - -#define ndk_conf_merge_http_complex_path_value(conf,prev,...) \ - ndk_conf_merge_http_complex_value_array_value (conf.a, prev.a, __VA_ARGS__) - -#define ndk_conf_merge_split_path_value(conf,prev,path) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - conf = (prev == NGX_CONF_UNSET_PTR ? \ - ndk_split_path_create_raw (cf, path) : prev); \ - } - - -/* conf-merge-prop macros */ - -#define ndk_conf_merge_prop(prop,default)\ - ndk_conf_merge_value\ - (conf->prop, prev->prop, default) - -#define ndk_conf_merge_bitmask_prop(prop,default,...)\ - ndk_conf_merge_bitmask_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_bufs_prop(prop,default,...)\ - ndk_conf_merge_bufs_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_encoding_prop(prop,default,...)\ - ndk_conf_merge_encoding_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_enum_prop(prop,default,...)\ - ndk_conf_merge_enum_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_false_prop(prop,default,...)\ - ndk_conf_merge_false_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_flag_prop(prop,default,...)\ - ndk_conf_merge_flag_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_full_path_prop(prop,default,...)\ - ndk_conf_merge_full_path_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_http_complex_keyval_prop(prop,default,...)\ - ndk_conf_merge_http_complex_keyval_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_http_complex_path_prop(prop,default,...)\ - ndk_conf_merge_http_complex_path_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_http_complex_value_prop(prop,default,...)\ - ndk_conf_merge_http_complex_value_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_http_complex_value_array_prop(prop,default,...)\ - ndk_conf_merge_http_complex_value_array_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_keyval_prop(prop,default,...)\ - ndk_conf_merge_keyval_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_keyval1_prop(prop,default,...)\ - ndk_conf_merge_keyval1_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_msec_prop(prop,default,...)\ - ndk_conf_merge_msec_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_null_prop(prop,default,...)\ - ndk_conf_merge_null_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_num_prop(prop,default,...)\ - ndk_conf_merge_num_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_num64_prop(prop,default,...)\ - ndk_conf_merge_num64_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_num_flag_prop(prop,default,...)\ - ndk_conf_merge_num_flag_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_off_prop(prop,default,...)\ - ndk_conf_merge_off_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_ptr_prop(prop,default,...)\ - ndk_conf_merge_ptr_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_regex_prop(prop,default,...)\ - ndk_conf_merge_regex_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_regex_array_prop(prop,default,...)\ - ndk_conf_merge_regex_array_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_regex_array_caseless_prop(prop,default,...)\ - ndk_conf_merge_regex_array_caseless_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_regex_caseless_prop(prop,default,...)\ - ndk_conf_merge_regex_caseless_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_sec_prop(prop,default,...)\ - ndk_conf_merge_sec_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_sec_flag_prop(prop,default,...)\ - ndk_conf_merge_sec_flag_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_size_prop(prop,default,...)\ - ndk_conf_merge_size_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_split_path_prop(prop,default,...)\ - ndk_conf_merge_split_path_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_str_prop(prop,default,...)\ - ndk_conf_merge_str_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_str_array_prop(prop,default,...)\ - ndk_conf_merge_str_array_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_str_array_multi_prop(prop,default,...)\ - ndk_conf_merge_str_array_multi_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_true_prop(prop,default,...)\ - ndk_conf_merge_true_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.c deleted file mode 100644 index d2e572f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.c +++ /dev/null @@ -1,72 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* optional includes */ - -#if (NDK_BUF) -#include -#endif -#if (NDK_COMPLEX_PATH) -#include -#endif -#if (NDK_COMPLEX_VALUE) -#include -#endif -#if (NDK_CONF_FILE) -#include -#endif -#if (NDK_ENCODING) -#include -#endif -#if (NDK_HASH) -#include -#endif -#if (NDK_HTTP) -#include -#endif -#if (NDK_PATH) -#include -#endif -#if (NDK_PROCESS) -#include -#endif -#if (NDK_REGEX) -#include -#endif -#if (NDK_REWRITE) -#include -#endif -#if (NDK_SET_VAR) -#include -#endif -#if (NDK_STRING) -#include -#endif -#if (NDK_UPSTREAM_LIST) -#include -#endif -#if (NDK_URI) -#include -#endif - - -/* module commands */ - -static ngx_command_t ndk_http_commands[] = { -#if (NDK_UPSTREAM_LIST) -#define NDK_UPSTREAM_LIST_CMDS 1 -#include -#undef NDK_UPSTREAM_LIST_CMDS -#endif - ngx_null_command -}; diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.h deleted file mode 100644 index 7223950..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.h +++ /dev/null @@ -1,98 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* include all optional modules */ - -#ifdef NDK_ALL - -#ifndef NDK_BUF -#define NDK_BUF 1 -#endif -#ifndef NDK_COMPLEX_PATH -#define NDK_COMPLEX_PATH 1 -#endif -#ifndef NDK_COMPLEX_VALUE -#define NDK_COMPLEX_VALUE 1 -#endif -#ifndef NDK_CONF_FILE -#define NDK_CONF_FILE 1 -#endif -#ifndef NDK_ENCODING -#define NDK_ENCODING 1 -#endif -#ifndef NDK_HASH -#define NDK_HASH 1 -#endif -#ifndef NDK_HTTP -#define NDK_HTTP 1 -#endif -#ifndef NDK_PATH -#define NDK_PATH 1 -#endif -#ifndef NDK_PROCESS -#define NDK_PROCESS 1 -#endif -#ifndef NDK_REGEX -#define NDK_REGEX 1 -#endif -#ifndef NDK_REWRITE -#define NDK_REWRITE 1 -#endif -#ifndef NDK_SET_VAR -#define NDK_SET_VAR 1 -#endif -#ifndef NDK_STRING -#define NDK_STRING 1 -#endif -#ifndef NDK_UPSTREAM_LIST -#define NDK_UPSTREAM_LIST 1 -#endif -#ifndef NDK_URI -#define NDK_URI 1 -#endif - -#endif - - -/* module dependencies */ - -#ifdef NDK_COMPLEX_PATH -#ifndef NDK_COMPLEX_VALUE -#define NDK_COMPLEX_VALUE 1 -#endif -#ifndef NDK_PATH -#define NDK_PATH 1 -#endif -#endif -#ifdef NDK_CONF_FILE -#ifndef NDK_STRING -#define NDK_STRING 1 -#endif -#endif -#ifdef NDK_HASH -#ifndef NDK_STRING -#define NDK_STRING 1 -#endif -#endif -#ifdef NDK_SET_VAR -#ifndef NDK_REWRITE -#define NDK_REWRITE 1 -#endif -#endif -#ifdef NDK_UPSTREAM_LIST -#ifndef NDK_HTTP_CREATE_MAIN_CONF -#define NDK_HTTP_CREATE_MAIN_CONF 1 -#endif -#endif - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_includes.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_includes.h deleted file mode 100644 index cbbf60a..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_includes.h +++ /dev/null @@ -1,66 +0,0 @@ -/* optional includes */ - -#if (NDK_BUF) -#include -#endif -#if (NDK_COMPLEX_PATH) -#include -#endif -#if (NDK_COMPLEX_VALUE) -#include -#endif -#if (NDK_CONF_FILE) -#include -#endif -#if (NDK_ENCODING) -#include -#endif -#if (NDK_HASH) -#include -#endif -#if (NDK_HTTP) -#include -#endif -#if (NDK_PATH) -#include -#endif -#if (NDK_PROCESS) -#include -#endif -#if (NDK_REGEX) -#include -#endif -#if (NDK_REWRITE) -#include -#endif -#if (NDK_SET_VAR) -#include -#endif -#if (NDK_STRING) -#include -#endif -#if (NDK_UPSTREAM_LIST) -#include -#endif -#if (NDK_URI) -#include -#endif - - -/* non-optional includes */ - -#include -#include -#include -#include - - -/* auto-generated headers */ - -#include -#include -#include -#include -#include - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_palloc.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_palloc.h deleted file mode 100644 index db8aaf1..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_palloc.h +++ /dev/null @@ -1,112 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* Non-generated macros */ - -#define ndk_pallocp(p,pl) p = ngx_palloc (pl,sizeof(*p)) -#define ndk_pallocpn(p,pl,n) p = ngx_palloc (pl,sizeof(*p)*(n)) - -#define ndk_pcallocp(p,pl) p = ngx_pcalloc (pl,sizeof(*p)) -#define ndk_pcallocpn(p,pl,n) p = ngx_pcalloc (pl,sizeof(*p)*(n)) - - -/* base action macro macros */ - -#define ndk_palloc_ac(p,pl,sz,ac) {p = ngx_palloc (pl,sz); if (p == NULL) ac;} -#define ndk_pallocp_ac(p,pl,ac) {ndk_pallocp (p,pl); if (p == NULL) ac;} -#define ndk_pallocpn_ac(p,pl,n,ac) {ndk_pallocpn (p,pl,n); if (p == NULL) ac;} -#define ndk_pcalloc_ac(p,pl,sz,ac) {p = ngx_pcalloc (pl,sz); if (p == NULL) ac;} -#define ndk_pcallocp_ac(p,pl,ac) {ndk_pcallocp (p,pl); if (p == NULL) ac;} -#define ndk_pcallocpn_ac(p,pl,n,ac) {ndk_pcallocpn (p,pl,n); if (p == NULL) ac;} - - -/* generated action macros */ - -#define ndk_palloc_r0(p,pl,sz) ndk_palloc_ac (p,pl,sz,return 0) -#define ndk_palloc_r1(p,pl,sz) ndk_palloc_ac (p,pl,sz,return 1) -#define ndk_palloc_r_1(p,pl,sz) ndk_palloc_ac (p,pl,sz,return -1) -#define ndk_palloc_rok(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NGX_OK) -#define ndk_palloc_rce(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NGX_CONF_ERROR) -#define ndk_palloc_rcok(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NGX_CONF_OK) -#define ndk_palloc_re(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NGX_ERROR) -#define ndk_palloc_rn(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NULL) -#define ndk_palloc_rse(p,pl,sz) ndk_palloc_ac (p,pl,sz,{ngx_script_error (e); return;}) -#define ndk_palloc_sce(p,pl,sz) ndk_palloc_ac (p,pl,sz,{ngx_script_configure_error (c); return;}) -#define ndk_palloc_g(p,pl,sz,_lb) ndk_palloc_ac (p,pl,sz,goto _lb) -#define ndk_palloc_ge(p,pl,sz) ndk_palloc_ac (p,pl,sz,goto error) - -#define ndk_pallocp_r0(p,pl) ndk_pallocp_ac (p,pl,return 0) -#define ndk_pallocp_r1(p,pl) ndk_pallocp_ac (p,pl,return 1) -#define ndk_pallocp_r_1(p,pl) ndk_pallocp_ac (p,pl,return -1) -#define ndk_pallocp_rok(p,pl) ndk_pallocp_ac (p,pl,return NGX_OK) -#define ndk_pallocp_rce(p,pl) ndk_pallocp_ac (p,pl,return NGX_CONF_ERROR) -#define ndk_pallocp_rcok(p,pl) ndk_pallocp_ac (p,pl,return NGX_CONF_OK) -#define ndk_pallocp_re(p,pl) ndk_pallocp_ac (p,pl,return NGX_ERROR) -#define ndk_pallocp_rn(p,pl) ndk_pallocp_ac (p,pl,return NULL) -#define ndk_pallocp_rse(p,pl) ndk_pallocp_ac (p,pl,{ngx_script_error (e); return;}) -#define ndk_pallocp_sce(p,pl) ndk_pallocp_ac (p,pl,{ngx_script_configure_error (c); return;}) -#define ndk_pallocp_g(p,pl,_lb) ndk_pallocp_ac (p,pl,goto _lb) -#define ndk_pallocp_ge(p,pl) ndk_pallocp_ac (p,pl,goto error) - -#define ndk_pallocpn_r0(p,pl,n) ndk_pallocpn_ac (p,pl,n,return 0) -#define ndk_pallocpn_r1(p,pl,n) ndk_pallocpn_ac (p,pl,n,return 1) -#define ndk_pallocpn_r_1(p,pl,n) ndk_pallocpn_ac (p,pl,n,return -1) -#define ndk_pallocpn_rok(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NGX_OK) -#define ndk_pallocpn_rce(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NGX_CONF_ERROR) -#define ndk_pallocpn_rcok(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NGX_CONF_OK) -#define ndk_pallocpn_re(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NGX_ERROR) -#define ndk_pallocpn_rn(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NULL) -#define ndk_pallocpn_rse(p,pl,n) ndk_pallocpn_ac (p,pl,n,{ngx_script_error (e); return;}) -#define ndk_pallocpn_sce(p,pl,n) ndk_pallocpn_ac (p,pl,n,{ngx_script_configure_error (c); return;}) -#define ndk_pallocpn_g(p,pl,n,_lb) ndk_pallocpn_ac (p,pl,n,goto _lb) -#define ndk_pallocpn_ge(p,pl,n) ndk_pallocpn_ac (p,pl,n,goto error) - -#define ndk_pcalloc_r0(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return 0) -#define ndk_pcalloc_r1(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return 1) -#define ndk_pcalloc_r_1(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return -1) -#define ndk_pcalloc_rok(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NGX_OK) -#define ndk_pcalloc_rce(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NGX_CONF_ERROR) -#define ndk_pcalloc_rcok(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NGX_CONF_OK) -#define ndk_pcalloc_re(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NGX_ERROR) -#define ndk_pcalloc_rn(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NULL) -#define ndk_pcalloc_rse(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,{ngx_script_error (e); return;}) -#define ndk_pcalloc_sce(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,{ngx_script_configure_error (c); return;}) -#define ndk_pcalloc_g(p,pl,sz,_lb) ndk_pcalloc_ac (p,pl,sz,goto _lb) -#define ndk_pcalloc_ge(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,goto error) - -#define ndk_pcallocp_r0(p,pl) ndk_pcallocp_ac (p,pl,return 0) -#define ndk_pcallocp_r1(p,pl) ndk_pcallocp_ac (p,pl,return 1) -#define ndk_pcallocp_r_1(p,pl) ndk_pcallocp_ac (p,pl,return -1) -#define ndk_pcallocp_rok(p,pl) ndk_pcallocp_ac (p,pl,return NGX_OK) -#define ndk_pcallocp_rce(p,pl) ndk_pcallocp_ac (p,pl,return NGX_CONF_ERROR) -#define ndk_pcallocp_rcok(p,pl) ndk_pcallocp_ac (p,pl,return NGX_CONF_OK) -#define ndk_pcallocp_re(p,pl) ndk_pcallocp_ac (p,pl,return NGX_ERROR) -#define ndk_pcallocp_rn(p,pl) ndk_pcallocp_ac (p,pl,return NULL) -#define ndk_pcallocp_rse(p,pl) ndk_pcallocp_ac (p,pl,{ngx_script_error (e); return;}) -#define ndk_pcallocp_sce(p,pl) ndk_pcallocp_ac (p,pl,{ngx_script_configure_error (c); return;}) -#define ndk_pcallocp_g(p,pl,_lb) ndk_pcallocp_ac (p,pl,goto _lb) -#define ndk_pcallocp_ge(p,pl) ndk_pcallocp_ac (p,pl,goto error) - -#define ndk_pcallocpn_r0(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return 0) -#define ndk_pcallocpn_r1(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return 1) -#define ndk_pcallocpn_r_1(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return -1) -#define ndk_pcallocpn_rok(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NGX_OK) -#define ndk_pcallocpn_rce(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NGX_CONF_ERROR) -#define ndk_pcallocpn_rcok(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NGX_CONF_OK) -#define ndk_pcallocpn_re(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NGX_ERROR) -#define ndk_pcallocpn_rn(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NULL) -#define ndk_pcallocpn_rse(p,pl,n) ndk_pcallocpn_ac (p,pl,n,{ngx_script_error (e); return;}) -#define ndk_pcallocpn_sce(p,pl,n) ndk_pcallocpn_ac (p,pl,n,{ngx_script_configure_error (c); return;}) -#define ndk_pcallocpn_g(p,pl,n,_lb) ndk_pcallocpn_ac (p,pl,n,goto _lb) -#define ndk_pcallocpn_ge(p,pl,n) ndk_pcallocpn_ac (p,pl,n,goto error) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/auto_config b/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/auto_config deleted file mode 100644 index ba4fdd4..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/auto_config +++ /dev/null @@ -1,16 +0,0 @@ -diff -pNr a/src/core/ngx_config.h b/src/core/ngx_config.h -*** a/src/core/ngx_config.h 2008-09-19 13:47:13.000000000 +0100 ---- b/src/core/ngx_config.h 2010-10-09 17:14:13.000000000 +0100 -*************** typedef intptr_t ngx_flag_t; -*** 127,131 **** - #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff - #endif - -! - #endif /* _NGX_CONFIG_H_INCLUDED_ */ ---- 127,131 ---- - #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff - #endif - -! #include - #endif /* _NGX_CONFIG_H_INCLUDED_ */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/expose_rewrite_functions b/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/expose_rewrite_functions deleted file mode 100644 index ec1d6d8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/expose_rewrite_functions +++ /dev/null @@ -1,291 +0,0 @@ -diff -rNp a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c -*** a/src/http/modules/ngx_http_rewrite_module.c 2010-06-18 16:15:20.000000000 +0100 ---- b/src/http/modules/ngx_http_rewrite_module.c 2010-10-09 14:47:10.000000000 +0100 -*************** -*** 8,14 **** - #include - #include - -! - typedef struct { - ngx_array_t *codes; /* uintptr_t */ - ---- 8,14 ---- - #include - #include - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) - typedef struct { - ngx_array_t *codes; /* uintptr_t */ - -*************** typedef struct { -*** 17,23 **** - ngx_flag_t log; - ngx_flag_t uninitialized_variable_warn; - } ngx_http_rewrite_loc_conf_t; -! - - static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf); - static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf, ---- 17,23 ---- - ngx_flag_t log; - ngx_flag_t uninitialized_variable_warn; - } ngx_http_rewrite_loc_conf_t; -! #endif - - static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf); - static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf, -*************** static char *ngx_http_rewrite_return(ngx -*** 28,44 **** - void *conf); - static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - static char *ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - static char * ngx_http_rewrite_if_condition(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf); - static char *ngx_http_rewrite_variable(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value); - static char *ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - static char * ngx_http_rewrite_value(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value); -! - - static ngx_command_t ngx_http_rewrite_commands[] = { - ---- 28,47 ---- - void *conf); - static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -+ #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) - static char *ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - static char * ngx_http_rewrite_if_condition(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf); - static char *ngx_http_rewrite_variable(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value); -+ #endif - static char *ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -+ #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) - static char * ngx_http_rewrite_value(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value); -! #endif - - static ngx_command_t ngx_http_rewrite_commands[] = { - -*************** ngx_http_rewrite_handler(ngx_http_reques -*** 178,185 **** - return r->err_status; - } - -! -! static ngx_int_t - ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) - { ---- 181,190 ---- - return r->err_status; - } - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! ngx_int_t - ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) - { -*************** ngx_http_rewrite_break(ngx_conf_t *cf, n -*** 511,517 **** - } - - -! static char * - ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) - { - ngx_http_rewrite_loc_conf_t *lcf = conf; ---- 516,525 ---- - } - - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! char * - ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) - { - ngx_http_rewrite_loc_conf_t *lcf = conf; -*************** ngx_http_rewrite_if(ngx_conf_t *cf, ngx_ -*** 627,633 **** - } - - -! static char * - ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf) - { - u_char *p; ---- 635,644 ---- - } - - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! char * - ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf) - { - u_char *p; -*************** ngx_http_rewrite_if_condition(ngx_conf_t -*** 847,853 **** - } - - -! static char * - ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) - { ---- 858,867 ---- - } - - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! char * - ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) - { -*************** ngx_http_rewrite_set(ngx_conf_t *cf, ngx -*** 948,954 **** - } - - -! static char * - ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) - { ---- 962,971 ---- - } - - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! char * - ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) - { -diff -rNp a/src/http/modules/ngx_http_rewrite_module.h b/src/http/modules/ngx_http_rewrite_module.h -*** a/src/http/modules/ngx_http_rewrite_module.h 1970-01-01 01:00:00.000000000 +0100 ---- b/src/http/modules/ngx_http_rewrite_module.h 2010-10-09 14:38:04.000000000 +0100 -*************** -*** 0 **** ---- 1,47 ---- -+ -+ /* -+ * Copyright (C) Marcus Clyne -+ * -+ * Note : this file has been created by the Nginx Development Kit using -+ * some code from ngx_http_rewrite_module.c -+ */ -+ -+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS) -+ -+ #ifndef _NGX_HTTP_REWRITE_H_INCLUDED_ -+ #define _NGX_HTTP_REWRITE_H_INCLUDED_ -+ -+ #include -+ #include -+ #include -+ -+ -+ extern ngx_module_t ngx_http_rewrite_module; -+ -+ -+ typedef struct { -+ ngx_array_t *codes; /* uintptr_t */ -+ -+ ngx_uint_t stack_size; -+ -+ ngx_flag_t log; -+ ngx_flag_t uninitialized_variable_warn; -+ } ngx_http_rewrite_loc_conf_t; -+ -+ -+ char * -+ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -+ char * -+ ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf); -+ char * -+ ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, -+ ngx_str_t *value); -+ char * -+ ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, -+ ngx_str_t *value); -+ ngx_int_t -+ ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v, -+ uintptr_t data); -+ -+ #endif -+ #endif -diff -rNp a/src/http/ngx_http.h b/src/http/ngx_http.h -*** a/src/http/ngx_http.h 2010-06-15 16:13:34.000000000 +0100 ---- b/src/http/ngx_http.h 2010-10-09 14:25:56.000000000 +0100 -*************** typedef u_char *(*ngx_http_log_handler_p -*** 43,48 **** ---- 43,52 ---- - #include - #endif - -+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS) -+ #include -+ #endif -+ - - struct ngx_http_log_ctx_s { - ngx_connection_t *connection; -diff -rNp a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c -*** a/src/http/ngx_http_script.c 2010-09-13 13:44:43.000000000 +0100 ---- b/src/http/ngx_http_script.c 2010-10-09 14:36:10.000000000 +0100 -*************** static size_t ngx_http_script_full_name_ -*** 26,35 **** ---- 26,43 ---- - static void ngx_http_script_full_name_code(ngx_http_script_engine_t *e); - - -+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS) -+ -+ uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL; -+ -+ #else -+ - #define ngx_http_script_exit (u_char *) &ngx_http_script_exit_code - - static uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL; - -+ #endif -+ - - void - ngx_http_script_flush_complex_value(ngx_http_request_t *r, -diff -rNp a/src/http/ngx_http_script.h b/src/http/ngx_http_script.h -*** a/src/http/ngx_http_script.h 2010-09-13 13:44:43.000000000 +0100 ---- b/src/http/ngx_http_script.h 2010-10-09 14:33:40.000000000 +0100 -*************** -*** 12,17 **** ---- 12,25 ---- - #include - #include - -+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS) -+ -+ #define ngx_http_script_exit (u_char *) &ngx_http_script_exit_code -+ -+ extern uintptr_t ngx_http_script_exit_code; -+ -+ #endif -+ - - typedef struct { - u_char *ip; diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/rewrite_phase_handler b/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/rewrite_phase_handler deleted file mode 100644 index bd5161f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/rewrite_phase_handler +++ /dev/null @@ -1,19 +0,0 @@ -diff -p -r a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c -*** a/src/http/ngx_http_core_module.c 2010-09-27 12:48:12.000000000 +0100 ---- b/src/http/ngx_http_core_module.c 2010-10-09 13:44:09.000000000 +0100 -*************** ngx_http_core_rewrite_phase(ngx_http_req -*** 910,915 **** ---- 910,922 ---- - return NGX_AGAIN; - } - -+ #if defined(nginx_version) && nginx_version >= 8042 && (NDK_REWRITE_PHASE) -+ -+ if (rc == NGX_AGAIN || rc == NGX_DONE) { -+ return NGX_OK; -+ } -+ -+ #endif - /* rc == NGX_OK || rc == NGX_ERROR || rc == NGX_HTTP_... */ - - ngx_http_finalize_request(r, rc); diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/md5.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/md5.h deleted file mode 100644 index 4cbf843..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/md5.h +++ /dev/null @@ -1,117 +0,0 @@ -/* crypto/md5/md5.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_MD5_H -#define HEADER_MD5_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_NO_MD5 -#error MD5 is disabled. -#endif - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! MD5_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -#if defined(__LP32__) -#define MD5_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define MD5_LONG unsigned long -#define MD5_LONG_LOG2 3 -/* - * _CRAY note. I could declare short, but I have no idea what impact - * does it have on performance on none-T3E machines. I could declare - * int, but at least on C90 sizeof(int) can be chosen at compile time. - * So I've chosen long... - * - */ -#else -#define MD5_LONG unsigned int -#endif - -#define MD5_CBLOCK 64 -#define MD5_LBLOCK (MD5_CBLOCK/4) -#define MD5_DIGEST_LENGTH 16 - -typedef struct MD5state_st - { - MD5_LONG A,B,C,D; - MD5_LONG Nl,Nh; - MD5_LONG data[MD5_LBLOCK]; - unsigned int num; - } MD5_CTX; - -int MD5_Init(MD5_CTX *c); -int MD5_Update(MD5_CTX *c, const void *data, size_t len); -int MD5_Final(unsigned char *md, MD5_CTX *c); -unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); -void MD5_Transform(MD5_CTX *c, const unsigned char *b); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/murmurhash2.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/murmurhash2.c deleted file mode 100644 index ac899b4..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/murmurhash2.c +++ /dev/null @@ -1,77 +0,0 @@ - - -#ifndef MURMURHASH2_C -#define MURMURHASH2_C - -#define MURMURHASH2_DIGEST_LENGTH 4 - -/* - * ----------------------------------------------------------------------------- - * MurmurHash2, by Austin Appleby - - * Note - This code makes a few assumptions about how your machine behaves - - - * 1. We can read a 4-byte value from any address without crashing - * 2. sizeof(int) == 4 - - * And it has a few limitations - - - * 1. It will not work incrementally. - * 2. It will not produce the same results on little-endian and big-endian - * machines. - */ - -unsigned int MurmurHash2 ( const void * key, int len, unsigned int seed ) -{ - /* - * 'm' and 'r' are mixing constants generated offline. - * They're not really 'magic', they just happen to work well. - */ - - const unsigned int m = 0x5bd1e995; - const int r = 24; - - /* Initialize the hash to a 'random' value */ - - unsigned int h = seed ^ len; - - /* Mix 4 bytes at a time into the hash */ - - const unsigned char * data = (const unsigned char *)key; - - while(len >= 4) - { - unsigned int k = *(unsigned int *)data; - - k *= m; - k ^= k >> r; - k *= m; - - h *= m; - h ^= k; - - data += 4; - len -= 4; - } - - /* Handle the last few bytes of the input array */ - - switch(len) - { - case 3: h ^= data[2] << 16; - case 2: h ^= data[1] << 8; - case 1: h ^= data[0]; - h *= m; - }; - - /* Do a few final mixes of the hash to ensure the last few - * bytes are well-incorporated. */ - - h ^= h >> 13; - h *= m; - h ^= h >> 15; - - return h; -} - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/sha.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/sha.h deleted file mode 100644 index 16cacf9..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/sha.h +++ /dev/null @@ -1,200 +0,0 @@ -/* crypto/sha/sha.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_SHA_H -#define HEADER_SHA_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) -#error SHA is disabled. -#endif - -#if defined(OPENSSL_FIPS) -#define FIPS_SHA_SIZE_T size_t -#endif - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! SHA_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -#if defined(__LP32__) -#define SHA_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define SHA_LONG unsigned long -#define SHA_LONG_LOG2 3 -#else -#define SHA_LONG unsigned int -#endif - -#define SHA_LBLOCK 16 -#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a - * contiguous array of 32 bit - * wide big-endian values. */ -#define SHA_LAST_BLOCK (SHA_CBLOCK-8) -#define SHA_DIGEST_LENGTH 20 - -typedef struct SHAstate_st - { - SHA_LONG h0,h1,h2,h3,h4; - SHA_LONG Nl,Nh; - SHA_LONG data[SHA_LBLOCK]; - unsigned int num; - } SHA_CTX; - -#ifndef OPENSSL_NO_SHA0 -int SHA_Init(SHA_CTX *c); -int SHA_Update(SHA_CTX *c, const void *data, size_t len); -int SHA_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); -void SHA_Transform(SHA_CTX *c, const unsigned char *data); -#endif -#ifndef OPENSSL_NO_SHA1 -int SHA1_Init(SHA_CTX *c); -int SHA1_Update(SHA_CTX *c, const void *data, size_t len); -int SHA1_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); -void SHA1_Transform(SHA_CTX *c, const unsigned char *data); -#endif - -#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a - * contiguous array of 32 bit - * wide big-endian values. */ -#define SHA224_DIGEST_LENGTH 28 -#define SHA256_DIGEST_LENGTH 32 - -typedef struct SHA256state_st - { - SHA_LONG h[8]; - SHA_LONG Nl,Nh; - SHA_LONG data[SHA_LBLOCK]; - unsigned int num,md_len; - } SHA256_CTX; - -#ifndef OPENSSL_NO_SHA256 -int SHA224_Init(SHA256_CTX *c); -int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA224_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md); -int SHA256_Init(SHA256_CTX *c); -int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA256_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md); -void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); -#endif - -#define SHA384_DIGEST_LENGTH 48 -#define SHA512_DIGEST_LENGTH 64 - -#ifndef OPENSSL_NO_SHA512 -/* - * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 - * being exactly 64-bit wide. See Implementation Notes in sha512.c - * for further details. - */ -#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a - * contiguous array of 64 bit - * wide big-endian values. */ -#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) -#define SHA_LONG64 unsigned __int64 -#define U64(C) C##UI64 -#elif defined(__arch64__) -#define SHA_LONG64 unsigned long -#define U64(C) C##UL -#else -#define SHA_LONG64 unsigned long long -#define U64(C) C##ULL -#endif - -typedef struct SHA512state_st - { - SHA_LONG64 h[8]; - SHA_LONG64 Nl,Nh; - union { - SHA_LONG64 d[SHA_LBLOCK]; - unsigned char p[SHA512_CBLOCK]; - } u; - unsigned int num,md_len; - } SHA512_CTX; -#endif - -#ifndef OPENSSL_NO_SHA512 -int SHA384_Init(SHA512_CTX *c); -int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA384_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md); -int SHA512_Init(SHA512_CTX *c); -int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA512_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md); -void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.c deleted file mode 100644 index d57040a..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.c +++ /dev/null @@ -1,155 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - */ - -#include - -#include - - -#if (NDK_HTTP_PRE_CONFIG) -static ngx_int_t ndk_http_preconfiguration (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_POST_CONFIG) -static ngx_int_t ndk_http_postconfiguration (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_CREATE_MAIN_CONF) -static void * ndk_http_create_main_conf (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_INIT_MAIN_CONF) -static char * ndk_http_init_main_conf (ngx_conf_t *cf, void *conf); -#endif -#if (NDK_HTTP_CREATE_SRV_CONF) -static void * ndk_http_create_srv_conf (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_MERGE_SRV_CONF) -static char * ndk_http_merge_srv_conf (ngx_conf_t *cf, void *parent, void *child); -#endif -#if (NDK_HTTP_CREATE_LOC_CONF) -static void * ndk_http_create_loc_conf (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_MERGE_LOC_CONF) -static char * ndk_http_merge_loc_conf (ngx_conf_t *cf, void *parent, void *child); -#endif - - -#if (NDK_HTTP_INIT_MASTER) -static ngx_int_t ndk_http_init_master (ngx_log_t *log); -#endif -#if (NDK_HTTP_INIT_MODULE) -static ngx_int_t ndk_http_init_module (ngx_cycle_t *cycle); -#endif -#if (NDK_HTTP_INIT_PROCESS) -static ngx_int_t ndk_http_init_process (ngx_cycle_t *cycle); -#endif -#if (NDK_HTTP_EXIT_PROCESS) -static void ndk_http_exit_process (ngx_cycle_t *cycle); -#endif -#if (NDK_HTTP_EXIT_MASTER) -static void ndk_http_exit_master (ngx_cycle_t *cycle); -#endif - - -ngx_http_module_t ndk_http_module_ctx = { - -#if (NDK_HTTP_PRE_CONFIG) - ndk_http_preconfiguration, -#else - NULL, -#endif -#if (NDK_HTTP_POST_CONFIG) - ndk_http_postconfiguration, -#else - NULL, -#endif - -#if (NDK_HTTP_CREATE_MAIN_CONF) - ndk_http_create_main_conf, -#else - NULL, -#endif -#if (NDK_HTTP_INIT_MAIN_CONF) - ndk_http_merge_main_conf, -#else - NULL, -#endif - -#if (NDK_HTTP_CREATE_SVR_CONF) - ndk_http_create_srv_conf, -#else - NULL, -#endif -#if (NDK_HTTP_MERGE_SVR_CONF) - ndk_http_merge_srv_conf, -#else - NULL, -#endif - -#if (NDK_HTTP_CREATE_LOC_CONF) - ndk_http_create_loc_conf, -#else - NULL, -#endif -#if (NDK_HTTP_MERGE_LOC_CONF) - ndk_http_merge_loc_conf, -#else - NULL, -#endif - -}; - -ngx_module_t ndk_http_module = { - - NGX_MODULE_V1, - &ndk_http_module_ctx, /* module context */ - ndk_http_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - -#if (NDK_HTTP_INIT_MASTER) - ndk_http_init_master, -#else - NULL, -#endif - -#if (NDK_HTTP_INIT_MODULE) - ndk_http_init_module, -#else - NULL, -#endif -#if (NDK_HTTP_INIT_PROCESS) - ndk_http_init_process, -#else - NULL, -#endif - - NULL, /* init thread */ - NULL, /* exit thread */ - -#if (NDK_HTTP_EXIT_PROCESS) - ndk_http_exit_process, -#else - NULL, -#endif -#if (NDK_HTTP_EXIT_MASTER) - ndk_http_exit_master, -#else - NULL, -#endif - NGX_MODULE_V1_PADDING -}; - - - -#if (NDK_HTTP_CREATE_MAIN_CONF) -static void * -ndk_http_create_main_conf (ngx_conf_t *cf) -{ - ndk_http_main_conf_t *mcf; - - ndk_pcallocp_rce (mcf, cf->pool); - - return mcf; -} -#endif - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.h deleted file mode 100644 index e08dfac..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.h +++ /dev/null @@ -1,53 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne -*/ - - -#ifndef NDK_H -#define NDK_H - - -#include -#include -#include - - -#define ndk_version 3004 -#define NDK_VERSION "0.3.4" - - -#if (NGX_DEBUG) -#ifndef NDK_DEBUG -#define NDK_DEBUG 1 -#endif -#else -#ifndef NDK_DEBUG -#define NDK_DEBUG 0 -#endif -#endif - - -#include - - -#if (NDK_HTTP_CREATE_MAIN_CONF) - -#define ndk_http_conf_get_main_conf(cf) ngx_http_conf_get_module_main_conf (cf, ndk_http_module) -#define ndk_http_get_main_conf(r) ngx_http_get_module_main_conf (r, ndk_http_module) - -typedef struct { -#if (NDK_UPSTREAM_LIST) - ngx_array_t *upstreams; -#endif -} ndk_http_main_conf_t; - -#endif /* NDK_HTTP_CREATE_MAIN_CONF */ - -#include - - -extern ngx_module_t ndk_http_module; - - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.c deleted file mode 100644 index c491f72..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.c +++ /dev/null @@ -1,43 +0,0 @@ - -ngx_int_t -ndk_copy_chain_to_str (ngx_pool_t *pool, ngx_chain_t *in, ngx_str_t *str) -{ - ngx_chain_t *cl; - size_t len; - u_char *p; - ngx_buf_t *b; - - len = 0; - for (cl = in; cl; cl = cl->next) - len += ngx_buf_size (cl->buf); - - ndk_palloc_re (p, pool, len + 1); - - str->data = p; - str->len = len; - - for (cl = in; cl; cl = cl->next) { - - b = cl->buf; - - if (ngx_buf_in_memory (b)) { - p = ngx_cpymem (p, b->pos, b->last - b->pos); - } - } - - *p = '\0'; - - return NGX_OK; -} - - -char * -ndk_copy_chain_to_charp (ngx_pool_t *pool, ngx_chain_t *in) -{ - ngx_str_t str; - - if (ndk_copy_chain_to_str (pool, in, &str) != NGX_OK) - return NULL; - - return (char *) str.data; -} \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.h deleted file mode 100644 index e6334ad..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.h +++ /dev/null @@ -1,5 +0,0 @@ - - -ngx_int_t ndk_copy_chain_to_str (ngx_pool_t *pool, ngx_chain_t *in, ngx_str_t *str); -char * ndk_copy_chain_to_charp (ngx_pool_t *pool, ngx_chain_t *in); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.c deleted file mode 100644 index 8b32713..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.c +++ /dev/null @@ -1,129 +0,0 @@ - - -ndk_http_complex_path_value_t ndk_empty_http_complex_path_value = {{0,NULL},0}; - - -ngx_int_t -ndk_http_complex_path_value_compile (ngx_conf_t *cf, ngx_http_complex_value_t *cv, ngx_str_t *value, ngx_uint_t prefix) -{ - ngx_http_compile_complex_value_t ccv; - - ngx_memzero (&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = value; - ccv.complex_value = cv; - - switch (prefix) { - - case 1 : - ccv.root_prefix = 1; - break; - - case 2 : - ccv.conf_prefix = 1; - break; - } - - ndk_path_to_dir_safe (value, 1, 0); - - if (!value->len) - return NGX_OK; - - return ngx_http_compile_complex_value (&ccv); -} - - - -ngx_array_t * -ndk_http_complex_path_create_compile (ngx_conf_t *cf, ngx_str_t *path, ngx_uint_t prefix) -{ - ndk_http_complex_path_elt_t *cpe; - ngx_array_t *a; - ngx_int_t n; - u_char *m, *s, *e; - ngx_str_t value; - - n = ndk_strcntc (path, ':') + 1; - - a = ngx_array_create (cf->pool, n, sizeof (ndk_http_complex_path_elt_t)); - if (a == NULL) { - return NULL; - } - - s = path->data; - e = s + path->len; - - - while (s < e) { - - m = s; - - while (m < e && *m != ':') m++; - - if (m == s) { - s = m+1; - continue; - } - - cpe = ngx_array_push (a); - if (cpe == NULL) { - return NULL; - } - - if (*s == '#') { - s++; - cpe->dynamic = 1; - } else { - cpe->dynamic = 0; - } - - value.data = s; - value.len = m - s; - - if (ndk_http_complex_path_value_compile (cf, &cpe->val, &value, prefix) == NGX_ERROR) - return NULL; - - s = m+1; - } - - return a; -} - - - - -char * -ndk_conf_set_http_complex_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *path; - ngx_conf_post_t *post; - ndk_http_complex_path_t *cp; - - cp = (ndk_http_complex_path_t *) (p + cmd->offset); - - if (cp->a != NGX_CONF_UNSET_PTR) { - return "is duplicate"; - } - - path = cf->args->elts; - path++; - - cp->a = ndk_http_complex_path_create_compile (cf, path, cp->prefix); - if (cp->a == NULL) { - /* TODO : log */ - return NGX_CONF_ERROR; - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, cp->a); - } - - return NGX_CONF_OK; -} - - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.h deleted file mode 100644 index eb93d1f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.h +++ /dev/null @@ -1,30 +0,0 @@ - - -typedef struct { - ngx_array_t *a; - ngx_uint_t prefix; -} ndk_http_complex_path_t; - -typedef struct { - ngx_http_complex_value_t val; - ngx_flag_t dynamic; -} ndk_http_complex_path_elt_t; - -typedef struct { - ngx_str_t val; - ngx_flag_t dynamic; -} ndk_http_complex_path_value_t; - -typedef struct { - ndk_http_complex_path_value_t *elts; - ngx_uint_t nelts; -} ndk_http_complex_path_values_t; - - -extern ndk_http_complex_path_value_t ndk_empty_http_complex_path_value; - - -ngx_array_t * ndk_http_complex_path_create_compile (ngx_conf_t *cf, ngx_str_t *path, ngx_uint_t prefix); -ngx_int_t ndk_http_complex_path_value_compile (ngx_conf_t *cf, ngx_http_complex_value_t *cv, - ngx_str_t *value, ngx_uint_t prefix); -char * ndk_conf_set_http_complex_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.c deleted file mode 100644 index 97681ff..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.c +++ /dev/null @@ -1,192 +0,0 @@ - - - -ngx_int_t -ndk_http_complex_value_compile (ngx_conf_t *cf, ngx_http_complex_value_t *cv, ngx_str_t *value) -{ - ngx_http_compile_complex_value_t ccv; - - ngx_memzero (&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = value; - ccv.complex_value = cv; - - return ngx_http_compile_complex_value (&ccv); -} - - - - -ngx_array_t * -ndk_http_complex_value_array_create (ngx_conf_t *cf, char **s, ngx_int_t n) -{ - ngx_int_t i; - ngx_http_complex_value_t *cv; - ngx_array_t *a; - ngx_str_t value; - - a = ngx_array_create (cf->pool, n, sizeof (ngx_http_complex_value_t)); - if (a == NULL) - return NULL; - - - for (i=0; ielts; - - for (i=0; inelts; i++, cv++) { - - if (ndk_http_complex_value_compile (cf, cv, &cv->value)) - return NGX_ERROR; - } - - return NGX_OK; -} - - - -char * -ndk_conf_set_http_complex_value_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_http_complex_value_t *cv; - ngx_str_t *value; - ngx_conf_post_t *post; - - cv = (ngx_http_complex_value_t *) (p + cmd->offset); - - if (cv->value.data) { - return "is duplicate"; - } - - value = cf->args->elts; - - if (ndk_http_complex_value_compile (cf, cv, value + 1)) - return NGX_CONF_ERROR; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, cv); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_http_complex_value_array_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_http_complex_value_t *cv; - ngx_array_t **a; - ngx_conf_post_t *post; - ngx_uint_t i, alloc; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a == NULL || *a == NGX_CONF_UNSET_PTR) { - - alloc = cf->args->nelts > 4 ? cf->args->nelts : 4; - - *a = ngx_array_create (cf->pool, alloc, sizeof (ngx_http_complex_value_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - value = cf->args->elts; - - for (i=1; iargs->nelts; i++) { - - cv = ngx_array_push (*a); - if (cv == NULL) { - return NGX_CONF_ERROR; - } - - if (ndk_http_complex_value_compile (cf, cv, &value[i]) == NGX_ERROR) - return NGX_CONF_ERROR; - } - - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - - -char * -ndk_conf_set_http_complex_keyval_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ndk_http_complex_keyval_t *ckv; - ngx_array_t **a; - ngx_conf_post_t *post; - ngx_int_t alloc; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a == NULL || *a == NGX_CONF_UNSET_PTR) { - - alloc = cf->args->nelts > 4 ? cf->args->nelts : 4; - - *a = ngx_array_create (cf->pool, alloc, sizeof (ndk_http_complex_keyval_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - ckv = ngx_array_push (*a); - if (ckv == NULL) { - return NGX_CONF_ERROR; - } - - value = cf->args->elts; - - ckv->key = value[1]; - - if (ndk_http_complex_value_compile (cf, &ckv->value, &value[2]) == NGX_ERROR) - return NGX_CONF_ERROR; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - -/* TODO : complex keyval1 */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.h deleted file mode 100644 index 4178d62..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.h +++ /dev/null @@ -1,21 +0,0 @@ - - -typedef struct { - ngx_str_t key; - ngx_http_complex_value_t value; -} ndk_http_complex_keyval_t; - - - -/* create/compile functions */ - -ngx_int_t ndk_http_complex_value_compile (ngx_conf_t *cf, ngx_http_complex_value_t *cv, ngx_str_t *value); -ngx_array_t * ndk_http_complex_value_array_create (ngx_conf_t *cf, char **s, ngx_int_t n); -ngx_int_t ndk_http_complex_value_array_compile (ngx_conf_t *cf, ngx_array_t *a); - - -/* conf set slot functions */ - -char * ndk_conf_set_http_complex_keyval_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_http_complex_value_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_http_complex_value_array_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.c deleted file mode 100644 index 980641c..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.c +++ /dev/null @@ -1,396 +0,0 @@ - - -/* NOTE : you will find other conf_set functions in the following files : - * - * complex_value.c - * encoding.c - * path.c - * - */ - - -char * -ndk_conf_set_true_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_flag_t *fp; - ngx_conf_post_t *post; - - fp = (ngx_flag_t*) (p + cmd->offset); - - if (*fp != NGX_CONF_UNSET) { - return "is duplicate"; - } - - *fp = 1; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, fp); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_false_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_flag_t *fp; - ngx_conf_post_t *post; - - fp = (ngx_flag_t*) (p + cmd->offset); - - if (*fp != NGX_CONF_UNSET) { - return "is duplicate"; - } - - *fp = 0; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, fp); - } - - return NGX_CONF_OK; -} - - - - -char * -ndk_conf_set_ptr_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - void **ptr; - - ptr = (void**) (p + cmd->offset); - - if (*ptr != NGX_CONF_UNSET_PTR) { - return "is duplicate"; - } - - *ptr = cmd->post; - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_null_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - void **pp; - ngx_conf_post_t *post; - - pp = (void **) (p + cmd->offset); - - if (*pp != NGX_CONF_UNSET_PTR) { - return "is duplicate"; - } - - *pp = NULL; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, pp); - } - - return NGX_CONF_OK; -} - - -char * -ndk_conf_set_num64_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - int64_t *np; - ngx_str_t *value; - ngx_conf_post_t *post; - - - np = (int64_t *) (p + cmd->offset); - - if (*np != NGX_CONF_UNSET) { - return "is duplicate"; - } - - value = cf->args->elts; - *np = ndk_atoi64 (value[1].data, value[1].len); - if (*np == NGX_ERROR) { - return "invalid number"; - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler(cf, post, np); - } - - return NGX_CONF_OK; -} - - -char * -ndk_conf_set_str_array_multi_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value, *s; - ngx_array_t **a; - ngx_conf_post_t *post; - ngx_uint_t i; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a == NGX_CONF_UNSET_PTR) { - *a = ngx_array_create(cf->pool, 4, sizeof(ngx_str_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - s = NULL; - - for (i=cf->args->nelts-1; i; i--) { - - s = ngx_array_push(*a); - if (s == NULL) { - return NGX_CONF_ERROR; - } - - value = cf->args->elts; - - *s = value[i]; - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler(cf, post, s); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_keyval1_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_keyval_t *kv; - ngx_conf_post_t *post; - - kv = (ngx_keyval_t *) (p + cmd->offset); - - if (kv->key.data) - return "is duplicate"; - - value = cf->args->elts; - - kv->key = value[1]; - kv->value = value[2]; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, kv); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_num_flag_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_int_t *np; - ngx_str_t *value; - ngx_conf_post_t *post; - - np = (ngx_int_t *) (p + cmd->offset); - - if (*np != NGX_CONF_UNSET) { - return "is duplicate"; - } - - value = cf->args->elts; - - if (ngx_strcasecmp (value[1].data, (u_char *) "on") == 0) { - *np = NDK_CONF_SET_TRUE; - - } else if (ngx_strcasecmp (value[1].data, (u_char *) "off") == 0) { - *np = NDK_CONF_SET_FALSE; - - } else { - *np = ngx_atoi (value[1].data, value[1].len); - if (*np == NGX_ERROR) { - return "invalid number and not 'on'/'off'"; - } - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, np); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_sec_flag_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - time_t *tp; - ngx_str_t *value; - ngx_conf_post_t *post; - - tp = (time_t *) (p + cmd->offset); - - if (*tp != NGX_CONF_UNSET) { - return "is duplicate"; - } - - value = cf->args->elts; - - if (ngx_strcasecmp (value[1].data, (u_char *) "on") == 0) { - *tp = NDK_CONF_SET_TRUE; - - } else if (ngx_strcasecmp (value[1].data, (u_char *) "off") == 0) { - *tp = NDK_CONF_SET_FALSE; - - } else { - *tp = ngx_parse_time (&value[1], 1); - if (*tp == NGX_ERROR) { - return "has an invalid time and not 'on'/'off'"; - } - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, tp); - } - - return NGX_CONF_OK; -} - - - -ngx_http_conf_ctx_t * -ndk_conf_create_http_location (ngx_conf_t *cf) -{ - ngx_http_conf_ctx_t *ctx, *pctx; - void *mconf; - ngx_http_core_loc_conf_t *clcf, *pclcf; - ngx_uint_t i; - ngx_http_module_t *module; - - ndk_pcallocp_rce (ctx, cf->pool); - - pctx = cf->ctx; - ctx->main_conf = pctx->main_conf; - ctx->srv_conf = pctx->srv_conf; - - ndk_pcalloc_rce (ctx->loc_conf, cf->pool, sizeof(void *) * ngx_http_max_module); - - - for (i = 0; ngx_modules[i]; i++) { - if (ngx_modules[i]->type != NGX_HTTP_MODULE) { - continue; - } - - module = ngx_modules[i]->ctx; - - if (module->create_loc_conf) { - - mconf = module->create_loc_conf(cf); - if (mconf == NULL) { - return NGX_CONF_ERROR; - } - - ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf; - } - } - - pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index]; - - clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; - clcf->loc_conf = ctx->loc_conf; - clcf->name = pclcf->name; - clcf->noname = 1; - - if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) { - return NGX_CONF_ERROR; - } - - return ctx; -} - - -ngx_http_conf_ctx_t * -ngx_conf_create_http_named_location (ngx_conf_t *cf, ngx_str_t *name) -{ - ngx_http_conf_ctx_t *ctx; - ngx_http_core_loc_conf_t *clcf; - - ctx = ndk_conf_create_http_location (cf); - if (ctx == NGX_CONF_ERROR) - return NGX_CONF_ERROR; - - clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; - - /* in case the developer forgets to add '@' at the beginning of the named location */ - - if (name->data[0] != '@' && ndk_catstrf (cf->pool, name, "sS", "@", name) == NULL) - return NGX_CONF_ERROR; - - clcf->name = *name; /* TODO : copy? */ - clcf->noname = 0; - clcf->named = 1; - - return ctx; -} - - -ngx_int_t -ndk_replace_command (ngx_command_t *new_cmd, ngx_uint_t module_type) -{ - ngx_uint_t i; - ngx_command_t *cmd; - - for (i = 0; ngx_modules[i]; i++) { - - if (ngx_modules[i]->type != module_type) - continue; - - cmd = ngx_modules[i]->commands; - if (cmd == NULL) { - continue; - } - - for ( /* void */ ; cmd->name.len; cmd++) { - - if (ndk_cmpstr (&new_cmd->name, &cmd->name) == 0) { - - ndk_memcpyp (cmd, new_cmd); - return NGX_OK; - } - } - } - - return NGX_DECLINED; -} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.h deleted file mode 100644 index 6956b17..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.h +++ /dev/null @@ -1,44 +0,0 @@ - - -/* conf set functions */ - -char * ndk_conf_set_true_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_false_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_full_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_ptr_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_null_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_str_array_multi_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_keyval1_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_num_flag (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_num64_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_sec_flag_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - -ngx_http_conf_ctx_t * ndk_conf_create_http_location (ngx_conf_t *cf); -ngx_http_conf_ctx_t * ngx_conf_create_http_named_location (ngx_conf_t *cf, ngx_str_t *name); - -ngx_int_t ndk_replace_command (ngx_command_t *new_cmd, ngx_uint_t module_type); - - -/* values for conf_set_xxx_flag */ - -#define NDK_CONF_SET_TRUE -2 -#define NDK_CONF_SET_FALSE -3 - - -/* wrappers for utility macros */ - -#define ndk_conf_set_bitmask_slot ngx_conf_set_bitmask_slot -#define ndk_conf_set_bufs_slot ngx_conf_set_bufs_slot -#define ndk_conf_set_enum_slot ngx_conf_set_enum_slot -#define ndk_conf_set_flag_slot ngx_conf_set_flag_slot -#define ndk_conf_set_keyval_slot ngx_conf_set_keyval_slot -#define ndk_conf_set_msec_slot ngx_conf_set_msec_slot -#define ndk_conf_set_num_slot ngx_conf_set_num_slot -#define ndk_conf_set_off_slot ngx_conf_set_off_slot -#define ndk_conf_set_sec_slot ngx_conf_set_sec_slot -#define ndk_conf_set_size_slot ngx_conf_set_size_slot -#define ndk_conf_set_str_slot ngx_conf_set_str_slot - - - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.c deleted file mode 100644 index e0251cc..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.c +++ /dev/null @@ -1,72 +0,0 @@ - -#if (NGX_DEBUG) - -void -ndk_debug_helper (const char *func, const char *fmt, ...) -{ - size_t len, flen, tlen; - char *s, *p, *e; - - /* check to see if the format is empty */ - - flen = strlen (fmt); - - /* build func name */ - - len = strlen (func); - - if (flen == 0) - tlen = len + 1; - else - - char func_name [len + flen + 1]; - - s = func_name; - e = s + len; - - memcpy (s, func, len); - - /* remove initial ngx_ */ - - if (strncmp (s, "ngx_", 4) == 0) - s += 4; - - /* replace '_' with ' ' */ - - for (p=s; pmethod_name.len, r->method_name.data, - (int) r->uri.len, r->uri.data, - (int) r->args.len, r->args.data, - 0/*(int) r->main->count*/, r->main, - r, r->connection->data, r->parent); - - if (r->posted_requests) { - fprintf(stderr, " posted:"); - - for (pr = r->posted_requests; pr; pr = pr->next) { - fprintf (stderr, "%p,", pr); - } - } - - fprintf (stderr, "\n"); -} - - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.h deleted file mode 100644 index 883a6eb..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifndef NDK_DEBUG_H -#define NDK_DEBUG_H - - -/* TODO : use the Nginx printf function */ - - -#include -#include - -/* TODO -- andk_debug variety of debugging formats -- global include file for all debugging - can pass declaration to cflags for the option -*/ - - -#if (NDK_DEBUG) - - #if (NGX_HAVE_VARIADIC_MACROS) - - #define ndk_debug(...) ndk_debug_helper (__func__,__VA_ARGS__) - - #define ndk_debug_helper(func,...) \ - fprintf(stderr, "%-60s", func); \ - fprintf(stderr, (const char *)__VA_ARGS__); \ - fprintf(stderr,"\n"); - /*fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__)*/ - - #else - - /* NOTE : these includes might not be necessary since they're probably included with the core */ - - #include - #include - #include - - static void ndk_debug (const char * fmt, ...) { - } - - #endif - - #if NDK_DEBUG > 1 - - #define ndk_debug_request() ndk_debug_request_helper(r, __func__) - - static ngx_inline void - ndk_debug_request_helper (ngx_http_request_t *r, const char *func) - { - ngx_http_posted_request_t *pr; - - /* TODO : improve the format */ - - fprintf (stderr, "%s %.*s %.*s?%.*s c:%d m:%p r:%p ar:%p pr:%p", - func, - (int) r->method_name.len, r->method_name.data, - (int) r->uri.len, r->uri.data, - (int) r->args.len, r->args.data, - 0/*(int) r->main->count*/, r->main, - r, r->connection->data, r->parent); - - if (r->posted_requests) { - fprintf(stderr, " posted:"); - - for (pr = r->posted_requests; pr; pr = pr->next) { - fprintf (stderr, "%p,", pr); - } - } - - fprintf (stderr, "\n"); - } - - - #else - - #define ndk_debug_request() - - #endif - - - static ngx_inline void - ndk_debug_print_posted_requests (ngx_http_request_t *r) - { - ngx_http_posted_request_t *pr; - - ndk_request_log_debug_http (r, "ndk debug - http posted requests"); - - for (pr = r->main->posted_requests; pr; pr = pr->next) { - - if (!pr->request) - continue; - - ndk_request_log_debug_http (r, "ndk debug - http posted request:%V", &pr->request->uri); - } - } - - - #define ndk_debug_http_conf_location(cf) ndk_debug_http_conf_location_helper (cf, __func__) - - static ngx_inline void - ndk_debug_http_conf_location_helper (ngx_conf_t *cf, const char *func) - { - ngx_http_core_loc_conf_t *lcf; - - lcf = ngx_http_conf_get_module_loc_conf (cf, ngx_http_core_module); - - ndk_debug_helper (func, "[%s]", lcf->name.data); - } - - /* - static void - ndk_debug_log_chain (ngx_log_t *log, ngx_chain_t *cl) - { - - - } - */ - -#else - - #if (NGX_HAVE_VARIADIC_MACROS) - - #define ndk_debug(...) - #define ndk_debug_request() - - #else - - #include - - static void ndk_debug (const char * fmt, ...) { - } - - static void ndk_debug_request() { - } - - #endif - - #define ndk_debug_http_conf_location(cf) - -#endif - -#if (NDK_DEBUG) - - #define ndk_debug_check_read_event_handler(r) \ - \ - ndk_debug("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - - #define ndk_debug_check_write_event_handler(r) \ - \ - ndk_debug ("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - - #define ndk_debug_check_read_event_handler(r) - #define ndk_debug_check_write_event_handler(r) - -#endif - -#endif /* NDK_DEBUG_H */ - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.c deleted file mode 100644 index 4a07872..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.c +++ /dev/null @@ -1,57 +0,0 @@ - - - -char * -ndk_conf_set_encoding_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ndk_encoding_t *ep; - ngx_str_t *value; - size_t len; - iconv_t ic; - - ep = (ndk_encoding_t *) (p + cmd->offset); - if (ep->from && ep->to) - return "is duplicate"; - - value = cf->args->elts; - - - if (ep->from) { - - ep->to = (char *) value[1].data; - len = strlen (ep->from); - - } else if (ep->to) { - - ep->from = (char *) value[1].data; - len = strlen (ep->to); - - } else { - return "has no base encoding"; - } - - - if (len == value[1].len && !strncasecmp (ep->to, ep->from, len)) { - - ngx_log_error (NGX_LOG_WARN, cf->log, 0, - "\"%V\" '%V' encoding is ignored (no conversion)", &value[0], &value[1]); - - return NGX_CONF_OK; - } - - - ic = iconv_open (ep->to, ep->from); - if (ic == (iconv_t)-1) - return "has an invalid encoding"; - - - if (iconv_close (ic)) { - ngx_log_error (NGX_LOG_EMERG, cf->log, errno, "iconv_close()"); - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.h deleted file mode 100644 index b295b18..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.h +++ /dev/null @@ -1,12 +0,0 @@ - - -#include - -typedef struct { - char *from; - char *to; -} ndk_encoding_t; - - -char * ndk_conf_set_encoding_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.c deleted file mode 100644 index dec3d41..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.c +++ /dev/null @@ -1,82 +0,0 @@ - -#include - - - -/* openssl hashes */ - -#define NDK_OPENSSL_HASH(type,ctxt_type,upper) \ - u_char md [ctxt_type ## _DIGEST_LENGTH]; \ - ctxt_type ##_CTX c; \ - \ - type ## _Init (&c); \ - type ## _Update (&c, data, len); \ - type ## _Final (md, &c); \ - \ - ndk_hex_dump (p, (u_char *) md, ctxt_type ## _DIGEST_LENGTH); \ - if (upper) { \ - ndk_strtoupper (p, (ctxt_type ## _DIGEST_LENGTH) *2); \ - } - - -#ifdef NDK_MD5 - -void -ndk_md5_hash (u_char *p, char *data, size_t len) -{ - NDK_OPENSSL_HASH (MD5, MD5, 0); -} - -void -ndk_md5_hash_upper (u_char *p, char *data, size_t len) -{ - NDK_OPENSSL_HASH (MD5, MD5, 1); -} - -#endif -#ifdef NDK_SHA1 - -void -ndk_sha1_hash (u_char *p, char *data, size_t len) -{ - NDK_OPENSSL_HASH (SHA1, SHA, 0); -} - -void -ndk_sha1_hash_upper (u_char *p, char *data, size_t len) -{ - NDK_OPENSSL_HASH (SHA1, SHA, 1); -} - -#endif - - - -/* non-openssl hashes */ - -#ifdef NDK_MURMUR2 - -#include "hash/murmurhash2.c" - -void -ndk_murmur2_hash (u_char *p, char *data, size_t len) -{ - uint32_t hash; - - hash = MurmurHash2 (data, len, 47); - - ndk_hex_dump (p, (u_char*) &hash, 4); -} - -void -ndk_murmur2_hash_upper (u_char *p, char *data, size_t len) -{ - uint32_t hash; - - hash = MurmurHash2 (data, len, 47); - - ndk_hex_dump (p, (u_char*) &hash, 4); - ndk_strtoupper (p, 8); -} - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.h deleted file mode 100644 index a15e923..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.h +++ /dev/null @@ -1,45 +0,0 @@ - -#ifndef NDK_HASH_H -#define NDK_HASH_H - -#ifdef NDK_HASH_ALL - -#ifndef NDK_MD5 -#define NDK_MD5 -#endif - -#ifndef NDK_MURMUR2 -#define NDK_MURMUR2 -#endif - -#ifndef NDK_SHA1 -#define NDK_SHA1 -#endif - -#endif - -#include -#include -typedef void (*ndk_hash_pt) (u_char *p, char *data, size_t len); - - -#ifdef NDK_MD5 -#include -void ndk_md5_hash (u_char *p, char *data, size_t len); -void ndk_md5_hash_upper (u_char *p, char *data, size_t len); -#endif - -#ifdef NDK_MURMUR2 -#define MURMURHASH2_DIGEST_LENGTH 4 -void ndk_murmur2_hash (u_char *p, char *data, size_t len); -void ndk_murmur2_hash_upper (u_char *p, char *data, size_t len); -#endif - -#ifdef NDK_SHA1 -#include -void ndk_sha1_hash (u_char *p, char *data, size_t len); -void ndk_sha1_hash_upper (u_char *p, char *data, size_t len); -#endif - -#endif /* NDK_HASH_H */ - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.c deleted file mode 100644 index 60728bb..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.c +++ /dev/null @@ -1,138 +0,0 @@ - -ngx_uint_t -ndk_http_count_phase_handlers (ngx_http_core_main_conf_t *cmcf) -{ - ngx_http_phase_handler_t *ph; - ngx_uint_t i; - - ph = cmcf->phase_engine.handlers; - - for (i=0; ph[i].checker; i++) /* void */; - - return i; -} - - -ngx_uint_t -ndk_http_parse_request_method (ngx_str_t *m) -{ - switch (m->len) { - - case 3: - -#if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED) - { - u_char t[4]; - - ngx_memcpy (t, m->data, 3); - t[3] = ' '; - - if (ndk_str3_cmp (t, 'G', 'E', 'T', ' ')) { - return NGX_HTTP_GET; - } - - if (ndk_str3_cmp (t, 'P', 'U', 'T', ' ')) { - return NGX_HTTP_PUT; - } - } - -#else - - if (ndk_str3_cmp (m->data, 'G', 'E', 'T', ' ')) { - return NGX_HTTP_GET; - } - - if (ndk_str3_cmp (m->data, 'P', 'U', 'T', ' ')) { - return NGX_HTTP_PUT; - } - -#endif - break; - - case 4: - - if (m->data[1] == 'O') { - - if (ndk_str3Ocmp (m->data, 'P', 'O', 'S', 'T')) { - return NGX_HTTP_POST; - } - - if (ndk_str3Ocmp (m->data, 'C', 'O', 'P', 'Y')) { - return NGX_HTTP_COPY; - } - - if (ndk_str3Ocmp (m->data, 'M', 'O', 'V', 'E')) { - return NGX_HTTP_MOVE; - } - - if (ndk_str3Ocmp (m->data, 'L', 'O', 'C', 'K')) { - return NGX_HTTP_LOCK; - } - - } else { - - if (ndk_str4cmp (m->data, 'H', 'E', 'A', 'D')) { - return NGX_HTTP_HEAD; - } - } - - break; - - case 5: - - if (ndk_str5cmp (m->data, 'M', 'K', 'C', 'O', 'L')) { - return NGX_HTTP_MKCOL; - } - - if (ndk_str5cmp (m->data, 'P', 'A', 'T', 'C', 'H')) { - return NGX_HTTP_PATCH; - } - - if (ndk_str5cmp (m->data, 'T', 'R', 'A', 'C', 'E')) { - return NGX_HTTP_TRACE; - } - - break; - - case 6: - - if (ndk_str6cmp (m->data, 'D', 'E', 'L', 'E', 'T', 'E')) { - return NGX_HTTP_DELETE; - } - - if (ndk_str6cmp (m->data, 'U', 'N', 'L', 'O', 'C', 'K')) { - return NGX_HTTP_UNLOCK; - } - - break; - - case 7: - - if (ndk_str7_cmp (m->data, 'O', 'P', 'T', 'I', 'O', 'N', 'S', ' ')) - { - return NGX_HTTP_OPTIONS; - } - - break; - - case 8: - - if (ndk_str8cmp (m->data, 'P', 'R', 'O', 'P', 'F', 'I', 'N', 'D')) - { - return NGX_HTTP_PROPFIND; - } - - break; - - case 9: - - if (ndk_str9cmp (m->data, 'P', 'R', 'O', 'P', 'P', 'A', 'T', 'C', 'H')) - { - return NGX_HTTP_PROPPATCH; - } - - break; - } - - return 0; -} \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.h deleted file mode 100644 index 6a9d1c5..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.h +++ /dev/null @@ -1,3 +0,0 @@ - -ngx_uint_t ndk_http_count_phase_handlers (ngx_http_core_main_conf_t *cmcf); -ngx_uint_t ndk_http_parse_request_method (ngx_str_t *m); diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http_headers.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http_headers.h deleted file mode 100644 index e71c70e..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http_headers.h +++ /dev/null @@ -1,35 +0,0 @@ - - -/* TODO : organize and add */ -/* TODO : check - should it be r->main? */ - -#define ndk_http_uri(r) (r)->uri -#define ndk_http_request_uri(r) (r)->unparsed_uri - -#define ndk_http_header_in(r,name) ((r)->headers_in.name ? &(r)->headers_in.name->value : NULL) -#define ndk_http_header_out(r,name) ((r)->headers_out.name ? &(r)->headers_out.name->value : NULL) - -#define ndk_http_host_header(r) ndk_http_header_in (r, host) -#define ndk_http_connection_header(r) ndk_http_header_in (r, connection) -#define ndk_http_if_modified_since_header(r) ndk_http_header_in (r, if_modified_since) -#define ndk_http_user_agent_header(r) ndk_http_header_in (r, user_agent) -#define ndk_http_referer_header(r) ndk_http_header_in (r, referer) -#define ndk_http_content_length_header(r) ndk_http_header_in (r, content_length) -#define ndk_http_content_type_header(r) ndk_http_header_in (r, content_type) -#define ndk_http_range_header(r) ndk_http_header_in (r, range) -#define ndk_http_if_range_header(r) ndk_http_header_in (r, if_range) -#define ndk_http_transfer_encoding_header(r) ndk_http_header_in (r, transfer_encoding) -#define ndk_http_expect_header(r) ndk_http_header_in (r, expect) -#define ndk_http_accept_encoding_header(r) ndk_http_header_in (r, accept_encoding) -#define ndk_http_via_header(r) ndk_http_header_in (r, via) -#define ndk_http_authorization_header(r) ndk_http_header_in (r, authorization) -#define ndk_http_keep_alive_header(r) ndk_http_header_in (r, keep_alive) -#define ndk_http_x_forwarded_for_header(r) ndk_http_header_in (r, x_forwarded_for) -#define ndk_http_x_real_ip_header(r) ndk_http_header_in (r, x_real_ip) -#define ndk_http_accept_header(r) ndk_http_header_in (r, accept) -#define ndk_http_accept_language_header(r) ndk_http_header_in (r, accept_language) -#define ndk_http_depth_header(r) ndk_http_header_in (r, depth) -#define ndk_http_destination_header(r) ndk_http_header_in (r, destination) -#define ndk_http_overwrite_header(r) ndk_http_header_in (r, overwrite) -#define ndk_http_date_header(r) ndk_http_header_in (r, date) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.c deleted file mode 100644 index 36dca15..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.c +++ /dev/null @@ -1,3 +0,0 @@ - - -/* TODO : the required functions if the compiler does not have variadic macros */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.h deleted file mode 100644 index 1dd9c22..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.h +++ /dev/null @@ -1,165 +0,0 @@ - -/* TODO : fix the conf_log macros */ - -#define NGX_LOG_DEBUG_SCRIPT NGX_LOG_DEBUG_HTTP /* TODO : add new section to log/conf directives */ - -#define ndk_conf_to_log(cf) ((cf)->log) - -#ifndef ndk_request_to_log -#define ndk_request_to_log(r) ((r)->connection->log) -#endif - - -/*********************************/ - -#if (NGX_HAVE_C99_VARIADIC_MACROS) - -#define ndk_log_stderr(log,...) ngx_log_error (NGX_LOG_STDERR, log, 0, __VA_ARGS__) -#define ndk_log_emerg(log,...) ngx_log_error (NGX_LOG_EMERG, log, 0, __VA_ARGS__) -#define ndk_log_alert(log,...) ngx_log_error (NGX_LOG_ALERT, log, 0, __VA_ARGS__) -#define ndk_log_crit(log,...) ngx_log_error (NGX_LOG_CRIT, log, 0, __VA_ARGS__) -#define ndk_log_err(log,...) ngx_log_error (NGX_LOG_ERR, log, 0, __VA_ARGS__) -#define ndk_log_warning(log,...) ngx_log_error (NGX_LOG_WARN, log, 0, __VA_ARGS__) -#define ndk_log_notice(log,...) ngx_log_error (NGX_LOG_NOTICE, log, 0, __VA_ARGS__) -#define ndk_log_info(log,...) ngx_log_error (NGX_LOG_INFO, log, 0, __VA_ARGS__) - -#define ndk_conf_log_stderr(cf,...) ngx_conf_log_error (NGX_LOG_STDERR, cf, 0, __VA_ARGS__) -#define ndk_conf_log_emerg(cf,...) ngx_conf_log_error (NGX_LOG_EMERG, cf, 0, __VA_ARGS__) -#define ndk_conf_log_alert(cf,...) ngx_conf_log_error (NGX_LOG_ALERT, cf, 0, __VA_ARGS__) -#define ndk_conf_log_crit(cf,...) ngx_conf_log_error (NGX_LOG_CRIT, cf, 0, __VA_ARGS__) -#define ndk_conf_log_err(cf,...) ngx_conf_log_error (NGX_LOG_ERR, cf, 0, __VA_ARGS__) -#define ndk_conf_log_warning(cf,...) ngx_conf_log_error (NGX_LOG_WARN, cf, 0, __VA_ARGS__) -#define ndk_conf_log_notice(cf,...) ngx_conf_log_error (NGX_LOG_NOTICE, cf, 0, __VA_ARGS__) -#define ndk_conf_log_info(cf,...) ngx_conf_log_error (NGX_LOG_INFO, cf, 0, __VA_ARGS__) - -#define ndk_request_log_stderr(r,...) ndk_log_stderr (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_emerg(r,...) ndk_log_emerg (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_alert(r,...) ndk_log_alert (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_crit(r,...) ndk_log_crit (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_err(r,...) ndk_log_err (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_warning(r,...) ndk_log_warning (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_notice(r,...) ndk_log_notice (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_info(r,...) ndk_log_info (ndk_request_to_log(r), __VA_ARGS__) - - -#if (NGX_DEBUG) - -#define ndk_log_debug_core(log,...) ngx_log_debug (NGX_LOG_DEBUG_CORE, log, 0, __VA_ARGS__) -#define ndk_log_debug_alloc(log,...) ngx_log_debug (NGX_LOG_DEBUG_ALLOC, log, 0, __VA_ARGS__) -#define ndk_log_debug_mutex(log,...) ngx_log_debug (NGX_LOG_DEBUG_MUTEX, log, 0, __VA_ARGS__) -#define ndk_log_debug_event(log,...) ngx_log_debug (NGX_LOG_DEBUG_EVENT, log, 0, __VA_ARGS__) -#define ndk_log_debug_http(log,...) ngx_log_debug (NGX_LOG_DEBUG_HTTP, log, 0, __VA_ARGS__) -#define ndk_log_debug_mail(log,...) ngx_log_debug (NGX_LOG_DEBUG_MAIL, log, 0, __VA_ARGS__) -#define ndk_log_debug_mysql(log,...) ngx_log_debug (NGX_LOG_DEBUG_MYSQL, log, 0, __VA_ARGS__) - -#define ndk_conf_log_debug_core(r,...) ndk_log_debug_core (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_alloc(r,...) ndk_log_debug_alloc (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_mutex(r,...) ndk_log_debug_mutex (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_event(r,...) ndk_log_debug_event (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_http(r,...) ndk_log_debug_http (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_mail(r,...) ndk_log_debug_mail (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_mysql(r,...) ndk_log_debug_mysql (ndk_conf_to_log(r), __VA_ARGS__) - -#define ndk_request_log_debug_core(r,...) ndk_log_debug_core (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_alloc(r,...) ndk_log_debug_alloc (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_mutex(r,...) ndk_log_debug_mutex (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_event(r,...) ndk_log_debug_event (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_http(r,...) ndk_log_debug_http (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_mail(r,...) ndk_log_debug_mail (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_mysql(r,...) ndk_log_debug_mysql (ndk_request_to_log(r), __VA_ARGS__) - -#else - -#define ndk_log_debug_core(log,...) -#define ndk_log_debug_alloc(log,...) -#define ndk_log_debug_mutex(log,...) -#define ndk_log_debug_event(log,...) -#define ndk_log_debug_http(log,...) -#define ndk_log_debug_mail(log,...) -#define ndk_log_debug_mysql(log,...) - -#define ndk_conf_log_debug_core(r,...) -#define ndk_conf_log_debug_alloc(r,...) -#define ndk_conf_log_debug_mutex(r,...) -#define ndk_conf_log_debug_event(r,...) -#define ndk_conf_log_debug_http(r,...) -#define ndk_conf_log_debug_mail(r,...) -#define ndk_conf_log_debug_mysql(r,...) - -#define ndk_request_log_debug_core(r,...) -#define ndk_request_log_debug_alloc(r,...) -#define ndk_request_log_debug_mutex(r,...) -#define ndk_request_log_debug_event(r,...) -#define ndk_request_log_debug_http(r,...) -#define ndk_request_log_debug_mail(r,...) -#define ndk_request_log_debug_mysql(r,...) - -#endif - - -/*********************************/ - -#elif (NGX_HAVE_GCC_VARIADIC_MACROS) - -#define ndk_log_stderr(log,args...) ngx_log_error (NGX_LOG_STDERR, log, 0, args) -#define ndk_log_emerg(log,args...) ngx_log_error (NGX_LOG_EMERG, log, 0, args) -#define ndk_log_alert(log,args...) ngx_log_error (NGX_LOG_ALERT, log, 0, args) -#define ndk_log_crit(log,args...) ngx_log_error (NGX_LOG_CRIT, log, 0, args) -#define ndk_log_err(log,args...) ngx_log_error (NGX_LOG_ERR, log, 0, args) -#define ndk_log_warning(log,args...) ngx_log_error (NGX_LOG_WARN, log, 0, args) -#define ndk_log_notice(log,args...) ngx_log_error (NGX_LOG_NOTICE, log, 0, args) -#define ndk_log_info(log,args...) ngx_log_error (NGX_LOG_INFO, log, 0, args) - -#define ndk_log_debug_core(log,args...) ngx_log_debug (NGX_LOG_DEBUG_CORE, log, 0, args) -#define ndk_log_debug_alloc(log,args...) ngx_log_debug (NGX_LOG_DEBUG_ALLOC, log, 0, args) -#define ndk_log_debug_mutex(log,args...) ngx_log_debug (NGX_LOG_DEBUG_MUTEX, log, 0, args) -#define ndk_log_debug_event(log,args...) ngx_log_debug (NGX_LOG_DEBUG_EVENT, log, 0, args) -#define ndk_log_debug_http(log,args...) ngx_log_debug (NGX_LOG_DEBUG_HTTP, log, 0, args) -#define ndk_log_debug_mail(log,args...) ngx_log_debug (NGX_LOG_DEBUG_MAIL, log, 0, args) -#define ndk_log_debug_mysql(log,args...) ngx_log_debug (NGX_LOG_DEBUG_MYSQL, log, 0, args) -#define ndk_log_debug_script(log,args...) ngx_log_debug (NGX_LOG_DEBUG_SCRIPT, log, 0, args) - -#define ndk_conf_log_stderr(cf,args...) ngx_conf_log_error (NGX_LOG_STDERR, cf, 0, args) -#define ndk_conf_log_emerg(cf,args...) ngx_conf_log_error (NGX_LOG_EMERG, cf, 0, args) -#define ndk_conf_log_alert(cf,args...) ngx_conf_log_error (NGX_LOG_ALERT, cf, 0, args) -#define ndk_conf_log_crit(cf,args...) ngx_conf_log_error (NGX_LOG_CRIT, cf, 0, args) -#define ndk_conf_log_err(cf,args...) ngx_conf_log_error (NGX_LOG_ERR, cf, 0, args) -#define ndk_conf_log_warning(cf,args...) ngx_conf_log_error (NGX_LOG_WARN, cf, 0, args) -#define ndk_conf_log_notice(cf,args...) ngx_conf_log_error (NGX_LOG_NOTICE, cf, 0, args) -#define ndk_conf_log_info(cf,args...) ngx_conf_log_error (NGX_LOG_INFO, cf, 0, args) - -#define ndk_conf_log_debug_core(r,args...) ndk_log_debug_core (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_alloc(r,args...) ndk_log_debug_alloc (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_mutex(r,args...) ndk_log_debug_mutex (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_event(r,args...) ndk_log_debug_event (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_http(r,args...) ndk_log_debug_http (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_mail(r,args...) ndk_log_debug_mail (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_mysql(r,args...) ndk_log_debug_mysql (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_script(r,args...) ndk_log_debug_script (ndk_conf_to_log(r), args) - -#define ndk_request_log_stderr(r,args...) ndk_log_stderr (ndk_request_to_log(r), args) -#define ndk_request_log_emerg(r,args...) ndk_log_emerg (ndk_request_to_log(r), args) -#define ndk_request_log_alert(r,args...) ndk_log_alert (ndk_request_to_log(r), args) -#define ndk_request_log_crit(r,args...) ndk_log_crit (ndk_request_to_log(r), args) -#define ndk_request_log_err(r,args...) ndk_log_err (ndk_request_to_log(r), args) -#define ndk_request_log_warning(r,args...) ndk_log_warning (ndk_request_to_log(r), args) -#define ndk_request_log_notice(r,args...) ndk_log_notice (ndk_request_to_log(r), args) -#define ndk_request_log_info(r,args...) ndk_log_info (ndk_request_to_log(r), args) - -#define ndk_request_log_debug_core(r,args...) ndk_log_debug_core (ndk_request_to_log(r), args) -#define ndk_request_log_debug_alloc(r,args...) ndk_log_debug_alloc (ndk_request_to_log(r), args) -#define ndk_request_log_debug_mutex(r,args...) ndk_log_debug_mutex (ndk_request_to_log(r), args) -#define ndk_request_log_debug_event(r,args...) ndk_log_debug_event (ndk_request_to_log(r), args) -#define ndk_request_log_debug_http(r,args...) ndk_log_debug_http (ndk_request_to_log(r), args) -#define ndk_request_log_debug_mail(r,args...) ndk_log_debug_mail (ndk_request_to_log(r), args) -#define ndk_request_log_debug_mysql(r,args...) ndk_log_debug_mysql (ndk_request_to_log(r), args) -#define ndk_request_log_debug_script(r,args...) ndk_log_debug_script (ndk_request_to_log(r), args) - -/*********************************/ - -#else /* NO VARIADIC MACROS */ - -/* #warning does not work on Windows */ -#pragma message("Nginx Devel Kit logging without variadic macros not yet implemented") - -#endif /* VARIADIC MACROS */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_parse.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_parse.h deleted file mode 100644 index 7c43e14..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_parse.h +++ /dev/null @@ -1,67 +0,0 @@ - - - -#if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED) - -#define ndk_str3_cmp(m, c0, c1, c2, c3) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) - -#define ndk_str3Ocmp(m, c0, c1, c2, c3) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) - -#define ndk_str4cmp(m, c0, c1, c2, c3) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) - -#define ndk_str5cmp(m, c0, c1, c2, c3, c4) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && m[4] == c4 - -#define ndk_str6cmp(m, c0, c1, c2, c3, c4, c5) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && (((uint32_t *) m)[1] & 0xffff) == ((c5 << 8) | c4) - -#define ndk_str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) - -#define ndk_str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) - -#define ndk_str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) \ - && m[8] == c8 - -#else /* !(NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED) */ - -#define ndk_str3_cmp(m, c0, c1, c2, c3) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 - -#define ndk_str3Ocmp(m, c0, c1, c2, c3) \ - m[0] == c0 && m[2] == c2 && m[3] == c3 - -#define ndk_str4cmp(m, c0, c1, c2, c3) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 - -#define ndk_str5cmp(m, c0, c1, c2, c3, c4) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 && m[4] == c4 - -#define ndk_str6cmp(m, c0, c1, c2, c3, c4, c5) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \ - && m[4] == c4 && m[5] == c5 - -#define ndk_str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \ - && m[4] == c4 && m[5] == c5 && m[6] == c6 - -#define ndk_str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \ - && m[4] == c4 && m[5] == c5 && m[6] == c6 && m[7] == c7 - -#define ndk_str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \ - && m[4] == c4 && m[5] == c5 && m[6] == c6 && m[7] == c7 && m[8] == c8 - -#endif - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.c deleted file mode 100644 index 0b7c266..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.c +++ /dev/null @@ -1,583 +0,0 @@ - - - -/* This function cleans a path to its most basic form, performing the following transformations : - * - * - ./ -> [empty] - * - // -> / - * - /base/parent/../ -> /base/ - * - * If possible, it leaves the original string in place and does not copy characters, otherwise - * characters are copied. -*/ - -void -ndk_clean_path (ngx_str_t *path, ngx_uint_t complex, size_t off) -{ - u_char *s, *p, *m, *e, c, *l; - ngx_uint_t root; - - if (path->len == 1) { - - if (path->data[0] == '.') { - path->len = 0; - } - - return; - } - - /* strip initial './' */ - - s = path->data; - e = s + path->len; - - if (off) { - p = s + off; - goto check_basic; - } - - if (*s == '/') - root = 1; - else - root = 0; - - while (s < e) { - - switch (*s) { - - case '/' : - - /* '//' => '/' */ - - s++; - continue; - - case '.' : - - if (s == e-1) { - - if (root) { - path->data[0] = '/'; - path->len = 1; - } else { - path->len = 0; - } - - return; - } - - /* './' => '' */ - - if (s[1] == '/') { - - s += 2; - - if (s == e) { - - path->len = 0; - return; - } - - continue; - } - } - - break; - } - - if (root && *s != '/') { - s--; - } - - p = s; - -check_basic : - - for ( ; p '/' */ - - m = p + 2; - goto copy; - - case '.' : - - if (e - p == 2) - break; - - switch (p[2]) { - - case '/' : - - /* './' => '' */ - - m = p + 2; - goto copy; - - case '.' : - - if (e - p == 3 || p[3] == '/') { - - if (p == s) { - - s += 3; - continue; - } - - if (p - s >= 2) { - - if (p[-1] == '.' && p[-2] == '.') { - - if (p - s == 2 || p[-3] == '/') { /* = '../../' */ - - p += 2; /* 3? */ - continue; - } - } - } - - m = p + 4; - - if (complex) { - - for (p--; p >= s; p--) { - - switch (*p) { - - case '/' : - goto copy; - - case '$' : - - p = m - 1; - - if (m == e) - goto end_basic; - - goto new_dir_first; - } - } - - } else { - - for (p--; p > s; p--) { - - /* '/path/folder/../' => '/path/' */ - - if (*p == '/') - break; - } - } - - goto copy; - } - } - } - } - } - -end_basic : - - path->data = s; - path->len = p - s; - - return; - -copy : - - p++; - - if (m < e) - goto new_dir; - - while (m < e) { - - c = *m; - *p = c; - p++; - - if (c == '/') { - - m++; - - new_dir : - - for ( ; m '' */ - - m += 2; - if (m == e) - break; - - goto new_dir; - - case '.' : - - if (e - m == 2 || m[2] == '/') { - - if (m - s >= 3) { /* NOTE : this is one higher than above because m has moved on 1 */ - - if (p[-2] == '.' && p[-3] == '.') { - - if (m - s == 3 || p[-4] == '/') { /* = '../../' */ - - p[0] = '.'; - p[1] = '.'; - p[2] = '/'; - p += 3; - m += 3; - goto new_dir; - } - } - } - - if (complex) { - - l = p; - - for (p -= 2; p >= s; p--) { - - switch (*p) { - - case '/' : - break; - - case '$' : - - l[0] = '.'; - l[1] = '.'; - l[2] = '/'; - p = l + 4; - break; - - default : - continue; - } - - break; - } - - m += 3; - if (m == e) - goto end; - - goto new_dir; - - } else { - - for (p -= 2; p > s; p--) { - - /* '/path/folder/../' => '/path/' */ - - if (*p == '/') - break; - } - - m += 3; - if (m == e) - goto end; - - goto new_dir; - } - } - } - } - - } else { - m++; - } - } - -end : - - path->data = s; - path->len = p - s; -} - - -/* This function converts a path to its directory version, and assumes that there is always space - * to allocatate an extra character on the end (which is only true if the provided strings always - * have NULL's at the end (hence the 'safe'). -*/ - -void -ndk_path_to_dir_safe (ngx_str_t *path, ngx_uint_t complex, size_t off) -{ - size_t len; - u_char *p, *m; - - ndk_clean_path (path, complex, off); - - len = path->len; - if (!len) - return; - - p = path->data; - m = p + len - 1; - - if (*m != '/') { - - p [len] = '/'; - path->len++; - } -} - - -/* Divides a path given by path/to/path1:path/to/path2 into separate strings and returns an - * array of these strings. -*/ - -ngx_array_t * -ndk_split_path_create (ngx_conf_t *cf, ngx_str_t *path) -{ - ngx_str_t *str; - int n; - u_char *m, *s, *e; - ngx_array_t *a; - - if (path == NULL) - return NULL; - - n = ndk_strcntc (path, ':'); - - a = ngx_array_create (cf->pool, n + 1, sizeof (ngx_str_t)); - if (a == NULL) { - return NULL; - } - - s = path->data; - e = s + path->len; - - while (s < e) { - - m = s; - - while (m < e && *m != ':') m++; - - if (m == s) { - s = m+1; - continue; - } - - str = ngx_array_push (a); - if (str == NULL) { - return NULL; - } - - str->data = s; - str->len = m - s; - - if (ngx_conf_full_name (cf->cycle, str, 0) == NGX_ERROR) - return NULL; - - s = m+1; - } - - return a; -} - - - -ngx_array_t * -ndk_split_path_create_raw (ngx_conf_t *cf, char *path) -{ - ngx_str_t *str; - int n; - char *m, *s; - ngx_array_t *a; - - if (path == NULL) - return NULL; - - n = ndk_strccnt (path, ':'); - - a = ngx_array_create (cf->pool, n + 1, sizeof (ngx_str_t)); - if (a == NULL) { - return NULL; - } - - s = path; - - - while (*s != '\0') { - - m = s; - - while (*m != '\0' && *m != ':') m++; - - if (m == s) { - s = m+1; - continue; - } - - str = ngx_array_push (a); - if (str == NULL) { - return NULL; - } - - str->data = (u_char *) s; - str->len = m - s; - - if (ngx_conf_full_name (cf->cycle, str, 0) == NGX_ERROR) - return NULL; - - if (*m == '\0') - break; - - s = m+1; - } - - return a; -} - - - -char * -ndk_conf_set_full_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *path, *value; - ngx_conf_post_t *post; - - path = (ngx_str_t *) (p + cmd->offset); - - if (path->data) { - return "is duplicate"; - } - - value = cf->args->elts; - - *path = value[1]; - - if (ngx_conf_full_name (cf->cycle, path, 0) == NGX_ERROR) - return NGX_CONF_ERROR; - - if (cmd->post) { - post = cmd->post; - return post->post_handler(cf, post, path); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_split_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - /* TODO : change to use the path func above */ - - char *p = conf; - - ngx_str_t *value, *str; - ngx_array_t **a; - ngx_conf_post_t *post; - int n; - u_char *m, *s, *e; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a != NGX_CONF_UNSET_PTR) { - return "is duplicate"; - } - - value = cf->args->elts; - value++; - - n = ndk_strcntc (value, ':') + 1; - - *a = ngx_array_create (cf->pool, n, sizeof (ngx_str_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - - s = value->data; - e = s + value->len; - - while (s < e) { - - m = s; - - while (m < e && *m != ':') m++; - - if (m == s) { - s = m+1; - continue; - } - - str = ngx_array_push (*a); - if (str == NULL) { - return NGX_CONF_ERROR; - } - - str->data = s; - str->len = m - s; - - if (ngx_conf_full_name (cf->cycle, str, 0) == NGX_ERROR) - return NGX_CONF_ERROR; - - s = m+1; - } - - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_full_path (ngx_conf_t *cf, void *data, ngx_str_t *path) -{ - if (ngx_conf_full_name (cf->cycle, path, 0) == NGX_ERROR) - return NGX_CONF_ERROR; - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_full_conf_path (ngx_conf_t *cf, void *data, ngx_str_t *path) -{ - if (ngx_conf_full_name (cf->cycle, path, 1) == NGX_ERROR) - return NGX_CONF_ERROR; - - return NGX_CONF_OK; -} - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.h deleted file mode 100644 index 22ba945..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.h +++ /dev/null @@ -1,22 +0,0 @@ - - -/* path conversion functions */ - -void ndk_clean_path (ngx_str_t *path, ngx_uint_t complex, size_t off); -void ndk_path_to_dir_safe (ngx_str_t *path, ngx_uint_t complex, size_t off); - -/* path create functions */ - -ngx_array_t * ndk_split_path_create (ngx_conf_t *cf, ngx_str_t *path); -ngx_array_t * ndk_split_path_create_raw (ngx_conf_t *cf, char *path); - -/* conf set functions */ - -char * ndk_conf_set_full_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_split_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - -/* conf set post functions */ - -char * ndk_conf_set_full_path (ngx_conf_t *cf, void *data, ngx_str_t *path); -char * ndk_conf_set_full_conf_path (ngx_conf_t *cf, void *data, ngx_str_t *path); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.c deleted file mode 100644 index fbc789c..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.c +++ /dev/null @@ -1,20 +0,0 @@ - -ngx_int_t -ndk_init_signals (ngx_signal_t *sig, ngx_log_t *log) -{ - struct sigaction sa; - - for ( ; sig->signo != 0; sig++) { - ndk_zerov (sa); - sa.sa_handler = sig->handler; - sigemptyset (&sa.sa_mask); - - if (sigaction (sig->signo, &sa, NULL) == -1) { - ngx_log_error (NGX_LOG_EMERG, log, ngx_errno, - "sigaction(%s) failed", sig->signame); - return NGX_ERROR; - } - } - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.h deleted file mode 100644 index 7ac1d99..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.h +++ /dev/null @@ -1,12 +0,0 @@ - - -typedef struct { - int signo; - char *signame; - char *name; - void (*handler)(int signo); -} ngx_signal_t; - - -ngx_int_t ndk_init_signals (ngx_signal_t *sig, ngx_log_t *log); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.c deleted file mode 100644 index c1efd86..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.c +++ /dev/null @@ -1,215 +0,0 @@ - - -char * -ndk_conf_set_regex_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_conf_post_t *post; - ngx_regex_elt_t *re; - ngx_regex_compile_t rc; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - - re = (ngx_regex_elt_t *) (p + cmd->offset); - - if (re->name) { - return "is duplicate"; - } - - value = cf->args->elts; - value++; - - ndk_zerov (rc); - - rc.pool = cf->pool; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; - rc.pattern = *value; - - if (ngx_regex_compile(&rc) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V", &rc.err); - return NGX_CONF_ERROR; - } - - re->regex = rc.regex; - re->name = value->data; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, re); - } - - return NGX_CONF_OK; -} - - -char * -ndk_conf_set_regex_caseless_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_conf_post_t *post; - ngx_regex_elt_t *re; - ngx_regex_compile_t rc; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - - re = (ngx_regex_elt_t *) (p + cmd->offset); - - if (re->name) { - return "is duplicate"; - } - - value = cf->args->elts; - value++; - - ndk_zerov (rc); - - rc.pool = cf->pool; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; - rc.pattern = *value; - rc.options = NGX_REGEX_CASELESS; - - if (ngx_regex_compile(&rc) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V", &rc.err); - return NGX_CONF_ERROR; - } - - re->regex = rc.regex; - re->name = value->data; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, re); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_regex_array_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_conf_post_t *post; - ngx_array_t **a; - ngx_regex_elt_t *re; - ngx_regex_compile_t rc; - ngx_uint_t i, n = 0; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a != NGX_CONF_UNSET_PTR) { - - n = cf->args->nelts > 4 ? cf->args->nelts : 4; - - *a = ngx_array_create (cf->pool, n, sizeof (ngx_regex_elt_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - ndk_zerov (rc); - - rc.pool = cf->pool; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; - - value = cf->args->elts; - value++; - - for (i=0; iregex = rc.regex; - re->name = value->data; - } - - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_regex_array_caseless_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_conf_post_t *post; - ngx_array_t **a; - ngx_regex_elt_t *re; - ngx_regex_compile_t rc; - ngx_uint_t i, n = 0; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a != NGX_CONF_UNSET_PTR) { - - n = cf->args->nelts > 4 ? cf->args->nelts : 4; - - *a = ngx_array_create (cf->pool, n, sizeof (ngx_regex_elt_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - ndk_zerov (rc); - - rc.pool = cf->pool; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; - - value = cf->args->elts; - value++; - - for (i=0; iregex = rc.regex; - re->name = value->data; - } - - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.h deleted file mode 100644 index 4319b04..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.h +++ /dev/null @@ -1,7 +0,0 @@ - - -char * ndk_conf_set_regex_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_regex_caseless_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_regex_array_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_regex_array_caseless_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.c deleted file mode 100644 index 77ce9f8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.c +++ /dev/null @@ -1,103 +0,0 @@ - - -/* these have been taken from the rewrite module and http_script file - * because those functions are defined as being static - a patch will - * be provided later to un-define them as being static - */ - - -uintptr_t ndk_http_script_exit_code = (uintptr_t) NULL; - - -char * -ndk_http_rewrite_value (ngx_conf_t *cf, ndk_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) -{ - ngx_int_t n; - ngx_http_script_compile_t sc; - ngx_http_script_value_code_t *val; - ngx_http_script_complex_value_code_t *complex; - - n = ngx_http_script_variables_count(value); - - if (n == 0) { - val = ngx_http_script_start_code(cf->pool, &lcf->codes, - sizeof(ngx_http_script_value_code_t)); - if (val == NULL) { - return NGX_CONF_ERROR; - } - - n = ngx_atoi(value->data, value->len); - - if (n == NGX_ERROR) { - n = 0; - } - - val->code = ngx_http_script_value_code; - val->value = (uintptr_t) n; - val->text_len = (uintptr_t) value->len; - val->text_data = (uintptr_t) value->data; - - return NGX_CONF_OK; - } - - complex = ngx_http_script_start_code(cf->pool, &lcf->codes, - sizeof(ngx_http_script_complex_value_code_t)); - if (complex == NULL) { - return NGX_CONF_ERROR; - } - - complex->code = ngx_http_script_complex_value_code; - complex->lengths = NULL; - - ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); - - sc.cf = cf; - sc.source = value; - sc.lengths = &complex->lengths; - sc.values = &lcf->codes; - sc.variables = n; - sc.complete_lengths = 1; - - if (ngx_http_script_compile(&sc) != NGX_OK) { - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - - -ngx_int_t -ndk_http_rewrite_var (ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) -{ - ngx_http_variable_t *var; - ngx_http_core_main_conf_t *cmcf; - ndk_http_rewrite_loc_conf_t *rlcf; - - rlcf = ngx_http_get_module_loc_conf(r, ngx_http_rewrite_module); - - if (rlcf->uninitialized_variable_warn == 0) { - *v = ngx_http_variable_null_value; - return NGX_OK; - } - - cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); - - var = cmcf->variables.elts; - - /* - * the ngx_http_rewrite_module sets variables directly in r->variables, - * and they should be handled by ngx_http_get_indexed_variable(), - * so the handler is called only if the variable is not initialized - */ - - ngx_log_error(NGX_LOG_WARN, r->connection->log, 0, - "using uninitialized \"%V\" variable", &var[data].name); - - *v = ngx_http_variable_null_value; - - return NGX_OK; -} - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.h deleted file mode 100644 index 2479aa2..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.h +++ /dev/null @@ -1,26 +0,0 @@ - - -/* TODO : should remove this when not needed */ - - - -/* used for plugging into the rewrite module (taken from the rewrite module) */ - -typedef struct { - ngx_array_t *codes; /* uintptr_t */ - ngx_uint_t stack_size; - ngx_flag_t log; - ngx_flag_t uninitialized_variable_warn; -} ndk_http_rewrite_loc_conf_t; - - -extern ngx_module_t ngx_http_rewrite_module; -extern uintptr_t ndk_http_script_exit_code; - -char * ndk_http_rewrite_value (ngx_conf_t *cf, ndk_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value); -ngx_int_t ndk_http_rewrite_var (ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -#define ndk_http_script_exit (u_char *) &ndk_http_script_exit_code - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.c deleted file mode 100644 index 388f873..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.c +++ /dev/null @@ -1,602 +0,0 @@ -#include - - -typedef struct { - ngx_http_script_code_pt code; - void *func; -} ndk_set_var_code_t; - - -typedef struct { - ngx_http_script_code_pt code; - void *func; - size_t size; -} ndk_set_var_size_code_t; - - -typedef struct { - ngx_http_script_code_pt code; - void *func; - void *data; -} ndk_set_var_data_code_t; - - -typedef struct { - ngx_http_script_code_pt code; - void *func; - size_t size; - void *data; -} ndk_set_var_size_data_code_t; - - -typedef struct { - ngx_int_t index; - ngx_str_t *value; - ngx_http_variable_t *v; - ngx_conf_t *cf; - ndk_http_rewrite_loc_conf_t *rlcf; -} ndk_set_var_info_t; - - -static void ndk_set_var_code (ngx_http_script_engine_t *e); -static void ndk_set_var_hash_code (ngx_http_script_engine_t *e); -static void ndk_set_var_value_code (ngx_http_script_engine_t *e); - - -static ngx_inline void -ndk_set_var_code_finalize(ngx_http_script_engine_t *e, ngx_int_t rc, - ngx_http_variable_value_t *v, ngx_str_t *str) -{ - switch (rc) { - - case NGX_OK: - - v->data = str->data; - v->len = str->len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0, - "http script value (post filter): \"%v\"", v); - break; - - case NGX_DECLINED: - - v->valid = 0; - v->not_found = 1; - v->no_cacheable = 1; - break; - - case NGX_ERROR: - - e->ip = ndk_http_script_exit; - e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; - break; - } -} - - - -static void -ndk_set_var_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_code_t *sv; - ndk_set_var_pt func; - - sv = (ndk_set_var_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_code_t); - - v = e->sp++; - - func = (ndk_set_var_pt) sv->func; - - rc = func(e->request, &str); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_data_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_data_code_t *svd; - ndk_set_var_data_pt func; - - svd = (ndk_set_var_data_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_data_code_t); - - v = e->sp++; - - func = (ndk_set_var_data_pt) svd->func; - - rc = func(e->request, &str, svd->data); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_value_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_code_t *sv; - ndk_set_var_value_pt func; - - sv = (ndk_set_var_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_code_t); - - v = e->sp - 1; - - func = (ndk_set_var_value_pt) sv->func; - - rc = func(e->request, &str, v); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_value_data_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_data_code_t *svd; - ndk_set_var_value_data_pt func; - - svd = (ndk_set_var_data_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_data_code_t); - - v = e->sp - 1; - - func = (ndk_set_var_value_data_pt) svd->func; - - rc = func(e->request, &str, v, svd->data); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_multi_value_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_size_code_t *svs; - ndk_set_var_value_pt func; - - svs = (ndk_set_var_size_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_size_code_t); - - v = e->sp - svs->size; - e->sp = v + 1; - - func = (ndk_set_var_value_pt) svs->func; - - rc = func(e->request, &str, v); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_multi_value_data_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_size_data_code_t *svsd; - ndk_set_var_value_data_pt func; - - svsd = (ndk_set_var_size_data_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_size_data_code_t); - - v = e->sp - svsd->size; - e->sp = v + 1; - - func = (ndk_set_var_value_data_pt) svsd->func; - - rc = func(e->request, &str, v, svsd->data); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_hash_code(ngx_http_script_engine_t *e) -{ - u_char *p; - ngx_http_variable_value_t *v; - ndk_set_var_size_code_t *svs; - ndk_set_var_hash_pt func; - - svs = (ndk_set_var_size_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_size_code_t); - - p = ngx_palloc(e->request->pool, svs->size); - if (p == NULL) { - e->ip = ndk_http_script_exit; - e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; - return; - } - - v = e->sp - 1; - - func = (ndk_set_var_hash_pt) svs->func; - - func(p, (char *) v->data, v->len); - - v->data = (u_char *) p; - v->len = svs->size; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0, - "http script hashed value: \"%v\"", v); -} - - - -static char * -ndk_set_var_name(ndk_set_var_info_t *info, ngx_str_t *varname) -{ - ngx_int_t index; - ngx_http_variable_t *v; - ngx_conf_t *cf; - ndk_http_rewrite_loc_conf_t *rlcf; - ngx_str_t name; - - name = *varname; - - cf = info->cf; - rlcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_rewrite_module); - - if (name.data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid variable name \"%V\"", &name); - return NGX_CONF_ERROR; - } - - name.len--; - name.data++; - - v = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); - if (v == NULL) { - return NGX_CONF_ERROR; - } - - index = ngx_http_get_variable_index(cf, &name); - if (index == NGX_ERROR) { - return NGX_CONF_ERROR; - } - - if (v->get_handler == NULL - && ngx_strncasecmp(name.data, (u_char *) "arg_", 4) != 0 - && ngx_strncasecmp(name.data, (u_char *) "cookie_", 7) != 0 - && ngx_strncasecmp(name.data, (u_char *) "http_", 5) != 0 - && ngx_strncasecmp(name.data, (u_char *) "sent_http_", 10) != 0 - && ngx_strncasecmp(name.data, (u_char *) "upstream_http_", 14) != 0) - { - v->get_handler = ndk_http_rewrite_var; - v->data = index; - } - - info->v = v; - info->index = index; - info->rlcf = rlcf; - - return NGX_CONF_OK; -} - - - -static void -ndk_set_variable_value_space(ndk_http_rewrite_loc_conf_t *rlcf, ngx_uint_t count) -{ - /* if the number of variable values that will be used is greater than 10, - * make sure there is enough space allocated on the rewrite value stack - */ - - if (count <= 10) - return; - - if (rlcf->stack_size == NGX_CONF_UNSET_UINT) { - rlcf->stack_size = count; - return; - } - - if (rlcf->stack_size < count) - rlcf->stack_size = count; -} - - - -static char * -ndk_set_var_filter(ngx_conf_t *cf, ndk_http_rewrite_loc_conf_t *rlcf, - ndk_set_var_t *filter) -{ - ndk_set_var_code_t *sv; - ndk_set_var_size_code_t *svs; - ndk_set_var_data_code_t *svd; - ndk_set_var_size_data_code_t *svsd; - - if (filter == NULL) { - return "no filter set"; - } - - switch (filter->type) { - case NDK_SET_VAR_BASIC: - - sv = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_code_t)); - if (sv == NULL) { - return NGX_CONF_ERROR; - } - - sv->code = ndk_set_var_code; - sv->func = filter->func; - break; - - case NDK_SET_VAR_DATA: - - svd = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_data_code_t)); - if (svd == NULL) { - return NGX_CONF_ERROR; - } - - svd->code = ndk_set_var_data_code; - svd->func = filter->func; - svd->data = filter->data; - break; - - case NDK_SET_VAR_VALUE: - - sv = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_code_t)); - if (sv == NULL) { - return NGX_CONF_ERROR; - } - - sv->code = ndk_set_var_value_code; - sv->func = filter->func; - break; - - case NDK_SET_VAR_VALUE_DATA: - - svd = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_data_code_t)); - if (svd == NULL) { - return NGX_CONF_ERROR; - } - - svd->code = ndk_set_var_value_data_code; - svd->func = filter->func; - svd->data = filter->data; - break; - - case NDK_SET_VAR_MULTI_VALUE: - - svs = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_size_code_t)); - if (svs == NULL) { - return NGX_CONF_ERROR; - } - - svs->code = ndk_set_var_multi_value_code; - svs->func = filter->func; - svs->size = filter->size; - - ndk_set_variable_value_space(rlcf, svs->size); - break; - - case NDK_SET_VAR_MULTI_VALUE_DATA: - - svsd = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_size_data_code_t)); - if (svsd == NULL) { - return NGX_CONF_ERROR; - } - - svsd->code = ndk_set_var_multi_value_data_code; - svsd->func = filter->func; - svsd->size = filter->size; - svsd->data = filter->data; - - ndk_set_variable_value_space(rlcf, svsd->size); - break; - - - case NDK_SET_VAR_HASH: - - svs = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_size_code_t)); - if (svs == NULL) { - return NGX_CONF_ERROR; - } - - svs->code = ndk_set_var_hash_code; - svs->func = filter->func; - svs->size = filter->size; - break; - - default: - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid filter type \"%ul\"", filter->type); - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - - -static char * -ndk_set_var_filter_value(ndk_set_var_info_t *info, ndk_set_var_t *filter) -{ - ngx_conf_t *cf; - ngx_http_variable_t *v; - ndk_http_rewrite_loc_conf_t *rlcf; - ngx_http_script_var_code_t *vcode; - ngx_http_script_var_handler_code_t *vhcode; - - v = info->v; - cf = info->cf; - rlcf = info->rlcf; - - if (ndk_set_var_filter(cf, rlcf, filter) != NGX_CONF_OK) { - return NGX_CONF_ERROR; - } - - if (v->set_handler) { - vhcode = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ngx_http_script_var_handler_code_t)); - if (vhcode == NULL) { - return NGX_CONF_ERROR; - } - - vhcode->code = ngx_http_script_var_set_handler_code; - vhcode->handler = v->set_handler; - vhcode->data = v->data; - - return NGX_CONF_OK; - } - - vcode = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ngx_http_script_var_code_t)); - if (vcode == NULL) { - return NGX_CONF_ERROR; - } - - vcode->code = ngx_http_script_set_var_code; - vcode->index = (uintptr_t) info->index; - - return NGX_CONF_OK; -} - - -char * -ndk_set_var_core(ngx_conf_t *cf, ngx_str_t *name, ndk_set_var_t *filter) -{ - char *p; - ndk_set_var_info_t info; - - info.cf = cf; - - p = ndk_set_var_name(&info, name); - if (p != NGX_CONF_OK) { - return p; - } - - return ndk_set_var_filter_value(&info, filter); -} - - -char * -ndk_set_var_value_core(ngx_conf_t *cf, ngx_str_t *name, ngx_str_t *value, ndk_set_var_t *filter) -{ - char *p; - ndk_set_var_info_t info; - - info.cf = cf; - - p = ndk_set_var_name(&info, name); - if (p != NGX_CONF_OK) { - return p; - } - - p = ndk_http_rewrite_value(cf, info.rlcf, value); - if (p != NGX_CONF_OK) { - return p; - } - - return ndk_set_var_filter_value(&info, filter); -} - - -char * -ndk_set_var_multi_value_core(ngx_conf_t *cf, ngx_str_t *name, - ngx_str_t *value, ndk_set_var_t *filter) -{ - char *p; - ndk_set_var_info_t info; - ngx_int_t i; - - info.cf = cf; - - p = ndk_set_var_name(&info, name); - if (p != NGX_CONF_OK) { - return p; - } - - for (i = filter->size; i; i--, value++) { - - p = ndk_http_rewrite_value(cf, info.rlcf, value); - if (p != NGX_CONF_OK) { - return p; - } - } - - return ndk_set_var_filter_value(&info, filter); -} - - -char * -ndk_set_var(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t *filter; - - value = cf->args->elts; - value++; - - filter = (ndk_set_var_t *) cmd->post; - - return ndk_set_var_core(cf, value, filter); -} - - -char * -ndk_set_var_value(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t *filter; - - value = cf->args->elts; - value++; - - filter = (ndk_set_var_t *) cmd->post; - - return ndk_set_var_value_core(cf, value, - cf->args->nelts == 1 + 1 ? value : value + 1, filter); -} - - -char * -ndk_set_var_multi_value(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t *filter; - - value = cf->args->elts; - value++; - - filter = (ndk_set_var_t *) cmd->post; - - return ndk_set_var_multi_value_core(cf, value, value + 1, filter); -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.h deleted file mode 100644 index 5dcba97..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 2010 (C) Marcus Clyne - */ - -#ifndef _NDK_SET_VAR_H_INCLUDED_ -#define _NDK_SET_VAR_H_INCLUDED_ - - -typedef ngx_int_t (*ndk_set_var_pt) (ngx_http_request_t *r, ngx_str_t *val); -typedef ngx_int_t (*ndk_set_var_data_pt) (ngx_http_request_t *r, ngx_str_t *val, void *data); -typedef ngx_int_t (*ndk_set_var_value_pt) (ngx_http_request_t *r, ngx_str_t *val, ngx_http_variable_value_t *v); -typedef ngx_int_t (*ndk_set_var_value_data_pt) (ngx_http_request_t *r, ngx_str_t *val, ngx_http_variable_value_t *v, void *data); -typedef void (*ndk_set_var_hash_pt) (u_char *p, char *data, size_t len); - - -typedef struct { - ngx_uint_t type; - void *func; - size_t size; - void *data; -} ndk_set_var_t; - - -enum { - NDK_SET_VAR_BASIC = 0, - NDK_SET_VAR_DATA, - NDK_SET_VAR_VALUE, - NDK_SET_VAR_VALUE_DATA, - NDK_SET_VAR_MULTI_VALUE, - NDK_SET_VAR_MULTI_VALUE_DATA, - NDK_SET_VAR_HASH -}; - - -char * ndk_set_var (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_set_var_value (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_set_var_multi_value (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - - -char * ndk_set_var_core (ngx_conf_t *cf, ngx_str_t *name, ndk_set_var_t *filter); -char * ndk_set_var_value_core (ngx_conf_t *cf, ngx_str_t *name, ngx_str_t *value, ndk_set_var_t *filter); -char * ndk_set_var_multi_value_core (ngx_conf_t *cf, ngx_str_t *name, ngx_str_t *value, ndk_set_var_t *filter); - -#endif /* _NDK_SET_VAR_H_INCLUDED_ */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.c deleted file mode 100644 index 7c2a965..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.c +++ /dev/null @@ -1,434 +0,0 @@ - - -int64_t -ndk_atoi64 (u_char *line, size_t n) -{ - int64_t value; - - if (n == 0ll) { - return NGX_ERROR; - } - - for (value = 0ll; n--; line++) { - if (*line < '0' || *line > '9') { - return NGX_ERROR; - } - - value = value * 10ll + (*line - '0'); - } - - if (value < 0ll) { - return NGX_ERROR; - } - - return value; -} - - -ngx_int_t -ndk_strcntc (ngx_str_t *s, char c) -{ - ngx_int_t n; - size_t i; - u_char *p; - - i = s->len; - p = s->data; - - for (n=0; i; i--, p++) { - - if (*p == (u_char) c) - n++; - } - - return n; -} - - -ngx_int_t -ndk_strccnt (char *s, char c) -{ - ngx_int_t n; - - n = 0; - - while (*s != '\0') { - - if (*s == 'c') - n++; - - s++; - } - - return n; -} - - - -ngx_array_t * -ndk_str_array_create (ngx_pool_t *pool, char **s, ngx_int_t n) -{ - ngx_int_t i; - ngx_str_t *str; - ngx_array_t *a; - - a = ngx_array_create (pool, n, sizeof (ngx_str_t)); - if (a == NULL) - return NULL; - - - for (i=0; idata = (u_char *) *s; - str->len = strlen (*s); - } - - return a; -} - - - -u_char * -ndk_vcatstrf (ngx_pool_t *pool, ngx_str_t *dest, const char *fmt, va_list args) -{ - size_t len, l, el; - int argc; - u_char *p, *m, *e, c, c1, *cp; - - argc = strlen (fmt); - - ngx_str_t *s; - ndk_estr_t *sp, *sp2, ss [argc]; - u_char cs [argc]; - - sp = sp2 = ss; - cp = cs; - - len = 0; - - /* TODO : maybe have 'e' at the beginning? */ - - /* parse format to get strings */ - - while (*fmt) { - - switch (*fmt) { - - case 'S' : - - s = va_arg (args, ngx_str_t *); - - sp->data = s->data; - sp->len = s->len; - sp->escaped = 0; - - len += sp->len; - break; - - case 's' : - - sp->data = va_arg (args, u_char *); - sp->len = (size_t) ngx_strlen (sp->data); - sp->escaped = 0; - - len += sp->len; - break; - - case 'l' : - - sp->data = va_arg (args, u_char *); - sp->len = (size_t) va_arg (args, int); - sp->escaped = 0; - - len += sp->len; - break; - - case 'L' : - - sp->data = va_arg (args, u_char *); - sp->len = va_arg (args, size_t); - sp->escaped = 0; - - len += sp->len; - break; - - case 'e' : - - p = va_arg (args, u_char *); - - sp->data = p; - - l = 0; - el = 0; - c = *p; - - while (c != '\0') { - - if (c == '\\') { - l += 2; - p += 2; - } else { - l++; - p++; - } - - el++; - c = *p; - } - - sp->len = l; - sp->escaped = 1; - - len += el; - break; - - case 'E' : - - s = va_arg (args, ngx_str_t *); - - sp->data = s->data; - sp->len = s->len; - - p = sp->data; - - el = 0; - e = p + sp->len; - - while (p < e) { - - c = *p; - - if (c == '\\') { - p += 2; - } else { - p++; - } - - el++; - } - - sp->escaped = 1; - - len += el; - break; - - case 'n' : - - sp->data = va_arg (args, u_char *); - sp->len = (size_t) va_arg (args, int); - - p = sp->data; - - el = 0; - e = p + sp->len; - - while (p < e) { - - c = *p; - - if (c == '\\') { - p += 2; - } else { - p++; - } - - el++; - } - - sp->escaped = 1; - - len += el; - break; - - case 'c' : - - *cp = (u_char) va_arg (args, int); - - sp->data = cp; - sp->len = (size_t) 1; - - len++; - cp++; - - break; - - default : - - ndk_log_alert (pool->log, 0, "catstrf () : format [%s] incorrect", fmt); - - return NULL; - - } - - sp++; - fmt++; - } - - - - /* create space for string (assumes no NULL's in strings) */ - - ndk_palloc_rn (p, pool, len + 1); - - dest->data = p; - dest->len = len; - - /* copy other strings */ - - if (len) { - - while (sp2 < sp) { - - if (sp2->escaped) { - - m = sp2->data; - e = m + sp2->len; - - while (m < e) { - - c = *m; - - if (c == '\\') { - - if (m == e - 1) { - *p = '\\'; - p++; - break; - } - - c1 = m[1]; - - switch (c1) { - - case 'n' : - *p = '\n'; - break; - - case 't' : - *p = '\t'; - break; - - case '0' : - *p = '\0'; - break; - - case '\\' : - *p = '\\'; - break; - - case 's' : - *p = ' '; - break; - - case 'b' : - *p = '\b'; - break; - - case 'r' : - *p = '\r'; - break; - - default : - - *p = c1; - break; - } - - m += 2; - - } else { - - *p = c; - m++; - } - - p++; - } - - } else { - - p = ngx_cpymem (p, sp2->data, sp2->len); - } - - sp2++; - } - } - - *p = '\0'; - - return dest->data; -} - - -u_char * -ndk_catstrf (ngx_pool_t *pool, ngx_str_t *dest, const char *fmt, ...) -{ - u_char *p; - va_list args; - - va_start (args, fmt); - p = ndk_vcatstrf (pool, dest, fmt, args); - va_end (args); - - return p; -} - - -ngx_int_t -ndk_cmpstr (ngx_str_t *s1, ngx_str_t *s2) -{ - ngx_int_t rv; - size_t len1, len2; - - len1 = s1->len; - len2 = s2->len; - - if (len1 == len2) { - return ngx_strncmp (s1->data, s2->data, len1); - } - - if (len1 > len2) { - - rv = ngx_strncmp (s1->data, s2->data, len2); - if (rv == 0) - return 1; - - return rv; - } - - rv = ngx_strncmp (s1->data, s2->data, len1); - if (rv == 0) - return -1; - - return rv; -} - - -u_char * -ndk_dupstr (ngx_pool_t *pool, ngx_str_t *dest, ngx_str_t *src) -{ - u_char *d; - size_t n; - - n = src->len; - - ndk_palloc_rn (d, pool, n + 1); - ndk_strncpy (d, src->data, n); - - dest->data = d; - dest->len = n; - - return d; -} - -/* -ngx_keyval_t * -ndk_url_args_to_keyval_list (ngx_pool_t *pool, ngx_str_t *str) -{ - ngx_keyval_t *kv; - ngx_st - -} -*/ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.h deleted file mode 100644 index ecd21c4..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.h +++ /dev/null @@ -1,37 +0,0 @@ - - -#if 1 -/* TODO : set ndk_hex_dump for older versions of Nginx */ -#define ndk_hex_dump ngx_hex_dump -#endif - -typedef struct { - size_t len; - u_char *data; - ngx_flag_t escaped; -} ndk_estr_t; - -int64_t ndk_atoi64 (u_char *line, size_t n); - -ngx_int_t ndk_strcntc (ngx_str_t *s, char c); -ngx_int_t ndk_strccnt (char *s, char c); -ngx_array_t * ndk_str_array_create (ngx_pool_t *pool, char **s, ngx_int_t n); -u_char * ndk_catstrf (ngx_pool_t *pool, ngx_str_t *dest, const char *fmt, ...); -ngx_int_t ndk_cmpstr (ngx_str_t *s1, ngx_str_t *s2); -u_char * ndk_dupstr (ngx_pool_t *pool, ngx_str_t *dest, ngx_str_t *src); - -static ngx_inline void -ndk_strtoupper (u_char *p, size_t len) -{ - u_char *e = p + len; - for ( ; pdata = (u_char*) s; (ns)->len = sizeof (s) - 1;} - -#define ndk_zero(p,sz) memset (p,'\0',sz) -#define ndk_zerop(p) ndk_zero (p,sizeof(*p)) -#define ndk_zeropn(p,n) ndk_zero (p,sizeof(*p)*(n)) -#define ndk_zerov(v) ndk_zero (&v,sizeof(v)) - -#define ngx_null_enum { ngx_null_string, 0 } - -#define ndk_memcpyp(d,s) ngx_memcpy(d,s,sizeof(*s)) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.c deleted file mode 100644 index 3a83a25..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.c +++ /dev/null @@ -1,205 +0,0 @@ - - -/* TODO : generalize this into a generic list module, with weight */ - - -typedef struct { - ngx_uint_t weight; - ngx_str_t s; - ngx_conf_t *cf; -} ndk_upstream_list_parse_t; - - - -static ngx_int_t -ndk_upstream_list_parse_weight (ndk_upstream_list_parse_t *ulp) -{ - size_t i; - ngx_str_t *s; - - s = &ulp->s; - - for (i=0; ilen; i++) { - - if (s->data[i] < '0' || s->data[i] > '9') - break; - } - - if (!i) { - ulp->weight = 1; - return NGX_OK; - } - - if (i == s->len) { - ngx_conf_log_error (NGX_LOG_EMERG, ulp->cf, 0, - "upstream list just consists of number \"%V\"", s); - - return NGX_ERROR; - } - - if (s->data[i] != ':') { - ngx_conf_log_error (NGX_LOG_EMERG, ulp->cf, 0, - "upstream list not correct format \"%V\"", s); - - return NGX_ERROR; - } - - - ulp->weight = ngx_atoi (s->data, i); - - s->data += (i + 1); - s->len -= (i + 1); - - return NGX_OK; -} - - - -static char * -ndk_upstream_list (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - /* TODO : change this for getting upstream pointer if available */ - - ngx_uint_t buckets, count, i, j; - ngx_str_t *value, **bucket, *us; - ngx_array_t *ula; - ndk_upstream_list_t *ul, *ule; - ndk_upstream_list_parse_t ulp; - - ndk_http_main_conf_t *mcf; - - mcf = ngx_http_conf_get_module_main_conf (cf, ndk_http_module); - - ula = mcf->upstreams; - - /* create array of upstream lists it doesn't already exist */ - - if (ula == NULL) { - - ula = ngx_array_create (cf->pool, 4, sizeof (ndk_upstream_list_t)); - if (ula == NULL) - return NGX_CONF_ERROR; - - mcf->upstreams = ula; - } - - - /* check to see if the list already exists */ - - value = cf->args->elts; - value++; - - ul = ula->elts; - ule = ul + ula->nelts; - - for ( ; ulname.len == value->len && - ngx_strncasecmp (ul->name.data, value->data, value->len) == 0) { - - ngx_conf_log_error (NGX_LOG_EMERG, cf, 0, - "duplicate upstream list name \"%V\"", value); - - return NGX_CONF_ERROR; - } - } - - - /* create a new list */ - - ul = ngx_array_push (ula); - if (ul == NULL) - return NGX_CONF_ERROR; - - ul->name = *value; - - - - /* copy all the upstream names */ - - count = cf->args->nelts - 2; - - us = ngx_palloc (cf->pool, count * sizeof (ngx_str_t)); - if (us == NULL) - return NGX_CONF_ERROR; - - ngx_memcpy (us, value + 1, count * sizeof (ngx_str_t)); - - - /* calculate the total number of buckets */ - - buckets = 0; - - ulp.cf = cf; - - for (i=0; ipool, buckets * sizeof (ngx_str_t *)); - if (bucket == NULL) - return NGX_CONF_ERROR; - - ul->elts = bucket; - ul->nelts = buckets; - - - /* set values for each bucket */ - - us -= count; - - for (i=0; idata = ulp.s.data; - us->len = ulp.s.len; - - /* TODO : check format of upstream */ - /* TODO : add automatic adding of http:// in upstreams? */ - - for (j=0; jupstreams; - - if (ua == NULL) { - return NULL; - } - - ul = ua->elts; - ule = ul + ua->nelts; - - for (; ul < ule; ul++) { - if (ul->name.len == len && ngx_strncasecmp(ul->name.data, data, len) == 0) - { - return ul; - } - } - - return NULL; -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.h deleted file mode 100644 index 3786456..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.h +++ /dev/null @@ -1,27 +0,0 @@ - -#if (NDK_UPSTREAM_LIST_CMDS) - -/* TODO : use the generated commands */ - -{ - ngx_string ("upstream_list"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_2MORE, - ndk_upstream_list, - 0, - 0, - NULL -}, - -#else - -typedef struct { - ngx_str_t **elts; - ngx_uint_t nelts; - ngx_str_t name; -} ndk_upstream_list_t; - - -ndk_upstream_list_t * -ndk_get_upstream_list (ndk_http_main_conf_t *mcf, u_char *data, size_t len); - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.c deleted file mode 100644 index 19e90e8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.c +++ /dev/null @@ -1,45 +0,0 @@ - - -/* TODO : check that this is correct */ - -u_char * -ndk_map_uri_to_path_add_suffix (ngx_http_request_t *r, ngx_str_t *path, ngx_str_t *suffix, ngx_int_t dot) -{ - size_t root_size; - u_char *p; - - if (suffix->len) { - - if (dot) { - - p = ngx_http_map_uri_to_path (r, path, &root_size, suffix->len + 1); - - if (p == NULL) - return NULL; - - *p = '.'; - p++; - - } else { - - p = ngx_http_map_uri_to_path (r, path, &root_size, suffix->len); - - if (p == NULL) - return NULL; - } - - path->len--; - - p = ngx_cpymem (p, suffix->data, suffix->len); - *p = '\0'; - - return p; - } - - p = ngx_http_map_uri_to_path (r, path, &root_size, 0); - - path->len--; - - return p; -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.h deleted file mode 100644 index dac3880..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.h +++ /dev/null @@ -1,6 +0,0 @@ - - - -u_char * ndk_map_uri_to_path_add_suffix (ngx_http_request_t *r, ngx_str_t *path, ngx_str_t *suffix, ngx_int_t dot); - - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/.gitattributes b/modules_deb/libnginx-mod-http-set-misc-0.33/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/.gitignore b/modules_deb/libnginx-mod-http-set-misc-0.33/.gitignore deleted file mode 100644 index 7500112..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -reindex -.libs -*.swp -*.slo -*.la -*.swo -*.lo -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[789] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -all -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -genmobi.sh -*.mobi -misc/chunked -ctags -src/base32.h -src/uri.c -src/module.c -src/upstream.c -src/upstream.h -src/uri.c -src/sql.c -src/uri.h -src/sql.h -src/uri.h -src/value.c -src/base32.c -src/value.h -src/hash.h -src/hash.c -src/today.h -src/today.c -src/json.[ch] -all.sh -go -t/servroot/ -src/base64.c -src/base64.h -src/hex.c -src/hex.h -src/hmac.c -src/hmac.h -src/rotate.[ch] -analyze -buildroot/ -src/module.h -work/ -src/random.[ch] -build1[0-9] -nginx -analyze -src/rotate.[ch] -*.plist -Makefile -src/base64url.[ch] -src/expired.[ch] diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/.travis.yml b/modules_deb/libnginx-mod-http-set-misc-0.33/.travis.yml deleted file mode 100644 index a841a11..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -sudo: required -dist: trusty - -branches: - only: - - "master" - -os: linux - -language: c -compiler: gcc - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LUA_INCLUDE_DIR=$LUAJIT_INC - - LUA_CMODULE_DIR=/lib - - JOBS=3 - - NGX_BUILD_JOBS=$JOBS - - TEST_NGINX_SLEEP=0.006 - matrix: - - NGINX_VERSION=1.19.9 - -before_install: - - sudo apt-get install -qq -y axel cpanminus libtest-base-perl libtext-diff-perl liburi-perl libwww-perl libtest-longstring-perl liblist-moreutils-perl > build.log 2>&1 || (cat build.log && exit 1) - -install: - - git clone https://github.com/openresty/nginx-devel-utils.git - - git clone https://github.com/openresty/openresty.git ../openresty - - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module - - git clone https://github.com/openresty/test-nginx.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - - git clone https://github.com/calio/iconv-nginx-module.git ../iconv-nginx-module - -script: - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH - - ngx-releng > check.txt || true - - lines=`wc -l check.txt | awk '{print $1}'`; if [ $lines -gt 3 ]; then cat check.txt; exit 1; fi - - cd luajit2 - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd ../test-nginx && sudo cpanm . && cd .. - - export NGX_BUILD_CC=$CC - - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - - nginx -V - - prove -r t diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/README.markdown b/modules_deb/libnginx-mod-http-set-misc-0.33/README.markdown deleted file mode 100644 index f7f4010..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/README.markdown +++ /dev/null @@ -1,1451 +0,0 @@ - - -Name -==== - -**ngx_set_misc** - Various set_xxx directives added to nginx's rewrite module (md5/sha1, sql/json quoting, and many more) - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Name](#name) -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) -* [Directives](#directives) - * [set_if_empty](#set_if_empty) - * [set_quote_sql_str](#set_quote_sql_str) - * [set_quote_pgsql_str](#set_quote_pgsql_str) - * [set_quote_json_str](#set_quote_json_str) - * [set_unescape_uri](#set_unescape_uri) - * [set_escape_uri](#set_escape_uri) - * [set_hashed_upstream](#set_hashed_upstream) - * [set_encode_base32](#set_encode_base32) - * [set_base32_padding](#set_base32_padding) - * [set_misc_base32_padding](#set_misc_base32_padding) - * [set_base32_alphabet](#set_base32_alphabet) - * [set_decode_base32](#set_decode_base32) - * [set_encode_base64](#set_encode_base64) - * [set_decode_base64](#set_decode_base64) - * [set_encode_base64url](#set_encode_base64url) - * [set_decode_base64url](#set_decode_base64url) - * [set_encode_hex](#set_encode_hex) - * [set_decode_hex](#set_decode_hex) - * [set_sha1](#set_sha1) - * [set_md5](#set_md5) - * [set_hmac_sha1](#set_hmac_sha1) - * [set_hmac_sha256](#set_hmac_sha256) - * [set_random](#set_random) - * [set_secure_random_alphanum](#set_secure_random_alphanum) - * [set_secure_random_lcalpha](#set_secure_random_lcalpha) - * [set_rotate](#set_rotate) - * [set_local_today](#set_local_today) - * [set_formatted_gmt_time](#set_formatted_gmt_time) - * [set_formatted_local_time](#set_formatted_local_time) -* [Caveats](#caveats) -* [Installation](#installation) - * [Building as a dynamic module](#building-as-a-dynamic-module) -* [Compatibility](#compatibility) -* [Report Bugs](#report-bugs) -* [Source Repository](#source-repository) -* [Changes](#changes) -* [Test Suite](#test-suite) -* [Getting involved](#getting-involved) -* [Author](#author) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Version -======= - -This document describes ngx_set_misc [v0.32](https://github.com/openresty/set-misc-nginx-module/tags) released on 19 April 2018. - -Synopsis -======== - -```nginx - - location /foo { - set $a $arg_a; - set_if_empty $a 56; - - # GET /foo?a=32 will yield $a == 32 - # while GET /foo and GET /foo?a= will - # yeild $a == 56 here. - } - - location /bar { - set $foo "hello\n\n'\"\\"; - set_quote_sql_str $foo $foo; # for mysql - - # OR in-place editing: - # set_quote_sql_str $foo; - - # now $foo is: 'hello\n\n\'\"\\' - } - - location /bar { - set $foo "hello\n\n'\"\\"; - set_quote_pgsql_str $foo; # for PostgreSQL - - # now $foo is: E'hello\n\n\'\"\\' - } - - location /json { - set $foo "hello\n\n'\"\\"; - set_quote_json_str $foo $foo; - - # OR in-place editing: - # set_quote_json_str $foo; - - # now $foo is: "hello\n\n'\"\\" - } - - location /baz { - set $foo "hello%20world"; - set_unescape_uri $foo $foo; - - # OR in-place editing: - # set_unescape_uri $foo; - - # now $foo is: hello world - } - - upstream_list universe moon sun earth; - upstream moon { ... } - upstream sun { ... } - upstream earth { ... } - location /foo { - set_hashed_upstream $backend universe $arg_id; - drizzle_pass $backend; # used with ngx_drizzle - } - - location /base32 { - set $a 'abcde'; - set_encode_base32 $a; - set_decode_base32 $b $a; - - # now $a == 'c5h66p35' and - # $b == 'abcde' - } - - location /base64 { - set $a 'abcde'; - set_encode_base64 $a; - set_decode_base64 $b $a; - - # now $a == 'YWJjZGU=' and - # $b == 'abcde' - } - - location /hex { - set $a 'abcde'; - set_encode_hex $a; - set_decode_hex $b $a; - - # now $a == '6162636465' and - # $b == 'abcde' - } - - # GET /sha1 yields the output - # aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d - location /sha1 { - set_sha1 $a hello; - echo $a; - } - - # ditto - location /sha1 { - set $a hello; - set_sha1 $a; - echo $a; - } - - # GET /today yields the date of today in local time using format 'yyyy-mm-dd' - location /today { - set_local_today $today; - echo $today; - } - - # GET /signature yields the hmac-sha-1 signature - # given a secret and a string to sign - # this example yields the base64 encoded singature which is - # "HkADYytcoQQzqbjQX33k/ZBB/DQ=" - location /signature { - set $secret_key 'secret-key'; - set $string_to_sign "some-string-to-sign"; - set_hmac_sha1 $signature $secret_key $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } - - location = /rand { - set $from 3; - set $to 15; - set_random $rand $from $to; - - # or write directly - # set_random $rand 3 15; - - echo $rand; # will print a random integer in the range [3, 15] - } -``` - -Description -=========== - -This module extends the standard HttpRewriteModule's directive set to provide more functionalities like URI escaping and unescaping, JSON quoting, Hexadecimal/MD5/SHA1/Base32/Base64 digest encoding and decoding, random number generator, and more! - -Every directive provided by this module can be mixed freely with other [ngx_http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)'s directives, like [if](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if) and [set](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#set). (Thanks to the [Nginx Devel Kit](https://github.com/simpl/ngx_devel_kit)!) - -[Back to TOC](#table-of-contents) - -Directives -========== - -[Back to TOC](#table-of-contents) - -set_if_empty ------------- -**syntax:** *set_if_empty $dst <src>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Assign the value of the argument `` if and only if variable `$dst` is empty (i.e., not found or has an empty string value). - -In the following example, - -```nginx - - set $a 32; - set_if_empty $a 56; -``` - -the variable `$dst` will take the value 32 at last. But in the sample - -```nginx - - set $a ''; - set $value "hello, world" - set_if_empty $a $value; -``` - -`$a` will take the value `"hello, world"` at last. - -[Back to TOC](#table-of-contents) - -set_quote_sql_str ------------------ -**syntax:** *set_quote_sql_str $dst <src>* - -**syntax:** *set_quote_sql_str $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will quote the value of the second argument `` by MySQL's string value quoting rule and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $value "hello\n\r'\"\\"; - set_quote_sql_str $quoted $value; - - echo $quoted; - } -``` - -Then request `GET /test` will yield the following output - -```sql - - 'hello\n\r\'\"\\' -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "hello\n\r'\"\\"; - set_quote_sql_str $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive is usually used to prevent SQL injection. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_quote_pgsql_str -------------------- -**syntax:** *set_quote_pgsql_str $dst <src>* - -**syntax:** *set_quote_pgsql_str $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Very much like [set_quote_sql_str](#set_quote_sql_str), but with PostgreSQL quoting rules for SQL string literals. - -[Back to TOC](#table-of-contents) - -set_quote_json_str ------------------- -**syntax:** *set_quote_json_str $dst <src>* - -**syntax:** *set_quote_json_str $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will quote the value of the second argument `` by JSON string value quoting rule and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $value "hello\n\r'\"\\"; - set_quote_json_str $quoted $value; - - echo $quoted; - } -``` - -Then request `GET /test` will yield the following output - -```javascript - - "hello\n\r'\"\\" -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "hello\n\r'\"\\"; - set_quote_json_str $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_unescape_uri ----------------- -**syntax:** *set_unescape_uri $dst <src>* - -**syntax:** *set_unescape_uri $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will unescape the value of the second argument `` as a URI component and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set_unescape_uri $key $arg_key; - echo $key; - } -``` - -Then request `GET /test?key=hello+world%21` will yield the following output - -``` -hello world! -``` - -The nginx standard [$arg_PARAMETER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_) variable holds the raw (escaped) value of the URI parameter. So we need the `set_unescape_uri` directive to unescape it first. - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $key $arg_key; - set_unescape_uri $key; - - echo $key; - } -``` - -then request `GET /test?key=hello+world%21` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_escape_uri --------------- -**syntax:** *set_escape_uri $dst <src>* - -**syntax:** *set_escape_uri $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Very much like the [set_unescape_uri](#set_unescape_uri) directive, but does the conversion the other way around, i.e., URL component escaping. - -[Back to TOC](#table-of-contents) - -set_hashed_upstream -------------------- -**syntax:** *set_hashed_upstream $dst <upstream_list_name> <src>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Hashes the string argument `` into one of the upstream name included in the upstream list named ``. The hash function being used is simple modulo. - -Here's an example, - -```nginx - - upstream moon { ... } - upstream sun { ... } - upstream earth { ... } - - upstream_list universe moon sun earth; - - location /test { - set_unescape_uri $key $arg_key; - set $list_name universe; - set_hashed_upstream $backend $list_name $key; - - echo $backend; - } -``` - -Then `GET /test?key=blah` will output either "moon", "sun", or "earth", depending on the actual value of the `key` query argument. - -This directive is usually used to compute an nginx variable to be passed to [memc-nginx-module](http://github.com/openresty/memc-nginx-module)'s [memc_pass](http://github.com/openresty/memc-nginx-module#memc_pass) directive, [redis2-nginx-module](http://github.com/openresty/redis2-nginx-module)'s [[HttpRedis2Module#redis2_pass]] directive, and [ngx_http_proxy_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html)'s [proxy_pass](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass) directive, among others. - -[Back to TOC](#table-of-contents) - -set_encode_base32 ------------------ -**syntax:** *set_encode_base32 $dst <src>* - -**syntax:** *set_encode_base32 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its base32(hex) digest and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $raw "abcde"; - set_encode_base32 $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -c5h66p35 -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -RFC forces the `[A-Z2-7]` RFC-3548 compliant encoding, but we are using the "base32hex" encoding (`[0-9a-v]`) by default. The [set_base32_alphabet](#set_base32_alphabet) directive (first introduced in `v0.28`) allows you to change the alphabet used for encoding/decoding so RFC-3548 compliant encoding is still possible by custom configurations. - -By default, the `=` character is used to pad the left-over bytes due to alignment. But the padding behavior can be completely disabled by setting [set_base32_padding](#set_base32_padding) `off`. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "abcde"; - set_encode_base32 $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_base32_padding ------------------- -**syntax:** *set_base32_padding on|off* - -**default:** *on* - -**context:** *http, server, server if, location, location if* - -**phase:** *no* - -This directive can control whether to pad left-over bytes with the "=" character when encoding a base32 digest by the -[set_encode_base32](#set_encode_base32) directive. - -This directive was first introduced in `v0.28`. If you use earlier versions of this module, then you should use [set_misc_base32_padding](#set_misc_base32_padding) instead. - -[Back to TOC](#table-of-contents) - -set_misc_base32_padding ------------------------ -**syntax:** *set_misc_base32_padding on|off* - -**default:** *on* - -**context:** *http, server, server if, location, location if* - -**phase:** *no* - -This directive has been deprecated since `v0.28`. Use [set_base32_padding](#set_base32_padding) instead if you are using `v0.28+`. - -[Back to TOC](#table-of-contents) - -set_base32_alphabet -------------------- -**syntax:** *set_base32_alphabet <alphabet>* - -**default:** *"0123456789abcdefghijklmnopqrstuv"* - -**context:** *http, server, server if, location, location if* - -**phase:** *no* - -This directive controls the alphabet used for encoding/decoding a base32 digest. It accepts a string containing the desired alphabet like "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" for standard alphabet. - -Extended (base32hex) alphabet is used by default. - -This directive was first introduced in `v0.28`. - -[Back to TOC](#table-of-contents) - -set_decode_base32 ------------------ -**syntax:** *set_decode_base32 $dst <src>* - -**syntax:** *set_decode_base32 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Similar to the [set_encode_base32](#set_encode_base32) directive, but does exactly the opposite operation, .i.e, decoding a base32(hex) digest into its original form. - -[Back to TOC](#table-of-contents) - -set_encode_base64 ------------------ -**syntax:** *set_encode_base64 $dst <src>* - -**syntax:** *set_encode_base64 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its base64 digest and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $raw "abcde"; - set_encode_base64 $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -YWJjZGU= -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "abcde"; - set_encode_base64 $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_encode_base64url ------------------ -**syntax:** *set_encode_base64url $dst <src>* - -**syntax:** *set_encode_base64url $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its base64 url safe digest and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $raw "abcde"; - set_encode_base64url $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -YWJjZGU= -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "abcde"; - set_encode_base64url $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_decode_base64 ------------------ -**syntax:** *set_decode_base64 $dst <src>* - -**syntax:** *set_decode_base64 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Similar to the [set_encode_base64](#set_encode_base64) directive, but does exactly the opposite operation, .i.e, decoding a base64 digest into its original form. - -[Back to TOC](#table-of-contents) - -set_decode_base64url ------------------ -**syntax:** *set_decode_base64url $dst <src>* - -**syntax:** *set_decode_base64url $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Similar to the [set_encode_base64url](#set_encode_base64url) directive, but does exactly the the opposite operation, .i.e, decoding a base64 url safe digest into its original form. - -[Back to TOC](#table-of-contents) - -set_encode_hex --------------- -**syntax:** *set_encode_hex $dst <src>* - -**syntax:** *set_encode_hex $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its hexadecimal digest and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $raw "章亦春"; - set_encode_hex $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -e7aba0e4baa6e698a5 -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "章亦春"; - set_encode_hex $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_decode_hex --------------- -**syntax:** *set_decode_hex $dst <src>* - -**syntax:** *set_decode_hex $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Similar to the [set_encode_hex](#set_encode_hex) directive, but does exactly the opposite operation, .i.e, decoding a hexadecimal digest into its original form. - -[Back to TOC](#table-of-contents) - -set_sha1 --------- -**syntax:** *set_sha1 $dst <src>* - -**syntax:** *set_sha1 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its [SHA-1](http://en.wikipedia.org/wiki/SHA-1) digest and assign the result into the first argument, variable `$dst`. The hexadecimal form of the `SHA-1` digest will be generated automatically, use [set_decode_hex](#set_decode_hex) to decode the result if you want the binary form of the `SHA-1` digest. - -For example, - -```nginx - - location /test { - set $raw "hello"; - set_sha1 $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "hello"; - set_sha1 $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_md5 -------- -**syntax:** *set_md5 $dst <src>* - -**syntax:** *set_md5 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its [MD5](http://en.wikipedia.org/wiki/MD5) digest and assign the result into the first argument, variable `$dst`. The hexadecimal form of the `MD5` digest will be generated automatically, use [set_decode_hex](#set_decode_hex) to decode the result if you want the binary form of the `MD5` digest. - -For example, - -```nginx - - location /test { - set $raw "hello"; - set_md5 $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - - - 5d41402abc4b2a76b9719d911017c592 - - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "hello"; - set_md5 $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_hmac_sha1 -------------- -**syntax:** *set_hmac_sha1 $dst <secret_key> <src>* - -**syntax:** *set_hmac_sha1 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Computes the [HMAC-SHA1](http://en.wikipedia.org/wiki/HMAC) digest of the argument `` and assigns the result into the argument variable `$dst` with the secret key ``. - -The raw binary form of the `HMAC-SHA1` digest will be generated, use [set_encode_base64](#set_encode_base64), for example, to encode the result to a textual representation if desired. - -For example, - -```nginx - - location /test { - set $secret 'thisisverysecretstuff'; - set $string_to_sign 'some string we want to sign'; - set_hmac_sha1 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } -``` - -Then request `GET /test` will yield the following output - -``` -R/pvxzHC4NLtj7S+kXFg/NePTmk= -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -This directive requires the OpenSSL library enabled in your Nginx build (usually by passing the `--with-http_ssl_module` option to the `./configure` script). - -[Back to TOC](#table-of-contents) - -set_hmac_sha256 ---------------- -**syntax:** *set_hmac_sha256 $dst <secret_key> <src>* - -**syntax:** *set_hmac_sha256 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Computes the [HMAC-SHA256](http://en.wikipedia.org/wiki/HMAC) digest of the argument `` and assigns the result into the argument variable `$dst` with the secret key ``. - -The raw binary form of the `HMAC-SHA256` digest will be generated, use [set_encode_base64](#set_encode_base64), for example, to encode the result to a textual representation if desired. - -For example, - -```nginx - - location /test { - set $secret 'thisisverysecretstuff'; - set $string_to_sign 'some string we want to sign'; - set_hmac_sha256 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } -``` - -Then request `GET /test` will yield the following output - -``` -4pU3GRQrKKIoeLb9CqYsavHE2l6Hx+KMmRmesU+Cfrs= -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -This directive requires the OpenSSL library enabled in your Nginx build (usually by passing the `--with-http_ssl_module` option to the `./configure` script). - -[Back to TOC](#table-of-contents) - -set_random ----------- -**syntax:** *set_random $res <from> <to>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Generates a (pseudo) random number (in textual form) within the range `[<$from>, <$to>]` (inclusive). - -Only non-negative numbers are allowed for the `` and `` arguments. - -When `` is greater than ``, their values will be exchanged accordingly. - -For instance, - -```nginx - - location /test { - set $from 5; - set $to 7; - set_random $res $from $to; - - echo $res; - } -``` - -then request `GET /test` will output a number between 5 and 7 (i.e., among 5, 6, 7). - -For now, there's no way to configure a custom random generator seed. - -Behind the scene, it makes use of the standard C function `rand()`. - -This directive was first introduced in the `v0.22rc1` release. - -See also [set_secure_random_alphanum](#set_secure_random_alphanum) and [set_secure_random_lcalpha](#set_secure_random_lcalpha). - -[Back to TOC](#table-of-contents) - -set_secure_random_alphanum --------------------------- -**syntax:** *set_secure_random_alphanum $res <length>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Generates a cryptographically-strong random string `` characters long with the alphabet `[a-zA-Z0-9]`. - -`` may be between 1 and 64, inclusive. - -For instance, - -```nginx - - location /test { - set_secure_random_alphanum $res 32; - - echo $res; - } -``` - -then request `GET /test` will output a string like `ivVVRP2DGaAqDmdf3Rv4ZDJ7k0gOfASz`. - -This functionality depends on the presence of the `/dev/urandom` device, available on most UNIX-like systems. - -See also [set_secure_random_lcalpha](#set_secure_random_lcalpha) and [set_random](#set_random). - -This directive was first introduced in the `v0.22rc8` release. - -[Back to TOC](#table-of-contents) - -set_secure_random_lcalpha -------------------------- -**syntax:** *set_secure_random_lcalpha $res <length>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Generates a cryptographically-strong random string `` characters long with the alphabet `[a-z]`. - -`` may be between 1 and 64, inclusive. - -For instance, - -```nginx - - location /test { - set_secure_random_lcalpha $res 32; - - echo $res; - } -``` - -then request `GET /test` will output a string like `kcuxcddktffsippuekhshdaclaquiusj`. - -This functionality depends on the presence of the `/dev/urandom` device, available on most UNIX-like systems. - -This directive was first introduced in the `v0.22rc8` release. - -See also [set_secure_random_alphanum](#set_secure_random_alphanum) and [set_random](#set_random). - -[Back to TOC](#table-of-contents) - -set_rotate ----------- -**syntax:** *set_rotate $value <from> <to>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Increments `$value` but keeps it in range from `` to ``. -If `$value` is greater than `` or less than `` is will be -set to `` value. - -The current value after running this directive will always be saved on a per-location basis. And the this saved value will be used for incrementation when the `$value` is not initialized or has a bad value. - -Only non-negative numbers are allowed for the `` and `` arguments. - -When `` is greater than ``, their values will be exchanged accordingly. - -For instance, - -```nginx - - location /rotate { - default_type text/plain; - set $counter $cookie_counter; - set_rotate $counter 1 5; - echo $counter; - add_header Set-Cookie counter=$counter; - } -``` - -then request `GET /rotate` will output next number between 1 and 5 (i.e., 1, 2, 3, 4, 5) on each -refresh of the page. This directive may be userful for banner rotation purposes. - -Another example is to use server-side value persistence to do simple round-robin: - -```nginx - - location /rotate { - default_type text/plain; - set_rotate $counter 0 3; - echo $counter; - } -``` - -And accessing `/rotate` will also output integer sequence 0, 1, 2, 3, 0, 1, 2, 3, and so on. - -This directive was first introduced in the `v0.22rc7` release. - -[Back to TOC](#table-of-contents) - -set_local_today ---------------- -**syntax:** *set_local_today $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Set today's date ("yyyy-mm-dd") in localtime to the argument variable `$dst`. - -Here's an example, - -```nginx - - location /today { - set_local_today $today; - echo $today; - } -``` - -then request `GET /today` will output something like - -``` -2011-08-16 -``` - -and year, the actual date you get here will vary every day ;) - -Behind the scene, this directive utilizes the `ngx_time` API in the Nginx core, so usually no syscall is involved due to the time caching mechanism in the Nginx core. - -[Back to TOC](#table-of-contents) - -set_formatted_gmt_time ----------------------- -**syntax:** *set_formatted_gmt_time $res <time-format>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Set a formatted GMT time to variable `$res` (as the first argument) using the format string in the second argument. - -All the conversion specification notations in the standard C function `strftime` are supported, like `%Y` (for 4-digit years) and `%M` (for minutes in decimal). See for a complete list of conversion specification symbols. - -Below is an example: - -```nginx - - location = /t { - set_formatted_gmt_time $timestr "%a %b %e %H:%M:%S %Y GMT"; - echo $timestr; - } -``` - -Accessing `/t` yields the output - -``` -Fri Dec 13 15:34:37 2013 GMT -``` - -This directive was first added in the `0.23` release. - -See also [set_formatted_local_time](#set_formatted_local_time). - -[Back to TOC](#table-of-contents) - -set_formatted_local_time ------------------------- -**syntax:** *set_formatted_local_time $res <time-format>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Set a formatted local time to variable `$res` (as the first argument) using the format string in the second argument. - -All the conversion specification notations in the standard C function `strftime` are supported, like `%Y` (for 4-digit years) and `%M` (for minutes in decimal). See for a complete list of conversion specification symbols. - -Below is an example: - -```nginx - - location = /t { - set_formatted_local_time $timestr "%a %b %e %H:%M:%S %Y %Z"; - echo $timestr; - } -``` - -Accessing `/t` yields the output - -``` -Fri Dec 13 15:42:15 2013 PST -``` - -This directive was first added in the `0.23` release. - -See also [set_formatted_gmt_time](#set_formatted_gmt_time). - -[Back to TOC](#table-of-contents) - -Caveats -======= - -Do not use [$arg_PARAMETER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_), [$cookie_COOKIE](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_cookie_), [$http_HEADER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_) or other special variables defined in the Nginx core module as the target variable in this module's directives. For instance, - -```nginx - - set_if_empty $arg_user 'foo'; # DO NOT USE THIS! -``` - -may lead to segmentation faults. - -[Back to TOC](#table-of-contents) - -Installation -============ - -This module is included and enabled by default in the [OpenResty bundle](http://openresty.org). If you want to install this module manually with your own Nginx source tarball, then follow the steps below: - -Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.13.6 (see [nginx compatibility](#compatibility)), and then build the source with this module: - -```bash - - wget 'http://nginx.org/download/nginx-1.13.6.tar.gz' - tar -xzvf nginx-1.13.6.tar.gz - cd nginx-1.13.6/ - - # Here we assume you would install you nginx under /opt/nginx/. - ./configure --prefix=/opt/nginx \ - --with-http_ssl_module \ - --add-module=/path/to/ngx_devel_kit \ - --add-module=/path/to/set-misc-nginx-module - - make -j2 - make install -``` - -Download the latest version of the release tarball of this module from [set-misc-nginx-module file list](http://github.com/openresty/set-misc-nginx-module/tags), and the latest tarball for [ngx_devel_kit](https://github.com/simplresty/ngx_devel_kit) from its [file list](https://github.com/simplresty/ngx_devel_kit/tags). - -[Back to TOC](#table-of-contents) - -Building as a dynamic module ----------------------------- - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ndk_http_module.so; # assuming NDK is built as a dynamic module too -load_module /path/to/modules/ngx_http_set_misc_module.so; -``` - -Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org/). - -[Back to TOC](#table-of-contents) - -Compatibility -============= - -The following versions of Nginx should work with this module: - -* **1.13.x** (last tested: 1.13.6) -* **1.12.x** -* **1.11.x** (last tested: 1.11.2) -* **1.10.x** -* **1.9.x** (last tested: 1.9.15) -* **1.8.x** -* **1.7.x** (last tested: 1.7.10) -* **1.6.x** -* **1.5.x** (last tested: 1.5.8) -* **1.4.x** (last tested: 1.4.4) -* **1.2.x** (last tested: 1.2.9) -* **1.1.x** (last tested: 1.1.5) -* **1.0.x** (last tested: 1.0.15) -* **0.9.x** (last tested: 0.9.4) -* **0.8.x** (last tested: 0.8.54) -* **0.7.x >= 0.7.46** (last tested: 0.7.68) - -If you find that any particular version of Nginx above 0.7.46 does not work with this module, please consider [reporting a bug](#report-bugs). - -[Back to TOC](#table-of-contents) - -Report Bugs -=========== - -Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to - -1. send a bug report or even patches to the [openresty-en mailing list](https://groups.google.com/group/openresty-en), -1. or create a ticket on the [issue tracking interface](http://github.com/openresty/set-misc-nginx-module/issues) provided by GitHub. - -[Back to TOC](#table-of-contents) - -Source Repository -================= - -Available on github at [openresty/set-misc-nginx-module](http://github.com/openresty/set-misc-nginx-module). - -[Back to TOC](#table-of-contents) - -Changes -======= - -The change logs for every release of this module can be obtained from the OpenResty bundle's change logs: - - - -[Back to TOC](#table-of-contents) - -Test Suite -========== - -This module comes with a Perl-driven test suite. The [test cases](http://github.com/openresty/set-misc-nginx-module/tree/master/t/) are -[declarative](http://github.com/openresty/set-misc-nginx-module/blob/master/t/escape-uri.t) too. Thanks to the [Test::Nginx](http://search.cpan.org/perldoc?Test::Nginx) module in the Perl world. - -To run it on your side: - -```bash - - $ PATH=/path/to/your/nginx-with-set-misc-module:$PATH prove -r t -``` - -You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary. - -Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility. - -[Back to TOC](#table-of-contents) - -Getting involved -================ - -You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub. - -[Back to TOC](#table-of-contents) - -Author -====== - -Yichun Zhang (agentzh) *<agentzh@gmail.com>*, OpenResty Inc. - -This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well. - -[Back to TOC](#table-of-contents) - -Copyright & License -=================== - -Copyright (C) 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. - -This module is licensed under the terms of the BSD license. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[Back to TOC](#table-of-contents) - -See Also -======== -* [Nginx Devel Kit](https://github.com/simpl/ngx_devel_kit) -* [The OpenResty bundle](http://openresty.org) - -[Back to TOC](#table-of-contents) - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/config b/modules_deb/libnginx-mod-http-set-misc-0.33/config deleted file mode 100755 index 7bb00af..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/config +++ /dev/null @@ -1,79 +0,0 @@ -ngx_addon_name=ngx_http_set_misc_module - -if test -n "$ngx_module_link"; then - if test -n "$NDK_SRCS"; then - echo "found ngx_devel_kit for ngx_set_misc; looks good." - else - echo "error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc." 1>&2 - exit 1 - fi -else - if echo $HTTP_MODULES | grep " ndk_http_module" > /dev/null; then - echo "found ngx_devel_kit for ngx_set_misc; looks good." - else - echo "error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc." 1>&2 - exit 1 - fi -fi - -SET_MISC_SRCS=" \ - $ngx_addon_dir/src/ngx_http_set_base32.c \ - $ngx_addon_dir/src/ngx_http_set_default_value.c \ - $ngx_addon_dir/src/ngx_http_set_hashed_upstream.c \ - $ngx_addon_dir/src/ngx_http_set_quote_sql.c \ - $ngx_addon_dir/src/ngx_http_set_quote_json.c \ - $ngx_addon_dir/src/ngx_http_set_unescape_uri.c \ - $ngx_addon_dir/src/ngx_http_set_misc_module.c \ - $ngx_addon_dir/src/ngx_http_set_escape_uri.c \ - $ngx_addon_dir/src/ngx_http_set_hash.c \ - $ngx_addon_dir/src/ngx_http_set_local_today.c \ - $ngx_addon_dir/src/ngx_http_set_hex.c \ - $ngx_addon_dir/src/ngx_http_set_base64.c \ - $ngx_addon_dir/src/ngx_http_set_base64url.c \ - $ngx_addon_dir/src/ngx_http_set_random.c \ - $ngx_addon_dir/src/ngx_http_set_secure_random.c \ - $ngx_addon_dir/src/ngx_http_set_rotate.c - " - -SET_MISC_DEPS=" \ - $ngx_addon_dir/src/ddebug.h \ - $ngx_addon_dir/src/ngx_http_set_default_value.h \ - $ngx_addon_dir/src/ngx_http_set_hashed_upstream.h \ - $ngx_addon_dir/src/ngx_http_set_quote_sql.h \ - $ngx_addon_dir/src/ngx_http_set_quote_json.h \ - $ngx_addon_dir/src/ngx_http_set_unescape_uri.h \ - $ngx_addon_dir/src/ngx_http_set_escape_uri.h \ - $ngx_addon_dir/src/ngx_http_set_hash.h \ - $ngx_addon_dir/src/ngx_http_set_local_today.h \ - $ngx_addon_dir/src/ngx_http_set_hex.h \ - $ngx_addon_dir/src/ngx_http_set_base64url.h \ - $ngx_addon_dir/src/ngx_http_set_base64.h \ - $ngx_addon_dir/src/ngx_http_set_random.h \ - $ngx_addon_dir/src/ngx_http_set_rotate.h \ - $ngx_addon_dir/src/ngx_http_set_secure_random.h \ - $ngx_addon_dir/src/ngx_http_set_misc_module.h \ - " - -if [ $USE_OPENSSL = YES -o $MAIL_SSL = YES ]; then - SET_MISC_DEPS="$SET_MISC_DEPS $ngx_addon_dir/src/ngx_http_set_hmac.h" - SET_MISC_SRCS="$SET_MISC_SRCS $ngx_addon_dir/src/ngx_http_set_hmac.c" -fi - -CFLAGS="$CFLAGS -DNDK_SET_VAR -DNDK_UPSTREAM_LIST" -USE_SHA1=YES -USE_MD5=YES - -if test -n "$ngx_module_link"; then - ngx_module_type=HTTP - ngx_module_name=$ngx_addon_name - ngx_module_incs= - ngx_module_deps="$SET_MISC_DEPS" - ngx_module_srcs="$SET_MISC_SRCS" - ngx_module_libs= - - . auto/module -else - HTTP_MODULES="$HTTP_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $SET_MISC_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_DEPS $SET_MISC_DEPS" -fi diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/changelog b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/changelog deleted file mode 100644 index bb494f4..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/changelog +++ /dev/null @@ -1,53 +0,0 @@ -libnginx-mod-http-set-misc (0.33-6) unstable; urgency=medium - - * Team upload. - * d/control: bump Standards-Version: 4.7.2, no changes - * d/watch: use more generic template - * d/copyright: bump debian/* copyright year - - -- Jan Mojžíš Sat, 12 Apr 2025 09:05:50 +0200 - -libnginx-mod-http-set-misc (0.33-5) unstable; urgency=medium - - * Team upload. - * Better usage of dh-sequence-nginx. - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - * d/rules: remove override_dh_auto_test, override_dh_auto_test - * d/control: remove Depends libnginx-mod-http-ndk - * d/copyright-scan-patterns.yml add - - -- Jan Mojžíš Sun, 08 Oct 2023 17:10:26 +0200 - -libnginx-mod-http-set-misc (0.33-4) unstable; urgency=medium - - * Team upload. - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Wed, 28 Jun 2023 00:01:59 +0200 - -libnginx-mod-http-set-misc (0.33-3) unstable; urgency=medium - - * Team upload. - * d/t/set_if_empty renamed to d/t/setifempty, fixes lintian - warning illegal-runtime-test-name - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * d/fix.scanned.copyright: added, fixes upstream author name parsing - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:37 +0100 - -libnginx-mod-http-set-misc (0.33-2) unstable; urgency=medium - - * Team upload. - * d/control: fixed dependency libnginx-mod-http-ndk-dev (>= 1:0.3.2-2) - - -- Jan Mojžíš Fri, 09 Dec 2022 14:08:01 +0100 - -libnginx-mod-http-set-misc (0.33-1) unstable; urgency=medium - - * Initial release. (Closes: #1025291) - - -- Jérémy Lal Fri, 02 Dec 2022 00:32:56 +0100 diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/control b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/control deleted file mode 100644 index 9223829..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/control +++ /dev/null @@ -1,27 +0,0 @@ -Source: libnginx-mod-http-set-misc -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jérémy Lal , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, - libnginx-mod-http-ndk-dev (>= 1:0.3.2-2), -Standards-Version: 4.7.2 -Homepage: https://github.com/openresty/set-misc-nginx-module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-set-misc.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-set-misc -Rules-Requires-Root: no - -Package: libnginx-mod-http-set-misc -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Extended rewrite directives module for Nginx - This module provides more directives that can be used in - the Nginx rewrite phase, like the 'set' directive. - - URI escaping and unescaping - - JSON quoting - - digests encoding and decoding - - random number generator diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright deleted file mode 100644 index f77abc0..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright +++ /dev/null @@ -1,49 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: memc-nginx-module -Upstream-Contact: Yichun "agentzh" Zhang (章亦春) -Source: https://github.com/openresty/set-misc-nginx-module - -Files: * -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: config -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Jérémy Lal , - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: src/* -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: t/* -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: util/* -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright-scan-patterns.yml b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright-scan-patterns.yml deleted file mode 100644 index e195ac6..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright-scan-patterns.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -ignore: - pattern: - - debian/output diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/fix.scanned.copyright b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/fix.scanned.copyright deleted file mode 100644 index b25e244..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/fix.scanned.copyright +++ /dev/null @@ -1,2 +0,0 @@ -# fixes upstream author name parsing -! copyright Files:~/.*/ Copyright=~"s/(Zhang)\s\(.*x\{6625\}\)/$1\ (章亦春)/" diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/gbp.conf b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/gbp.conf deleted file mode 100644 index 38c12c1..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/gbp.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/rules b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/source/format b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/control b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/control deleted file mode 100644 index 9ecf806..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/control +++ /dev/null @@ -1,13 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: setifempty -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/generic b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/setifempty b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/setifempty deleted file mode 100644 index 6aee6f3..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/setifempty +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - - location /setifempty { - set_if_empty \$var aaa; - set_if_empty \$var bbb; - if (\$var = aaa ) { - return 200; - } - return 500; - } -} -EOF - -exp="response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/setifempty` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/upstream/metadata b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/upstream/metadata deleted file mode 100644 index fe767d2..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/openresty/set-misc-nginx-module/issues -Bug-Submit: https://github.com/openresty/set-misc-nginx-module/issues/new -Repository-Browse: https://github.com/openresty/set-misc-nginx-module diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/watch b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/watch deleted file mode 100644 index b6d7cc0..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/openresty/set-misc-nginx-module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ddebug.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ddebug.h deleted file mode 100644 index aaa6fef..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ddebug.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef DDEBUG_H -#define DDEBUG_H - -#include -#include - -#if defined(DDEBUG) && (DDEBUG) - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) fprintf(stderr, "set_misc *** "); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__) - -# else - -#include -#include - -#include - -static ngx_inline void -dd(const char *fmt, ...) { -} - -# endif - -#else - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) - -# else - -#include - -static ngx_inline void -dd(const char *fmt, ...) { -} - -# endif - -#endif - -#if defined(DDEBUG) && (DDEBUG) - -#define dd_check_read_event_handler(r) \ - dd("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#define dd_check_write_event_handler(r) \ - dd("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - -#define dd_check_read_event_handler(r) -#define dd_check_write_event_handler(r) - -#endif - -#endif /* DDEBUG_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.c deleted file mode 100644 index c56c7ba..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.c +++ /dev/null @@ -1,263 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include - -#include "ngx_http_set_base32.h" -#include "ngx_http_set_misc_module.h" - - -#define base32_encoded_length(len) ((((len)+4)/5)*8) -#define base32_decoded_length(len) ((((len)+7)/8)*5) - - -static void encode_base32(size_t slen, u_char *src, size_t *dlen, u_char *dst, - ngx_flag_t padding, ngx_str_t *alphabet); -static int decode_base32(size_t slen, u_char *src, size_t *dlen, u_char *dst, - u_char *basis32); - - -ngx_int_t -ngx_http_set_misc_encode_base32(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - u_char *src, *dst; - - ngx_http_set_misc_loc_conf_t *conf; - - conf = ngx_http_get_module_loc_conf(r, ngx_http_set_misc_module); - - len = base32_encoded_length(v->len); - - dd("estimated dst len: %d", (int) len); - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - src = v->data; dst = p; - - encode_base32(v->len, src, &len, dst, conf->base32_padding, - &conf->base32_alphabet); - - res->data = p; - res->len = len; - - dd("res (len %d): %.*s", (int) res->len, (int) res->len, res->data); - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_decode_base32(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - u_char *src, *dst; - int ret; - - ngx_http_set_misc_loc_conf_t *conf; - - conf = ngx_http_get_module_loc_conf(r, ngx_http_set_misc_module); - - len = base32_decoded_length(v->len); - - dd("estimated dst len: %d", (int) len); - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - src = v->data; dst = p; - - ret = decode_base32(v->len, src, &len, dst, conf->basis32); - - if (ret == 0 /* OK */) { - res->data = p; - res->len = len; - - return NGX_OK; - } - - /* failed to decode */ - - res->data = NULL; - res->len = 0; - - return NGX_OK; -} - - -/* See the implementation in src/core/ngx_string.c's - * ngx_(encode|decode)_base64() for details. */ - -static void -encode_base32(size_t slen, u_char *src, size_t *dlen, u_char *dst, - ngx_flag_t padding, ngx_str_t *alphabet) -{ - unsigned char *basis32 = alphabet->data; - - size_t len; - u_char *s; - u_char *d; - - len = slen; - s = src; - d = dst; - - while (len > 4) { - *d++ = basis32[s[0] >> 3]; - *d++ = basis32[((s[0] & 0x07) << 2) | (s[1] >> 6)]; - *d++ = basis32[(s[1] >> 1) & 0x1f]; - *d++ = basis32[((s[1] & 1) << 4) | (s[2] >> 4)]; - *d++ = basis32[((s[2] & 0x0f) << 1) | (s[3] >> 7)]; - *d++ = basis32[(s[3] >> 2) & 0x1f]; - *d++ = basis32[((s[3] & 0x03) << 3) | (s[4] >> 5)]; - *d++ = basis32[s[4] & 0x1f]; - - s += 5; - len -= 5; - } - - if (len) { - *d++ = basis32[s[0] >> 3]; - - if (len == 1) { - /* 1 byte left */ - *d++ = basis32[(s[0] & 0x07) << 2]; - - /* pad six '='s to the end */ - if (padding) { - *d++ = '='; - *d++ = '='; - *d++ = '='; - *d++ = '='; - *d++ = '='; - } - - } else { - *d++ = basis32[((s[0] & 0x07) << 2) | (s[1] >> 6)]; - *d++ = basis32[(s[1] >> 1) & 0x1f]; - - if (len == 2) { - /* 2 bytes left */ - *d++ = basis32[(s[1] & 1) << 4]; - - /* pad four '='s to the end */ - if (padding) { - *d++ = '='; - *d++ = '='; - *d++ = '='; - } - - } else { - *d++ = basis32[((s[1] & 1) << 4) | (s[2] >> 4)]; - - if (len == 3) { - /* 3 bytes left */ - *d++ = basis32[(s[2] & 0x0f) << 1]; - - if (padding) { - /* pad three '='s to the end */ - *d++ = '='; - *d++ = '='; - } - - } else { - /* 4 bytes left */ - *d++ = basis32[((s[2] & 0x0f) << 1) | (s[3] >> 7)]; - *d++ = basis32[(s[3] >> 2) & 0x1f]; - *d++ = basis32[(s[3] & 0x03) << 3]; - - /* pad one '=' to the end */ - } - } - } - - if (padding) { - *d++ = '='; - } - } - - *dlen = (size_t) (d - dst); -} - - -static int -decode_base32(size_t slen, u_char *src, size_t *dlen, u_char *dst, - u_char *basis32) -{ - size_t len, mod; - u_char *s = src; - u_char *d = dst; - - for (len = 0; len < slen; len++) { - if (s[len] == '=') { - break; - } - - if (basis32[s[len]] == 77) { - return -1; - } - } - - mod = len % 8; - - if (mod == 1 || mod == 3 || mod == 6) { - /* bad Base32 digest length */ - return -1; - } - - while (len > 7) { - *d++ = (basis32[s[0]] << 3) | ((basis32[s[1]] >> 2) & 0x07); - - *d++ = ((basis32[s[1]] & 0x03) << 6) | (basis32[s[2]] << 1) | - ((basis32[s[3]] >> 4) & 1); - - *d++ = ((basis32[s[3]] & 0x0f) << 4) | ((basis32[s[4]] >> 1) & 0x0f); - - *d++ = ((basis32[s[4]] & 1) << 7) | ((basis32[s[5]] & 0x1f) << 2) | - ((basis32[s[6]] >> 3) & 0x03); - *d++ = ((basis32[s[6]] & 0x07) << 5) | (basis32[s[7]] & 0x1f); - - s += 8; - len -= 8; - } - - if (len) { - /* 2 bytes left */ - *d++ = (basis32[s[0]] << 3) | ((basis32[s[1]] >> 2) & 0x07); - - if (len > 2) { - /* 4 bytes left */ - *d++ = ((basis32[s[1]] & 0x03) << 6) | ((basis32[s[2]] & 0x1f) << 1) - | ((basis32[s[3]] >> 4) & 1); - - if (len > 4) { - /* 5 bytes left */ - *d++ = ((basis32[s[3]] & 0x0f) << 4) | - ((basis32[s[4]] >> 1) & 0x0f); - - if (len > 5) { - /* 7 bytes left */ - *d++ = ((basis32[s[4]] & 1) << 7) | - ((basis32[s[5]] & 0x1f) << 2) | - ((basis32[s[6]] >> 3) & 0x03); - } - } - } - } - - *dlen = (size_t) (d - dst); - - return 0; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.h deleted file mode 100644 index 68ca277..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef NGX_HTTP_SET_BASE32 -#define NGX_HTTP_SET_BASE32 - - -#include -#include -#include - - -ngx_int_t ngx_http_set_misc_encode_base32(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_decode_base32(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_BASE32 */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.c deleted file mode 100644 index 8666ad8..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.c +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_base64.h" - - -ngx_int_t -ngx_http_set_misc_set_decode_base64(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_str_t src; - - src.len = v->len; - src.data = v->data; - - res->len = ngx_base64_decoded_length(v->len); - ndk_palloc_re(res->data, r->pool, res->len); - - if (ngx_decode_base64(res, &src) != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_decode_base64: invalid value"); - return NGX_ERROR; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_set_encode_base64(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_str_t src; - - src.len = v->len; - src.data = v->data; - - res->len = ngx_base64_encoded_length(v->len); - ndk_palloc_re(res->data, r->pool, res->len); - - ngx_encode_base64(res, &src); - - return NGX_OK; -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.h deleted file mode 100644 index 6594c77..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.h +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_encode_base64(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_decode_base64(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.c deleted file mode 100644 index f1426ad..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.c +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_base64url.h" - - -ngx_int_t -ngx_http_set_misc_set_decode_base64url(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - - ngx_str_t src; - - src.len = v->len; - src.data = v->data; - - res->len = ngx_base64_decoded_length(v->len); - ndk_palloc_re(res->data, r->pool, res->len); - - if (ngx_decode_base64url(res, &src) != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_decode_base64url: invalid value"); - return NGX_ERROR; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_set_encode_base64url(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - - ngx_str_t src; - - src.len = v->len; - src.data = v->data; - - res->len = ngx_base64_encoded_length(v->len); - ndk_palloc_re(res->data, r->pool, res->len); - - ngx_encode_base64url(res, &src); - - return NGX_OK; -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.h deleted file mode 100644 index 6ccf63b..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.h +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_encode_base64url(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_decode_base64url(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.c deleted file mode 100644 index f4c80a1..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.c +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_default_value.h" - - -ngx_int_t -ngx_http_set_misc_set_if_empty(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_http_variable_value_t *cur_v, *default_v; - - cur_v = &v[0]; - default_v = &v[1]; - - if (cur_v->not_found || cur_v->len == 0) { - res->data = default_v->data; - res->len = default_v->len; - - return NGX_OK; - } - - res->data = cur_v->data; - res->len = cur_v->len; - - return NGX_OK; -} - - -char * -ngx_http_set_if_empty(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t filter; - - value = cf->args->elts; - - filter.type = NDK_SET_VAR_MULTI_VALUE; - filter.func = (void *) ngx_http_set_misc_set_if_empty; - filter.size = 2; - filter.data = NULL; - - return ndk_set_var_multi_value_core(cf, &value[1], &value[1], &filter); -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.h deleted file mode 100644 index 5bf5168..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.h +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include - -#ifndef NGX_HTTP_SET_DEFAULT_VALUE -#define NGX_HTTP_SET_DEFAULT_VALUE - - -char *ngx_http_set_if_empty(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -ngx_int_t ngx_http_set_misc_set_if_empty(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_DEFAULT_VALUE */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.c deleted file mode 100644 index a09f8da..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.c +++ /dev/null @@ -1,210 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_escape_uri.h" -#include "ngx_string.h" - - -static uintptr_t ngx_escape_uri_patched(u_char *dst, u_char *src, size_t size, - ngx_uint_t type); - - -ngx_int_t -ngx_http_set_misc_escape_uri(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - uintptr_t escape; - u_char *src, *dst; - - if (v->len == 0) { - res->len = 0; - res->data = NULL; - return NGX_OK; - } - - src = v->data; - - dd("before escape:%.*s", v->len, v->data); - escape = 2 * ngx_escape_uri_patched(NULL, src, v->len, NGX_ESCAPE_URI); - /* len = v->len + 2 * ngx_escape_uri(NULL, src, v->len, NGX_ESCAPE_URI); */ - len = escape + v->len; - dd("escaped string len:%zu", len); - - dst = ngx_palloc(r->pool, len); - - if (dst == NULL) { - return NGX_ERROR; - } - - if (escape == 0) { - ngx_memcpy(dst, src, len); - dd("escape == 0"); - - } else { - ngx_escape_uri_patched(dst, src, v->len, NGX_ESCAPE_URI); - } - - res->data = dst; - res->len = len; - - dd("after eacape:%.*s", (int) res->len, res->data); - - return NGX_OK; -} - - -static uintptr_t -ngx_escape_uri_patched(u_char *dst, u_char *src, size_t size, ngx_uint_t type) -{ - ngx_uint_t n; - uint32_t *escape; - static u_char hex[] = "0123456789ABCDEF"; - - /* " ", "#", "%", "?", %00-%1F, %7F-%FF */ - - static uint32_t uri[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0xfc00886d, /* 1111 1100 0000 0000 1000 1000 0110 1101 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x78000000, /* 0111 1000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0xa8000000, /* 1010 1000 0000 0000 0000 0000 0000 0000 */ - - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - }; - - /* " ", "#", "%", "+", "?", %00-%1F, %7F-%FF */ - - static uint32_t args[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0x80000829, /* 1000 0000 0000 0000 0000 1000 0010 1001 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */ - - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - }; - - /* " ", "#", """, "%", "'", %00-%1F, %7F-%FF */ - - static uint32_t html[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0x000000ad, /* 0000 0000 0000 0000 0000 0000 1010 1101 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */ - - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - }; - - /* " ", """, "%", "'", %00-%1F, %7F-%FF */ - - static uint32_t refresh[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0x00000085, /* 0000 0000 0000 0000 0000 0000 1000 0101 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */ - - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - }; - - /* " ", "%", %00-%1F */ - - static uint32_t memcached[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0x00000021, /* 0000 0000 0000 0000 0000 0000 0010 0001 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - }; - - /* mail_auth is the same as memcached */ - - static uint32_t *map[] = - { uri, args, html, refresh, memcached, memcached }; - - - escape = map[type]; - - if (dst == NULL) { - - /* find the number of the characters to be escaped */ - - n = 0; - - while (size) { - if (escape[*src >> 5] & (1 << (*src & 0x1f))) { - n++; - } - - src++; - size--; - } - - return (uintptr_t) n; - } - - while (size) { - if (escape[*src >> 5] & (1 << (*src & 0x1f))) { - *dst++ = '%'; - *dst++ = hex[*src >> 4]; - *dst++ = hex[*src & 0xf]; - src++; - - } else { - *dst++ = *src++; - } - - size--; - } - - return (uintptr_t) dst; -} - - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.h deleted file mode 100644 index b8564bd..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef NGX_HTTP_SET_ESCAPE_URI -#define NGX_HTTP_SET_ESCAPE_URI - - -ngx_int_t -ngx_http_set_misc_escape_uri(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_ESCAPE_URI */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.c deleted file mode 100644 index 59ad606..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.c +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_set_hash.h" - -#if NGX_HAVE_SHA1 -#include "ngx_sha1.h" - -#ifndef SHA_DIGEST_LENGTH -#define SHA_DIGEST_LENGTH 20 -#endif - -#endif - -#include "ngx_md5.h" - - -#ifndef MD5_DIGEST_LENGTH -#define MD5_DIGEST_LENGTH 16 -#endif - -enum { -#if NGX_HAVE_SHA1 - SHA_HEX_LENGTH = SHA_DIGEST_LENGTH * 2, -#endif - MD5_HEX_LENGTH = MD5_DIGEST_LENGTH * 2 -}; - - -#if NGX_HAVE_SHA1 -ngx_int_t -ngx_http_set_misc_set_sha1(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - u_char *p; - ngx_sha1_t sha; - u_char sha_buf[SHA_DIGEST_LENGTH]; - - p = ngx_palloc(r->pool, SHA_HEX_LENGTH); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_sha1_init(&sha); - ngx_sha1_update(&sha, v->data, v->len); - ngx_sha1_final(sha_buf, &sha); - - ngx_hex_dump(p, sha_buf, sizeof(sha_buf)); - - res->data = p; - res->len = SHA_HEX_LENGTH; - - return NGX_OK; -} -#endif - - -ngx_int_t -ngx_http_set_misc_set_md5(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - u_char *p; - ngx_md5_t md5; - u_char md5_buf[MD5_DIGEST_LENGTH]; - - p = ngx_palloc(r->pool, MD5_HEX_LENGTH); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_md5_init(&md5); - ngx_md5_update(&md5, v->data, v->len); - ngx_md5_final(md5_buf, &md5); - - ngx_hex_dump(p, md5_buf, sizeof(md5_buf)); - - res->data = p; - res->len = MD5_HEX_LENGTH; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.h deleted file mode 100644 index db3a558..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef NGX_HTTP_SET_HASH_H -#define NGX_HTTP_SET_HASH_H - - -#include "ngx_http_set_misc_module.h" - - -ngx_int_t ngx_http_set_misc_set_sha1(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -ngx_int_t ngx_http_set_misc_set_md5(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -#endif /* NGX_HTTP_SET_HASH_H */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.c deleted file mode 100644 index 391dd35..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.c +++ /dev/null @@ -1,141 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_set_hashed_upstream.h" - - -ngx_uint_t -ngx_http_set_misc_apply_distribution(ngx_log_t *log, ngx_uint_t hash, - ndk_upstream_list_t *ul, ngx_http_set_misc_distribution_t type) -{ - switch (type) { - case ngx_http_set_misc_distribution_modula: - return (uint32_t) hash % (uint32_t) ul->nelts; - - default: - ngx_log_error(NGX_LOG_ERR, log, 0, "apply_distribution: " - "unknown distribution: %d", type); - - return 0; - } - - /* impossible to reach here */ -} - - -ngx_int_t -ngx_http_set_misc_set_hashed_upstream(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v, void *data) -{ - ngx_str_t **u; - ndk_upstream_list_t *ul = data; - ngx_str_t ulname; - ngx_uint_t hash, index; - ngx_http_variable_value_t *key; - - if (ul == NULL) { - ulname.data = v->data; - ulname.len = v->len; - - dd("ulname: %.*s", (int) ulname.len, ulname.data); - - ul = ndk_get_upstream_list(ndk_http_get_main_conf(r), - ulname.data, ulname.len); - - if (ul == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_hashed_upstream: upstream list \"%V\" " - "not defined yet", &ulname); - return NGX_ERROR; - } - - key = v + 1; - - } else { - key = v; - } - - if (ul->nelts == 0) { - res->data = NULL; - res->len = 0; - - return NGX_OK; - } - - u = ul->elts; - - dd("upstream list: %d upstreams found", (int) ul->nelts); - - if (ul->nelts == 1) { - dd("only one upstream found in the list"); - - res->data = u[0]->data; - res->len = u[0]->len; - - return NGX_OK; - } - - dd("key: \"%.*s\"", key->len, key->data); - - hash = ngx_hash_key_lc(key->data, key->len); - - index = ngx_http_set_misc_apply_distribution(r->connection->log, hash, ul, - ngx_http_set_misc_distribution_modula); - - res->data = u[index]->data; - res->len = u[index]->len; - - return NGX_OK; -} - - -char * -ngx_http_set_hashed_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t filter; - ngx_uint_t n; - ngx_str_t *var; - ngx_str_t *ulname; - ndk_upstream_list_t *ul; - ngx_str_t *v; - - value = cf->args->elts; - - var = &value[1]; - ulname = &value[2]; - - n = ngx_http_script_variables_count(ulname); - - filter.func = (void *) ngx_http_set_misc_set_hashed_upstream; - - if (n) { - /* upstream list name contains variables */ - v = &value[2]; - filter.size = 2; - filter.data = NULL; - filter.type = NDK_SET_VAR_MULTI_VALUE_DATA; - - return ndk_set_var_multi_value_core(cf, var, v, &filter); - } - - ul = ndk_get_upstream_list(ndk_http_conf_get_main_conf(cf), - ulname->data, ulname->len); - if (ul == NULL) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "set_hashed_upstream: upstream list \"%V\" " - "not defined yet", ulname); - return NGX_CONF_ERROR; - } - - v = &value[3]; - - filter.size = 1; - filter.data = ul; - filter.type = NDK_SET_VAR_VALUE_DATA; - - return ndk_set_var_value_core(cf, var, v, &filter); -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.h deleted file mode 100644 index 8b7caa7..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef NGX_HTTP_SET_HASHED_UPSTREAM -#define NGX_HTTP_SET_HASHED_UPSTREAM - - -#include -#include -#include -#include - - -typedef enum { - ngx_http_set_misc_distribution_modula, - ngx_http_set_misc_distribution_random /* XXX not used */ -} ngx_http_set_misc_distribution_t; - - -ngx_uint_t ngx_http_set_misc_apply_distribution(ngx_log_t *log, ngx_uint_t hash, - ndk_upstream_list_t *ul, ngx_http_set_misc_distribution_t type); - -char *ngx_http_set_hashed_upstream(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - -ngx_int_t ngx_http_set_misc_set_hashed_upstream(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v, void *data); - - -#endif /* NGX_HTTP_SET_HASHED_UPSTREAM */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.c deleted file mode 100644 index 6900650..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.c +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_hex.h" - - -ngx_int_t -ngx_http_set_misc_set_decode_hex(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - u_char *p; - ngx_int_t n; - ngx_uint_t i; - size_t len; - - if (v->len % 2 != 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_decode_hex: invalid value"); - return NGX_ERROR; - } - - p = v->data; - len = v->len >> 1; - - res->data = ngx_palloc(r->pool, len); - if (res->data == NULL) { - return NGX_ERROR; - } - - for (i = 0; i < len; i++) { - n = ngx_hextoi(p, 2); - if (n == NGX_ERROR || n > 255) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_decode_hex: invalid value"); - return NGX_ERROR; - } - - p += 2; - res->data[i] = (u_char) n; - } - - res->len = len; - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_set_encode_hex(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - res->len = v->len << 1; - res->data = ngx_palloc(r->pool, res->len); - if (res->data == NULL) { - return NGX_ERROR; - } - - ngx_hex_dump(res->data, v->data, v->len); - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.h deleted file mode 100644 index e8b77e0..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.h +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_decode_hex(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_encode_hex(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.c deleted file mode 100644 index 139c0c7..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.c +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include - -#include "ngx_http_set_hmac.h" -#include -#include - - -/* this function's implementation is partly borrowed from - * https://github.com/anomalizer/ngx_aws_auth */ -static ngx_int_t -ngx_http_set_misc_set_hmac(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v, const EVP_MD *evp_md) -{ - ngx_http_variable_value_t *secret, *string_to_sign; - unsigned int md_len = 0; - unsigned char md[EVP_MAX_MD_SIZE]; - - secret = v; - string_to_sign = v + 1; - - dd("secret=%.*s, string_to_sign=%.*s", (int) secret->len, secret->data, - (int) string_to_sign->len, string_to_sign->data); - - HMAC(evp_md, secret->data, secret->len, string_to_sign->data, - string_to_sign->len, md, &md_len); - - /* defensive test if there is something wrong with openssl */ - if (md_len == 0 || md_len > EVP_MAX_MD_SIZE) { - res->len = 0; - return NGX_ERROR; - } - - res->len = md_len; - ndk_palloc_re(res->data, r->pool, md_len); - - ngx_memcpy(res->data, - &md, - md_len); - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_set_hmac_sha1(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - return ngx_http_set_misc_set_hmac(r, res, v, EVP_sha1()); -} - - -ngx_int_t -ngx_http_set_misc_set_hmac_sha256(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - return ngx_http_set_misc_set_hmac(r, res, v, EVP_sha256()); -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.h deleted file mode 100644 index fe02ea4..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.h +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_hmac_sha1(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_hmac_sha256(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.c deleted file mode 100644 index fa1c703..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.c +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include - - -#ifndef NGX_HTTP_SET_MISC_FMT_DATE_LEN -#define NGX_HTTP_SET_MISC_FMT_DATE_LEN 256 -#endif - - -ngx_int_t -ngx_http_set_local_today(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - time_t now; - ngx_tm_t tm; - u_char *p; - - /*t = ngx_timeofday();*/ - - now = ngx_time(); - - ngx_gmtime(now + ngx_cached_time->gmtoff * 60, &tm); - - dd("tm.ngx_tm_hour:%d", tm.ngx_tm_hour); - - p = ngx_palloc(r->pool, sizeof("yyyy-mm-dd") - 1); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_sprintf(p, "%04d-%02d-%02d", tm.ngx_tm_year, tm.ngx_tm_mon, - tm.ngx_tm_mday); - - res->data = p; - res->len = sizeof("yyyy-mm-dd") - 1; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_formatted_gmt_time(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - time_t now; - u_char *p; - struct tm tm; - - if (v->not_found || v->len == 0) { - res->data = NULL; - res->len = 0; - return NGX_OK; - } - - now = ngx_time(); - ngx_libc_gmtime(now, &tm); - - p = ngx_palloc(r->pool, NGX_HTTP_SET_MISC_FMT_DATE_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - res->len = strftime((char *) p, NGX_HTTP_SET_MISC_FMT_DATE_LEN, - (char *) v->data, &tm); - if (res->len == 0) { - return NGX_ERROR; - } - - res->data = p; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_formatted_local_time(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - time_t now; - u_char *p; - struct tm tm; - - if (v->not_found || v->len == 0) { - res->data = NULL; - res->len = 0; - return NGX_OK; - } - - now = ngx_time(); - ngx_libc_localtime(now, &tm); - - p = ngx_palloc(r->pool, NGX_HTTP_SET_MISC_FMT_DATE_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - res->len = strftime((char *) p, NGX_HTTP_SET_MISC_FMT_DATE_LEN, - (char *) v->data, &tm); - if (res->len == 0) { - return NGX_ERROR; - } - - res->data = p; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.h deleted file mode 100644 index 993431e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include - - -ngx_int_t ngx_http_set_local_today(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_formatted_gmt_time(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_formatted_local_time(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.c deleted file mode 100644 index 3b12b0e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.c +++ /dev/null @@ -1,586 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_set_misc_module.h" -#include -#include "ngx_http_set_base32.h" -#include "ngx_http_set_default_value.h" -#include "ngx_http_set_hashed_upstream.h" -#include "ngx_http_set_unescape_uri.h" -#include "ngx_http_set_quote_sql.h" -#include "ngx_http_set_quote_json.h" -#include "ngx_http_set_escape_uri.h" -#include "ngx_http_set_local_today.h" -#include "ngx_http_set_hash.h" -#include "ngx_http_set_hex.h" -#include "ngx_http_set_base64.h" -#include "ngx_http_set_base64url.h" -#if NGX_OPENSSL -#include "ngx_http_set_hmac.h" -#endif -#include "ngx_http_set_random.h" -#include "ngx_http_set_secure_random.h" -#include "ngx_http_set_rotate.h" - - -#define NGX_UNESCAPE_URI_COMPONENT 0 -#define BASE32_ALPHABET_LEN 32 - - -static void *ngx_http_set_misc_create_loc_conf(ngx_conf_t *cf); -static char *ngx_http_set_misc_merge_loc_conf(ngx_conf_t *cf, void *parent, - void *child); -static char *ngx_http_set_misc_base32_alphabet(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - - -static ngx_conf_deprecated_t ngx_conf_deprecated_set_misc_base32_padding = { - ngx_conf_deprecated, "set_misc_base32_padding", "set_base32_padding" -}; - - -static ndk_set_var_t ngx_http_set_misc_set_encode_base64_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_encode_base64, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_decode_base64_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_decode_base64, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_encode_base64url_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_encode_base64url, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_decode_base64url_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_decode_base64url, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_decode_hex_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_decode_hex, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_encode_hex_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_encode_hex, - 1, - NULL -}; - - -#if NGX_OPENSSL -static ndk_set_var_t ngx_http_set_misc_set_hmac_sha1_filter = { - NDK_SET_VAR_MULTI_VALUE, - (void *) ngx_http_set_misc_set_hmac_sha1, - 2, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_hmac_sha256_filter = { - NDK_SET_VAR_MULTI_VALUE, - (void *) ngx_http_set_misc_set_hmac_sha256, - 2, - NULL -}; -#endif - - -#ifndef NGX_HTTP_SET_HASH -static ndk_set_var_t ngx_http_set_misc_set_md5_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_md5, - 1, - NULL -}; - - -#if NGX_HAVE_SHA1 -static ndk_set_var_t ngx_http_set_misc_set_sha1_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_sha1, - 1, - NULL -}; -#endif -#endif - - -static ndk_set_var_t ngx_http_set_misc_unescape_uri_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_unescape_uri, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_escape_uri_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_escape_uri, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_decode_base32_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_decode_base32, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_quote_sql_str_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_quote_sql_str, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_quote_pgsql_str_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_quote_pgsql_str, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_quote_json_str_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_quote_json_str, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_encode_base32_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_encode_base32, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_local_today_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_local_today, - 0, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_formatted_gmt_time_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_formatted_gmt_time, - 2, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_formatted_local_time_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_formatted_local_time, - 2, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_random_filter = { - NDK_SET_VAR_MULTI_VALUE, - (void *) ngx_http_set_misc_set_random, - 2, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_secure_random_alphanum_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_secure_random_alphanum, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_secure_random_lcalpha_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_secure_random_lcalpha, - 1, - NULL -}; - - -static ngx_command_t ngx_http_set_misc_commands[] = { - { ngx_string ("set_encode_base64"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_encode_base64_filter - }, - { ngx_string ("set_decode_base64"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_decode_base64_filter - }, - { ngx_string ("set_encode_base64url"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_encode_base64url_filter - }, - { ngx_string ("set_decode_base64url"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_decode_base64url_filter - }, - { ngx_string ("set_decode_hex"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_decode_hex_filter - }, - { ngx_string ("set_encode_hex"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_encode_hex_filter - }, -#if NGX_OPENSSL - { ngx_string ("set_hmac_sha1"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ndk_set_var_multi_value, - 0, - 0, - &ngx_http_set_misc_set_hmac_sha1_filter - }, - { ngx_string ("set_hmac_sha256"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ndk_set_var_multi_value, - 0, - 0, - &ngx_http_set_misc_set_hmac_sha256_filter - }, -#endif -#ifndef NGX_HTTP_SET_HASH - { ngx_string ("set_md5"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_md5_filter - }, -#if NGX_HAVE_SHA1 - { - ngx_string ("set_sha1"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_sha1_filter - }, -#endif -#endif - { - ngx_string ("set_unescape_uri"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_unescape_uri_filter - }, - { - ngx_string ("set_escape_uri"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_escape_uri_filter - }, - { - ngx_string ("set_quote_sql_str"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_quote_sql_str_filter - }, - { - ngx_string ("set_quote_pgsql_str"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_quote_pgsql_str_filter - }, - { - ngx_string ("set_quote_json_str"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_quote_json_str_filter - }, - { - ngx_string ("set_if_empty"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE2, - ngx_http_set_if_empty, - 0, - 0, - NULL - }, - { - ngx_string("set_hashed_upstream"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ngx_http_set_hashed_upstream, - 0, - 0, - NULL - }, - { - /* this is now deprecated; use set_base32_padding instead */ - ngx_string("set_misc_base32_padding"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_set_misc_loc_conf_t, base32_padding), - &ngx_conf_deprecated_set_misc_base32_padding, - }, - { - ngx_string("set_base32_padding"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_set_misc_loc_conf_t, base32_padding), - NULL - }, - { - ngx_string("set_base32_alphabet"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_set_misc_base32_alphabet, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_set_misc_loc_conf_t, base32_alphabet), - NULL - }, - { - ngx_string("set_encode_base32"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_encode_base32_filter - }, - { - ngx_string("set_decode_base32"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_decode_base32_filter - }, - { - ngx_string("set_local_today"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_local_today_filter - }, - { - ngx_string("set_formatted_gmt_time"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE2, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_formatted_gmt_time_filter - }, - { - ngx_string("set_formatted_local_time"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE2, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_formatted_local_time_filter - }, - { ngx_string ("set_random"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ndk_set_var_multi_value, - 0, - 0, - &ngx_http_set_misc_set_random_filter - }, - { ngx_string ("set_secure_random_alphanum"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_secure_random_alphanum_filter - }, - { ngx_string ("set_secure_random_lcalpha"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_secure_random_lcalpha_filter - }, - { ngx_string ("set_rotate"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ngx_http_set_rotate, - 0, - 0, - NULL - }, - - ngx_null_command -}; - - -static ngx_http_module_t ngx_http_set_misc_module_ctx = { - NULL, /* preconfiguration */ - NULL, /* postconfiguration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_set_misc_create_loc_conf, /* create location configuration */ - ngx_http_set_misc_merge_loc_conf /* merge location configuration */ -}; - - -ngx_module_t ngx_http_set_misc_module = { - NGX_MODULE_V1, - &ngx_http_set_misc_module_ctx, /* module context */ - ngx_http_set_misc_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -void * -ngx_http_set_misc_create_loc_conf(ngx_conf_t *cf) -{ - ngx_http_set_misc_loc_conf_t *conf; - - conf = ngx_palloc(cf->pool, sizeof(ngx_http_set_misc_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - conf->base32_padding = NGX_CONF_UNSET; - conf->base32_alphabet.data = NULL; - conf->base32_alphabet.len = 0; - conf->current = NGX_CONF_UNSET; - - return conf; -} - - -char * -ngx_http_set_misc_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) -{ - ngx_uint_t i; - - ngx_http_set_misc_loc_conf_t *prev = parent; - ngx_http_set_misc_loc_conf_t *conf = child; - - ngx_conf_merge_value(conf->base32_padding, prev->base32_padding, 1); - - ngx_conf_merge_str_value(conf->base32_alphabet, prev->base32_alphabet, - "0123456789abcdefghijklmnopqrstuv"); - - ngx_conf_merge_value(conf->current, prev->current, NGX_CONF_UNSET); - - for (i = 0; i < BASE32_ALPHABET_LEN; i++) { - conf->basis32[conf->base32_alphabet.data[i]] = (u_char) i; - } - - return NGX_CONF_OK; -} - - -static char * -ngx_http_set_misc_base32_alphabet(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - ngx_str_t *value; - - value = cf->args->elts; - - if (value[1].len != BASE32_ALPHABET_LEN) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "\"set_base32_alphabet\" directive takes an " - "alphabet of %uz bytes but %d expected", - value[1].len, BASE32_ALPHABET_LEN); - return NGX_CONF_ERROR; - } - - return ngx_conf_set_str_slot(cf, cmd, conf); -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.h deleted file mode 100644 index 49b3c9e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef NGX_HTTP_SET_MISC_MODULE_H -#define NGX_HTTP_SET_MISC_MODULE_H - - -#include -#include -#include -#include - - -#ifndef NGX_HAVE_SHA1 -# if (nginx_version >= 1011002) -# define NGX_HAVE_SHA1 1 -# endif -#endif - - -typedef struct { - ngx_flag_t base32_padding; - ngx_str_t base32_alphabet; - u_char basis32[256]; - ngx_int_t current; /* for set_rotate */ -} ngx_http_set_misc_loc_conf_t; - - -extern ngx_module_t ngx_http_set_misc_module; - - -#endif /* NGX_HTTP_SET_MISC_MODULE_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.c deleted file mode 100644 index 4bed13c..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.c +++ /dev/null @@ -1,165 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_quote_json.h" - -ngx_int_t -ngx_http_set_misc_quote_json_str(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - size_t escape; - - if (v->not_found || v->len == 0) { - res->data = (u_char *) "null"; - res->len = sizeof("null") - 1; - return NGX_OK; - } - - escape = ngx_http_set_misc_escape_json_str(NULL, v->data, v->len); - - len = sizeof("''") - 1 - + v->len - + escape; - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - res->data = p; - res->len = len; - - *p++ = '\"'; - - if (escape == 0) { - p = ngx_copy(p, v->data, v->len); - - } else { - p = (u_char *) ngx_http_set_misc_escape_json_str(p, v->data, v->len); - } - - *p++ = '\"'; - - if (p != res->data + res->len) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_quote_sql_str: buffer error"); - return NGX_ERROR; - } - - return NGX_OK; -} - - -uintptr_t -ngx_http_set_misc_escape_json_str(u_char *dst, u_char *src, size_t size) -{ - ngx_uint_t n; - - static u_char hex[] = "0123456789abcdef"; - - if (dst == NULL) { - /* find the number of characters to be escaped */ - - n = 0; - - while (size) { - /* UTF-8 char has high bit of 1 */ - if ((*src & 0x80) == 0) { - switch (*src) { - case '\r': - case '\n': - case '\\': - case '"': - case '\f': - case '\b': - case '\t': - n++; - break; - default: - if (*src < 32) { - n += sizeof("\\u00xx") - 2; - } - - break; - } - } - - src++; - size--; - } - - return (uintptr_t) n; - } - - while (size) { - if ((*src & 0x80) == 0) { - switch (*src) { - case '\r': - *dst++ = '\\'; - *dst++ = 'r'; - break; - - case '\n': - *dst++ = '\\'; - *dst++ = 'n'; - break; - - case '\\': - *dst++ = '\\'; - *dst++ = '\\'; - break; - - case '"': - *dst++ = '\\'; - *dst++ = '"'; - break; - - case '\f': - *dst++ = '\\'; - *dst++ = 'f'; - break; - - case '\b': - *dst++ = '\\'; - *dst++ = 'b'; - break; - - case '\t': - *dst++ = '\\'; - *dst++ = 't'; - break; - - default: - if (*src < 32) { /* control chars */ - *dst++ = '\\'; - *dst++ = 'u'; - *dst++ = '0'; - *dst++ = '0'; - *dst++ = hex[*src >> 4]; - *dst++ = hex[*src & 0x0f]; - - } else { - *dst++ = *src; - } - - break; - } /* switch */ - - src++; - - } else { - *dst++ = *src++; - } - - size--; - } - - return (uintptr_t) dst; -} - - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.h deleted file mode 100644 index 1bf55e2..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef NGX_HTTP_SET_QUOTE_JSON_H -#define NGX_HTTP_SET_QUOTE_JSON_H - - -#include -#include -#include - - -ngx_int_t ngx_http_set_misc_quote_json_str(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); -uintptr_t ngx_http_set_misc_escape_json_str(u_char *dst, u_char *src, - size_t size); - - -#endif /* NGX_HTTP_SET_QUOTE_JSON_H */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.c deleted file mode 100644 index 8d78348..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.c +++ /dev/null @@ -1,382 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_quote_sql.h" - - -static ngx_int_t ngx_http_pg_utf_escape(ngx_http_request_t *r, ngx_str_t *res); -static ngx_int_t ngx_http_pg_utf_islegal(const unsigned char *s, ngx_int_t len); -static ngx_int_t ngx_http_pg_utf_mblen(const unsigned char *s); - - -ngx_int_t -ngx_http_set_misc_quote_pgsql_str(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - u_char *pstr; - ngx_int_t length; - - if (v->not_found || v->len ==0) { - res->data = (u_char *) "''"; - res->len = sizeof("''") - 1; - return NGX_OK; - } - - ngx_http_set_misc_quote_sql_str(r, res, v); - length = res->len; - - pstr = ngx_palloc(r->pool, length + 1); - if (pstr == NULL) { - return NGX_ERROR; - } - - *pstr = 'E'; - memcpy(pstr + 1, res->data, length); - res->data = pstr; - res->len = length + 1; - - if (ngx_http_pg_utf_islegal(res->data, res->len)) { - return NGX_OK; - } - - if (ngx_http_pg_utf_escape(r, res) != NGX_OK) { - return NGX_ERROR; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_pg_utf_mblen(const unsigned char *s) -{ - int len; - - if ((*s & 0x80) == 0) - len = 1; - else if ((*s & 0xe0) == 0xc0) - len = 2; - else if ((*s & 0xf0) == 0xe0) - len = 3; - else if ((*s & 0xf8) == 0xf0) - len = 4; -#ifdef NOT_USED - else if ((*s & 0xfc) == 0xf8) - len = 5; - else if ((*s & 0xfe) == 0xfc) - len = 6; -#endif - else - len = 1; - return len; -} - - -static ngx_int_t -ngx_http_pg_utf_islegal(const unsigned char *s, ngx_int_t len) -{ - ngx_int_t mblen; - ngx_int_t slen; - u_char a; - - slen = len; - - while (slen > 0) { - mblen = ngx_http_pg_utf_mblen(s); - if (slen < mblen) { - return 0; - } - - switch (mblen) { - - case 4: - a = *(s + 3); - if (a < 0x80 || a > 0xBF) { - return 0; - } - - break; - - case 3: - a = *(s + 2); - if (a < 0x80 || a > 0xBF) { - return 0; - } - - break; - - case 2: - a = *(s + 1); - - switch (*s) { - - case 0xE0: - if (a < 0xA0 || a > 0xBF) { - return 0; - } - - break; - - case 0xED: - if (a < 0x80 || a > 0x9F) { - return 0; - } - - break; - - case 0xF0: - if (a < 0x90 || a > 0xBF) { - return 0; - } - - break; - - case 0xF4: - if (a < 0x80 || a > 0x8F) { - return 0; - } - - break; - - default: - if (a < 0x80 || a > 0xBF) { - return 0; - } - - break; - } - - break; - - case 1: - a = *s; - if (a >= 0x80 && a < 0xC2) { - return 0; - } - - if (a > 0xF4) { - return 0; - } - - break; - - default: - return 0; - } - - s += mblen; - slen -= mblen; - } - - return 1; -} - - -static ngx_int_t -ngx_http_pg_utf_escape(ngx_http_request_t *r, ngx_str_t *res) -{ - ngx_str_t *result; - ngx_int_t l, count; - u_char *d, *p, *p1; - - l = res->len; - d = res->data; - result = res; - count = 0; - - while (l-- > 0) { - if (*d & 0x80) { - count += 4; - } - - d++; - count++; - } - - d = res->data; - l = res->len; - - p = ngx_palloc(r->pool, count); - if (p == NULL) { - return NGX_ERROR; - } - - p1 = p; - while (l-- > 0) { - if ((*d & 0x80)) { - *p++ = '\\'; - *p++ = '\\'; - *p++ = (*d >> 6) + '0'; - *p++ = ((*d >> 3) & 07) + '0'; - *p++ = (*d & 07) + '0'; - - } else { - *p++ = *d; - } - - d++; - } - - result->len = count; - result->data = p1; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_quote_sql_str(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - size_t escape; - - if (v->not_found || v->len == 0) { - res->data = (u_char *) "''"; - res->len = sizeof("''") - 1; - return NGX_OK; - } - - escape = ngx_http_set_misc_escape_sql_str(NULL, v->data, v->len); - - len = sizeof("''") - 1 + v->len + escape; - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - res->data = p; - res->len = len; - - *p++ = '\''; - - if (escape == 0) { - p = ngx_copy(p, v->data, v->len); - - } else { - p = (u_char *) ngx_http_set_misc_escape_sql_str(p, v->data, v->len); - } - - *p++ = '\''; - - if (p != res->data + res->len) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_quote_sql_str: buffer error"); - return NGX_ERROR; - } - - return NGX_OK; -} - - -uintptr_t -ngx_http_set_misc_escape_sql_str(u_char *dst, u_char *src, size_t size) -{ - ngx_uint_t n; - - if (dst == NULL) { - /* find the number of chars to be escaped */ - n = 0; - while (size) { - /* the highest bit of all the UTF-8 chars - * is always 1 */ - if ((*src & 0x80) == 0) { - switch (*src) { - case '\0': - case '\b': - case '\n': - case '\r': - case '\t': - case '\\': - case '\'': - case '"': - case '$': - case 26: /* \Z */ - n++; - break; - default: - break; - } - } - - src++; - size--; - } - - return (uintptr_t) n; - } - - while (size) { - if ((*src & 0x80) == 0) { - switch (*src) { - case '\0': - *dst++ = '\\'; - *dst++ = '0'; - break; - - case '\b': - *dst++ = '\\'; - *dst++ = 'b'; - break; - - case '\n': - *dst++ = '\\'; - *dst++ = 'n'; - break; - - case '\r': - *dst++ = '\\'; - *dst++ = 'r'; - break; - - case '\t': - *dst++ = '\\'; - *dst++ = 't'; - break; - - case '\\': - *dst++ = '\\'; - *dst++ = '\\'; - break; - - case '\'': - *dst++ = '\\'; - *dst++ = '\''; - break; - - case '"': - *dst++ = '\\'; - *dst++ = '"'; - break; - - case '$': - *dst++ = '\\'; - *dst++ = '$'; - break; - - case 26: - *dst++ = '\\'; - *dst++ = 'Z'; - break; - - default: - *dst++ = *src; - break; - } - - } else { - *dst++ = *src; - } - - src++; - size--; - } /* while (size) */ - - return (uintptr_t) dst; -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.h deleted file mode 100644 index c631dd7..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef NGX_SET_QUOTE_SQL_H -#define NGX_SET_QUOTE_SQL_H - - -#include -#include -#include - - -uintptr_t ngx_http_set_misc_escape_sql_str(u_char *dst, u_char *src, - size_t size); - -ngx_int_t ngx_http_set_misc_quote_sql_str(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_quote_pgsql_str(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_SET_QUOTE_SQL_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.c deleted file mode 100644 index c223633..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.c +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include -#include "ngx_http_set_random.h" -#include - - -ngx_int_t -ngx_http_set_misc_set_random(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_http_variable_value_t *rand_from, *rand_to; - ngx_int_t int_from, int_to, tmp, random; - - rand_from = v; - rand_to = v + 1; - - int_from = ngx_atoi(rand_from->data, rand_from->len); - if (int_from == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_random: bad \"from\" argument: %v", rand_from); - return NGX_ERROR; - } - - int_to = ngx_atoi(rand_to->data, rand_to->len); - if (int_to == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_random: bad \"to\" argument: %v", rand_to); - return NGX_ERROR; - } - - if (int_from > int_to) { - tmp = int_from; - int_from = int_to; - int_to = tmp; - } - - random = rand() % (int_to - int_from + 1) + int_from; - - res->data = ngx_palloc(r->pool, NGX_INT_T_LEN); - if (res->data == NULL) { - return NGX_ERROR; - } - - res->len = ngx_sprintf(res->data, "%i", random) - res->data; - - /* Set all required params */ - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.h deleted file mode 100644 index 88cffdc..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef NGX_SET_RANDOM_H -#define NGX_SET_RANDOM_H - -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_random(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -#endif /* NGX_SET_RANDOM_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.c deleted file mode 100644 index b83dee7..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.c +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_rotate.h" -#include "ngx_http_set_misc_module.h" -#include - - -ngx_int_t -ngx_http_set_misc_set_rotate(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_http_variable_value_t *rotate_from, *rotate_to, *rotate_num; - ngx_int_t int_from, int_to, tmp, int_current; - - ngx_http_set_misc_loc_conf_t *conf; - - rotate_num = &v[0]; - rotate_from = &v[1]; - rotate_to = &v[2]; - - int_from = ngx_atoi(rotate_from->data, rotate_from->len); - if (int_from == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_rotate: bad \"from\" argument value: \"%v\"", - rotate_from); - return NGX_ERROR; - } - - int_to = ngx_atoi(rotate_to->data, rotate_to->len); - if (int_to == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_rotate: bad \"to\" argument value: \"%v\"", - rotate_to); - return NGX_ERROR; - } - - if (int_from > int_to) { - tmp = int_from; - int_from = int_to; - int_to = tmp; - } - - conf = ngx_http_get_module_loc_conf(r, ngx_http_set_misc_module); - - dd("current value not found: %d", (int) rotate_num->not_found); - - if (rotate_num->len == 0) { - if (conf->current != NGX_CONF_UNSET) { - int_current = conf->current; - - } else { - int_current = int_from - 1; - } - - } else { - - int_current = ngx_atoi(rotate_num->data, rotate_num->len); - if (int_current == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_rotate: bad current value: \"%v\"", rotate_num); - - if (conf->current != NGX_CONF_UNSET) { - int_current = conf->current; - - } else { - int_current = int_from - 1; - } - } - } - - int_current++; - - if (int_current > int_to || int_current < int_from) { - int_current = int_from; - } - - conf->current = int_current; - - res->data = ngx_palloc(r->pool, NGX_INT_T_LEN); - if (res->data == NULL) { - return NGX_ERROR; - } - - res->len = ngx_sprintf(res->data, "%i", int_current) - res->data; - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -char * -ngx_http_set_rotate(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t filter; - - value = cf->args->elts; - - filter.type = NDK_SET_VAR_MULTI_VALUE; - filter.func = (void *) ngx_http_set_misc_set_rotate; - filter.size = 3; - filter.data = NULL; - - return ndk_set_var_multi_value_core(cf, &value[1], &value[1], &filter); -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.h deleted file mode 100644 index 429204c..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef NGX_HTTP_SET_MISC_ROTATE_H -#define NGX_HTTP_SET_MISC_ROTATE_H - - -#include -#include -#include - - -char *ngx_http_set_rotate(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - -ngx_int_t ngx_http_set_misc_set_rotate(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_MISC_ROTATE_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.c deleted file mode 100644 index a07efe8..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.c +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include -#include "ngx_http_set_secure_random.h" -#include - - -enum { - MAX_RANDOM_STRING = 64, - ALPHANUM = 1, - LCALPHA = 2 -}; - - -static ngx_int_t -ngx_http_set_misc_set_secure_random_common(int alphabet_type, - ngx_http_request_t *r, ngx_str_t *res, ngx_http_variable_value_t *v); - - -ngx_int_t -ngx_http_set_misc_set_secure_random_alphanum(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v) -{ - return ngx_http_set_misc_set_secure_random_common(ALPHANUM, r, res, v); -} - - -ngx_int_t -ngx_http_set_misc_set_secure_random_lcalpha(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v) -{ - return ngx_http_set_misc_set_secure_random_common(LCALPHA, r, res, v); -} - - -static ngx_int_t -ngx_http_set_misc_set_secure_random_common(int alphabet_type, - ngx_http_request_t *r, ngx_str_t *res, ngx_http_variable_value_t *v) -{ - static u_char alphabet[] = "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - - u_char entropy[MAX_RANDOM_STRING]; - u_char output[MAX_RANDOM_STRING]; - ngx_int_t length, i; - ngx_fd_t fd; - ssize_t n; - - length = ngx_atoi(v->data, v->len); - - if (length == NGX_ERROR || length < 1 || length > MAX_RANDOM_STRING) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_random: bad \"length\" argument: %v", v); - return NGX_ERROR; - } - - fd = ngx_open_file((u_char *) "/dev/urandom", NGX_FILE_RDONLY, - NGX_FILE_OPEN, 0); - if (fd == NGX_INVALID_FILE) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_secure_random: could not open /dev/urandom"); - return NGX_ERROR; - } - - n = ngx_read_fd(fd, entropy, length); - if (n != length) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_secure_random: could not read all %i byte(s) from " - "/dev/urandom", length); - ngx_close_file(fd); - return NGX_ERROR; - } - - ngx_close_file(fd); - - for (i = 0; i < length; i++) { - if (alphabet_type == LCALPHA) { - output[i] = entropy[i] % 26 + 'a'; - - } else { - output[i] = alphabet[ entropy[i] % (sizeof alphabet - 1) ]; - } - } - - res->data = ngx_palloc(r->pool, length); - if (res->data == NULL) { - return NGX_ERROR; - } - - ngx_memcpy(res->data, output, length); - - res->len = length; - - /* set all required params */ - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.h deleted file mode 100644 index d65129e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef NGX_SET_SECURE_RANDOM_H -#define NGX_SET_SECURE_RANDOM_H - -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_secure_random_alphanum(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_secure_random_lcalpha(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -#endif /* NGX_SET_SECURE_RANDOM_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.c deleted file mode 100644 index 3ae1d0a..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.c +++ /dev/null @@ -1,184 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_unescape_uri.h" - -#define NGX_UNESCAPE_URI_COMPONENT 0 - - -static void ngx_unescape_uri_patched(u_char **dst, u_char **src, size_t size, - ngx_uint_t type); - - -ngx_int_t -ngx_http_set_misc_unescape_uri(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - u_char *src, *dst; - - /* the unescaped string can only be smaller */ - len = v->len; - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - src = v->data; dst = p; - - ngx_unescape_uri_patched(&dst, &src, v->len, NGX_UNESCAPE_URI_COMPONENT); - - if (src != v->data + v->len) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_unescape_uri: input data not consumed completely"); - return NGX_ERROR; - } - - res->data = p; - res->len = dst - p; - - return NGX_OK; -} - - -/* XXX we also decode '+' to ' ' */ -static void -ngx_unescape_uri_patched(u_char **dst, u_char **src, size_t size, - ngx_uint_t type) -{ - u_char *d, *s, ch, c, decoded; - enum { - sw_usual = 0, - sw_quoted, - sw_quoted_second - } state; - - d = *dst; - s = *src; - - state = 0; - decoded = 0; - - while (size--) { - - ch = *s++; - - switch (state) { - case sw_usual: - if (ch == '?' - && (type & (NGX_UNESCAPE_URI|NGX_UNESCAPE_REDIRECT))) - { - *d++ = ch; - goto done; - } - - if (ch == '%') { - state = sw_quoted; - break; - } - - if (ch == '+') { - *d++ = ' '; - break; - } - - *d++ = ch; - break; - - case sw_quoted: - - if (ch >= '0' && ch <= '9') { - decoded = (u_char) (ch - '0'); - state = sw_quoted_second; - break; - } - - c = (u_char) (ch | 0x20); - if (c >= 'a' && c <= 'f') { - decoded = (u_char) (c - 'a' + 10); - state = sw_quoted_second; - break; - } - - /* the invalid quoted character */ - - state = sw_usual; - - *d++ = ch; - - break; - - case sw_quoted_second: - - state = sw_usual; - - if (ch >= '0' && ch <= '9') { - ch = (u_char) ((decoded << 4) + ch - '0'); - - if (type & NGX_UNESCAPE_REDIRECT) { - if (ch > '%' && ch < 0x7f) { - *d++ = ch; - break; - } - - *d++ = '%'; *d++ = *(s - 2); *d++ = *(s - 1); - - break; - } - - *d++ = ch; - - break; - } - - c = (u_char) (ch | 0x20); - if (c >= 'a' && c <= 'f') { - ch = (u_char) ((decoded << 4) + c - 'a' + 10); - - if (type & NGX_UNESCAPE_URI) { - if (ch == '?') { - *d++ = ch; - goto done; - } - - *d++ = ch; - break; - } - - if (type & NGX_UNESCAPE_REDIRECT) { - if (ch == '?') { - *d++ = ch; - goto done; - } - - if (ch > '%' && ch < 0x7f) { - *d++ = ch; - break; - } - - *d++ = '%'; *d++ = *(s - 2); *d++ = *(s - 1); - break; - } - - *d++ = ch; - - break; - } - - /* the invalid quoted character */ - - break; - } - } - -done: - - *dst = d; - *src = s; -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.h deleted file mode 100644 index 59e9a93..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.h +++ /dev/null @@ -1,16 +0,0 @@ - -#ifndef NGX_HTTP_SET_UNESCAPE_URI -#define NGX_HTTP_SET_UNESCAPE_URI - - -#include -#include -#include - - -ngx_int_t ngx_http_set_misc_unescape_uri(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_UNESCAPE_URI */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32.t deleted file mode 100644 index 2efa731..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32.t +++ /dev/null @@ -1,556 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: base32 (5 bytes) ---- config - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -c5h66p35 -abcde - - - -=== TEST 2: base32 (1 byte) ---- config - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -44====== -! - - - -=== TEST 3: base32 (1 byte) - not in-place editing ---- config - location /bar { - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -44====== -! - - - -=== TEST 4: base32 (hello world) ---- config - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m6888ad1knio92 -"hello, world! -hiya" - - - -=== TEST 5: base32 (0 bytes left) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892 - - - -=== TEST 6: base32 (6 bytes padded) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c4====== - - - -=== TEST 7: base32 (4 bytes left) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h0==== - - - -=== TEST 8: base32 (3 bytes left) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h66=== - - - -=== TEST 9: base32 (1 bytes left) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h66p0= - - - -=== TEST 10: base32 standard alphabet (5 bytes) ---- config - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -MFRGGZDF -abcde - - - -=== TEST 11: base32 standard alphabet (1 byte) ---- config - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EE====== -! - - - -=== TEST 12: base32 standard alphabet (1 byte) - not in-place editing ---- config - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EE====== -! - - - -=== TEST 13: base32 standard alphabet (hello world) ---- config - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIIKNBUXSYJC -"hello, world! -hiya" - - - -=== TEST 14: base32 standard alphabet (0 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJC - - - -=== TEST 15: base32 standard alphabet (6 bytes padded) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCME====== - - - -=== TEST 16: base32 standard alphabet (4 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRA==== - - - -=== TEST 17: base32 standard alphabet (3 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRGG=== - - - -=== TEST 18: base32 standard alphabet (1 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRGGZA= - - - -=== TEST 19: base32 custom alphabet (5 bytes) ---- config - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -qjvkk3hj -abcde - - - -=== TEST 20: base32 custom alphabet (1 byte) ---- config - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -ii====== -! - - - -=== TEST 21: base32 custom alphabet (1 byte) - not in-place editing ---- config - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -ii====== -! - - - -=== TEST 22: base32 custom alphabet (hello world) ---- config - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmmorfy1w2ng -"hello, world! -hiya" - - - -=== TEST 23: base32 custom alphabet (0 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmng - - - -=== TEST 24: base32 custom alphabet (6 bytes padded) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqi====== - - - -=== TEST 25: base32 custom alphabet (4 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjve==== - - - -=== TEST 26: base32 custom alphabet (3 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk=== - - - -=== TEST 27: base32 custom alphabet (1 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk3e= - - - -=== TEST 28: use set_base32_alphabet in location ---- config - set_base32_padding on; - location /bar { - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk3e= - - - -=== TEST 29: one byte less in set_base32_alphabet ---- config - set_base32_padding on; - location /bar { - set_base32_alphabet "efghijklmnopqrstuvwxyz012345678"; - set $a '"hello, world!"abcd?\/.;'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk3e= ---- must_die ---- error_log eval -qr/\[emerg\] .*? "set_base32_alphabet" directive takes an alphabet of 31 bytes but 32 expected/ - - - -=== TEST 30: one byte more in set_base32_alphabet ---- config - set_base32_padding on; - location /bar { - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789A"; - set $a '"hello, world!"abcd?\/.;'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk3e= ---- must_die ---- error_log eval -qr/\[emerg\] .*? "set_base32_alphabet" directive takes an alphabet of 33 bytes but 32 expected/ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32_no_padding.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32_no_padding.t deleted file mode 100644 index 9330cbf..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32_no_padding.t +++ /dev/null @@ -1,531 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: base32 (5 bytes) ---- config - set_base32_padding off; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -c5h66p35 -abcde - - - -=== TEST 2: base32 (1 byte) ---- config - set_base32_padding off; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -44 -! - - - -=== TEST 3: base32 (1 byte) - not in-place editing ---- config - location /bar { - set_base32_padding off; - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -44 -! - - - -=== TEST 4: base32 (hello world) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m6888ad1knio92 -"hello, world! -hiya" - - - -=== TEST 5: base32 (0 bytes left) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892 - - - -=== TEST 6: base32 (6 bytes padded) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c4 - - - -=== TEST 7: base32 (4 bytes left) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h0 - - - -=== TEST 8: base32 (3 bytes left) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h66 - - - -=== TEST 9: base32 (1 bytes left) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h66p0 - - - -=== TEST 10: base32 standard alphabet (5 bytes) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -MFRGGZDF -abcde - - - -=== TEST 11: base32 standard alphabet (1 byte) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EE -! - - - -=== TEST 12: base32 standard alphabet (1 byte) - not in-place editing ---- config - location /bar { - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EE -! - - - -=== TEST 13: base32 standard alphabet (hello world) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIIKNBUXSYJC -"hello, world! -hiya" - - - -=== TEST 14: base32 standard alphabet (0 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJC - - - -=== TEST 15: base32 standard alphabet (6 bytes padded) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCME - - - -=== TEST 16: base32 standard alphabet (4 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRA - - - -=== TEST 17: base32 standard alphabet (3 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRGG - - - -=== TEST 18: base32 standard alphabet (1 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRGGZA - - - -=== TEST 19: base32 custom alphabet (5 bytes) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -ohtii2fh -abcde - - - -=== TEST 20: base32 custom alphabet (1 byte) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -gg -! - - - -=== TEST 21: base32 custom alphabet (1 byte) - not in-place editing ---- config - location /bar { - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -gg -! - - - -=== TEST 22: base32 custom alphabet (hello world) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkkmpdwzu1le -"hello, world! -hiya" - - - -=== TEST 23: base32 custom alphabet (0 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkle - - - -=== TEST 24: base32 custom alphabet (6 bytes padded) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkleog - - - -=== TEST 25: base32 custom alphabet (4 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkleohtc - - - -=== TEST 26: base32 custom alphabet (3 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkleohtii - - - -=== TEST 27: base32 custom alphabet (1 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkleohtii2c - - - -=== TEST 28: deprecated set_misc_base32_padding ---- config - set_misc_base32_padding off; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -c5h66p35 -abcde diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64.t deleted file mode 100644 index 5dd5af8..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64.t +++ /dev/null @@ -1,40 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: base64 encode ---- config - location /bar { - set_encode_base64 $out "abcde"; - echo $out; - } ---- request - GET /bar ---- response_body -YWJjZGU= - - - -=== TEST 2: base64 decode ---- config - location /bar { - set_decode_base64 $out "YWJjZGU="; - echo $out; - } ---- request - GET /bar ---- response_body -abcde diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64url.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64url.t deleted file mode 100644 index fc71d59..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64url.t +++ /dev/null @@ -1,40 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: base64url encode ---- config - location /bar { - set_encode_base64url $out "?b> repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set if empty ---- config - location /foo { - set $a 32; - set_if_empty $a 56; - echo $a; - - set_if_empty $b 72; - echo $b; - } ---- request -GET /foo ---- response_body -32 -72 - - - -=== TEST 2: set if empty ---- config - location /foo { - set $bar $arg_bar; - set_if_empty $bar 15; - echo $bar; - - set $bah $arg_bah; - set_if_empty $bah 25; - echo $bah; - } ---- request -GET /foo?bar=71 ---- response_body -71 -25 - - - -=== TEST 3: set if empty ---- config - location /foo { - set $bar $arg_bar; - set_if_empty $bar 15; - echo $bar; - - set $bah $arg_bah; - set_if_empty $bah 25; - echo $bah; - } ---- request -GET /foo?bar= ---- response_body -15 -25 - - - -=== TEST 4: set if empty (using arg_xxx directly) -buggy? ---- config - location /foo { - set_if_empty $arg_bar 15; - echo $arg_bar; - - set_if_empty $arg_bah 25; - echo $arg_bah; - } ---- request -GET /foo?bar=71 ---- response_body -71 -25 diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/escape-uri.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/escape-uri.t deleted file mode 100644 index 7cbd067..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/escape-uri.t +++ /dev/null @@ -1,139 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); -#no_diff(); - -run_tests(); - -__DATA__ - -=== TEST 1: set escape uri ---- config - location /foo { - set $foo "hello world"; - set_escape_uri $foo $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -hello%20world - - - -=== TEST 2: set escape uri(in-place) ---- config - location /foo { - set $foo "hello world"; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -hello%20world - - - -=== TEST 3: blank string ---- config - location /foo { - set $foo ""; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body eval -"\n" - - - -=== TEST 4: blank string(in place) ---- config - location /foo { - set $foo ""; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body eval -"\n" - - - -=== TEST 5: eacape chinese character ---- config - location /foo { - set $foo "你好"; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -%E4%BD%A0%E5%A5%BD - - - -=== TEST 6: escape long string ---- config - location /foo { - set $foo "法规及饿哦物权法家哦低价非结果哦我二期界 附件饿哦武器 积分饿哦为契机佛i 该软件哦气氛 份额叫我起 国无二君哦气氛为界非ieowq结果哦而完全附件 份额叫我iqfjeowiqgjeriowqfjpdjfosadijfoiasdjf 附件饿哦武器界 份额叫我起界份额叫我起哦ifjefejwioq附件饿哦武器界非风格及去哦根据份额叫我起哦界份额为契机哦乳房阿基完全哦igqtewqo个人就去哦ieorjwrewqoi日哦额外起今天诶哦我亲热为特务前日哦我而哥特完全哦iijrtewmkdf 服务鄂潜江哦irewq"; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -%E6%B3%95%E8%A7%84%E5%8F%8A%E9%A5%BF%E5%93%A6%E7%89%A9%E6%9D%83%E6%B3%95%E5%AE%B6%E5%93%A6%E4%BD%8E%E4%BB%B7%E9%9D%9E%E7%BB%93%E6%9E%9C%E5%93%A6%E6%88%91%E4%BA%8C%E6%9C%9F%E7%95%8C%20%20%E9%99%84%E4%BB%B6%E9%A5%BF%E5%93%A6%E6%AD%A6%E5%99%A8%20%20%E7%A7%AF%E5%88%86%E9%A5%BF%E5%93%A6%E4%B8%BA%E5%A5%91%E6%9C%BA%E4%BD%9Bi%20%E8%AF%A5%E8%BD%AF%E4%BB%B6%E5%93%A6%E6%B0%94%E6%B0%9B%20%20%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91%E8%B5%B7%20%E5%9B%BD%E6%97%A0%E4%BA%8C%E5%90%9B%E5%93%A6%E6%B0%94%E6%B0%9B%E4%B8%BA%E7%95%8C%E9%9D%9Eieowq%E7%BB%93%E6%9E%9C%E5%93%A6%E8%80%8C%E5%AE%8C%E5%85%A8%E9%99%84%E4%BB%B6%20%20%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91iqfjeowiqgjeriowqfjpdjfosadijfoiasdjf%20%E9%99%84%E4%BB%B6%E9%A5%BF%E5%93%A6%E6%AD%A6%E5%99%A8%E7%95%8C%20%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91%E8%B5%B7%E7%95%8C%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91%E8%B5%B7%E5%93%A6ifjefejwioq%E9%99%84%E4%BB%B6%E9%A5%BF%E5%93%A6%E6%AD%A6%E5%99%A8%E7%95%8C%E9%9D%9E%E9%A3%8E%E6%A0%BC%E5%8F%8A%E5%8E%BB%E5%93%A6%E6%A0%B9%E6%8D%AE%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91%E8%B5%B7%E5%93%A6%E7%95%8C%E4%BB%BD%E9%A2%9D%E4%B8%BA%E5%A5%91%E6%9C%BA%E5%93%A6%E4%B9%B3%E6%88%BF%E9%98%BF%E5%9F%BA%E5%AE%8C%E5%85%A8%E5%93%A6igqtewqo%E4%B8%AA%E4%BA%BA%E5%B0%B1%E5%8E%BB%E5%93%A6ieorjwrewqoi%E6%97%A5%E5%93%A6%E9%A2%9D%E5%A4%96%E8%B5%B7%E4%BB%8A%E5%A4%A9%E8%AF%B6%E5%93%A6%E6%88%91%E4%BA%B2%E7%83%AD%E4%B8%BA%E7%89%B9%E5%8A%A1%E5%89%8D%E6%97%A5%E5%93%A6%E6%88%91%E8%80%8C%E5%93%A5%E7%89%B9%E5%AE%8C%E5%85%A8%E5%93%A6iijrtewmkdf%20%E6%9C%8D%E5%8A%A1%E9%84%82%E6%BD%9C%E6%B1%9F%E5%93%A6irewq - - - -=== TEST 7: no need to escape ---- config - location /foo { - set $foo 'welcometotheworldofnginx'; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -welcometotheworldofnginx - - - -=== TEST 8: fixed ngx_escape_uri issues: + and / should also be escaped ---- config - location /foo { - set $foo '+/='; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -%2B%2F%3D - - - -=== TEST 9: fixed ngx_escape_uri issues: / {} : & [] and more ---- config - location /foo { - set $foo '"a/b={}:<>;&[]\\^'; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -%22a%2Fb%3D%7B%7D%3A%3C%3E%3B%26%5B%5D%5C%5E diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/formatted-time.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/formatted-time.t deleted file mode 100644 index 9b0fc73..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/formatted-time.t +++ /dev/null @@ -1,84 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; -use POSIX qw(strftime); - -my $fmt="%a %b %e %H:%M:%S %Y"; - -our $str_local = (strftime $fmt, localtime time()).'|'.(strftime $fmt, localtime time()+1).'|'.(strftime $fmt, localtime time()+2); - -our $str_gmt = (strftime $fmt, gmtime time()).'|'.(strftime $fmt, gmtime time()+1).'|'.(strftime $fmt, gmtime time()+2); - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -log_level('warn'); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: local time format ---- config - location /foo { - set_formatted_local_time $today "%a %b %e %H:%M:%S %Y"; - echo $today; - } ---- request -GET /foo ---- response_body_like eval: $main::str_local - - - -=== TEST 2: GMT time format ---- config - location /bar { - set_formatted_gmt_time $today "%a %b %e %H:%M:%S %Y"; - echo $today; - } ---- request -GET /bar ---- response_body_like eval: $main::str_gmt - - - -=== TEST 3: set_formatted_gmt_time (empty formatter) ---- config - location /bar { - set_formatted_gmt_time $today ""; - echo "[$today]"; - } ---- request -GET /bar ---- response_body -[] - - - -=== TEST 4: set_formatted_local_time (empty formatter) ---- config - location /bar { - set_formatted_local_time $today ""; - echo "[$today]"; - } ---- request -GET /bar ---- response_body -[] - - - -=== TEST 5: set_formatted_local_time (constant formatter) ---- config - location /bar { - set_formatted_local_time $today "hello world"; - echo "[$today]"; - } ---- request -GET /bar ---- response_body -[hello world] diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hash.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/hash.t deleted file mode 100644 index a9c884b..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hash.t +++ /dev/null @@ -1,94 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: sha1 hello (copy) ---- config - location /sha1 { - set_sha1 $a hello; - echo $a; - } ---- request -GET /sha1 ---- response_body -aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d - - - -=== TEST 2: sha1 hello (in-place) ---- config - location /sha1 { - set $a hello; - set_sha1 $a; - echo $a; - } ---- request -GET /sha1 ---- response_body -aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d - - - -=== TEST 3: sha1 (empty) ---- config - location /sha1 { - set_sha1 $a ""; - echo $a; - } ---- request -GET /sha1 ---- response_body -da39a3ee5e6b4b0d3255bfef95601890afd80709 - - - -=== TEST 4: md5 hello (copy) ---- config - location /md5 { - set_md5 $a hello; - echo $a; - } ---- request -GET /md5 ---- response_body -5d41402abc4b2a76b9719d911017c592 - - - -=== TEST 5: md5 hello (in-place) ---- config - location /md5 { - set $a hello; - set_md5 $a; - echo $a; - } ---- request -GET /md5 ---- response_body -5d41402abc4b2a76b9719d911017c592 - - - -=== TEST 6: md5 (empty) ---- config - location /md5 { - set_md5 $a ""; - echo $a; - } ---- request -GET /md5 ---- response_body -d41d8cd98f00b204e9800998ecf8427e diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hashed-upstream.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/hashed-upstream.t deleted file mode 100644 index fdebd15..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hashed-upstream.t +++ /dev/null @@ -1,70 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -#master_on(); -#log_level("warn"); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set hashed upstream -buggy? ---- config - upstream_list universe moon sun earth; - location /foo { - set_hashed_upstream $backend universe $arg_id; - echo $backend; - } - location /main { - echo_location_async /foo; - echo_location_async /foo?id=hello; - echo_location_async /foo?id=world; - echo_location_async /foo?id=larry; - echo_location_async /foo?id=audreyt; - } ---- request -GET /main ---- response_body -moon -sun -moon -earth -earth - - - -=== TEST 2: set hashed upstream (use var for upstream_list name) -buggy? ---- config - upstream_list universe moon sun earth; - location /foo { - set $list_name universe; - set_hashed_upstream $backend $list_name $arg_id; - echo $backend; - } - location /main { - echo_location_async /foo; - echo_location_async /foo?id=hello; - echo_location_async /foo?id=world; - echo_location_async /foo?id=larry; - echo_location_async /foo?id=audreyt; - } ---- request -GET /main ---- response_body -moon -sun -moon -earth -earth diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hex.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/hex.t deleted file mode 100644 index ae28105..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hex.t +++ /dev/null @@ -1,57 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: hex encode ---- config - location /bar { - set_encode_hex $out "abcde"; - echo $out; - } ---- request - GET /bar ---- response_body -6162636465 - - - -=== TEST 2: hex decode ---- config - location /bar { - set_decode_hex $out "6162636465"; - echo $out; - } ---- request - GET /bar ---- response_body -abcde - - - -=== TEST 3: hex encode (chinese) ---- config - location /bar { - set $raw "章亦春"; - set_encode_hex $digest $raw; - set_decode_hex $hex $digest; - echo $digest; - echo $hex; - } ---- request - GET /bar ---- response_body -e7aba0e4baa6e698a5 -章亦春 diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hmac.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/hmac.t deleted file mode 100644 index 5353eca..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hmac.t +++ /dev/null @@ -1,78 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: hmac_sha1 ---- config - location /bar { - set $secret 'thisisverysecretstuff'; - set $string_to_sign 'some string we want to sign'; - set_hmac_sha1 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } ---- request - GET /bar ---- response_body -R/pvxzHC4NLtj7S+kXFg/NePTmk= - - - -=== TEST 2: hmac_sha1 empty vars ---- config - location /bar { - set $secret ''; - set $string_to_sign ''; - set_hmac_sha1 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } ---- request - GET /bar ---- response_body -+9sdGxiqbAgyS31ktx+3Y3BpDh0= - - - -=== TEST 3: hmac_sha256 ---- config - location /bar { - set $secret 'thisisverysecretstuff'; - set $string_to_sign 'some string we want to sign'; - set_hmac_sha256 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } ---- request - GET /bar ---- response_body -4pU3GRQrKKIoeLb9CqYsavHE2l6Hx+KMmRmesU+Cfrs= - - - -=== TEST 4: hmac_sha256 empty vars ---- config - location /bar { - set $secret ''; - set $string_to_sign ''; - set_hmac_sha256 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } ---- request - GET /bar ---- response_body -thNnmggU2ex3L5XXeMNfxf8Wl8STcVZTxscSFEKSxa0= diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/local-today.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/local-today.t deleted file mode 100644 index 7de0968..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/local-today.t +++ /dev/null @@ -1,29 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -my ($sec, $min, $hour, $mday, $mon, $year) = localtime; - -our $str = sprintf("%04d-%02d-%02d\n", $year + 1900, $mon + 1, $mday); -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -#no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /foo { - set_local_today $today; - echo $today; - } ---- request -GET /foo ---- response_body eval: $main::str diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-json.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-json.t deleted file mode 100644 index 8e15def..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-json.t +++ /dev/null @@ -1,69 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set quote json value ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_json_str $foo $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -"hello\n\r'\"\\" - - - -=== TEST 2: set quote json value (in place) ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_json_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -"hello\n\r'\"\\" - - - -=== TEST 3: set quote empty json value ---- config - location /foo { - set $foo ""; - set_quote_json_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -null - - - -=== TEST 4: set quote null json value ---- config - location /foo { - set_quote_json_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -null diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-sql.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-sql.t deleted file mode 100644 index bd81a87..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-sql.t +++ /dev/null @@ -1,195 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set quote sql value ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'hello\n\r\'\"\\' - - - -=== TEST 2: set quote sql value (in place) ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_sql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'hello\n\r\'\"\\' - - - -=== TEST 3: set quote empty sql value ---- config - location /foo { - set $foo ""; - set_quote_sql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'' - - - -=== TEST 4: set quote null sql value ---- config - location /foo { - set_quote_sql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'' - - - -=== TEST 5: set quote null pgsql value ---- config - location /foo { - set_quote_pgsql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'' - - - -=== TEST 6: set quote pgsql value ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_pgsql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -E'hello\n\r\'\"\\' - - - -=== TEST 7: set quote pgsql valid utf8 value ---- config - location /foo { - set $foo "你好"; - set_quote_pgsql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -E'你好' - - - -=== TEST 8: set quote pgsql invalid utf8 value ---- config - location /foo { - set $foo "你好"; - set_iconv $foo $foo from=utf-8 to=gbk; - set_quote_pgsql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -E'\\304\\343\\272\\303' - - - -=== TEST 9: \0 for mysql ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=a%00b%00 ---- response_body -'a\0b\0' - - - -=== TEST 10: \b for mysql ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=a%08b%08 ---- response_body -'a\bb\b' - - - -=== TEST 11: \t for mysql ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=a%09b%09 ---- response_body -'a\tb\t' - - - -=== TEST 12: \Z for mysql ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=a%1ab%1a ---- response_body -'a\Zb\Z' - - - -=== TEST 13: set quote sql value ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=$$ ---- response_body -'\$\$' diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/rand.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/rand.t deleted file mode 100644 index 7f042bb..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/rand.t +++ /dev/null @@ -1,168 +0,0 @@ -# vi:filetype=perl - -use Test::Nginx::Socket; - -repeat_each(100); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /rand { - set $from 5; - set $to 7; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: [5-7] - - - -=== TEST 2: sanity (two digits) ---- config - location /rand { - set $from 35; - set $to 37; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 3[5-7] - - - -=== TEST 3: sanity (two digits, from > to) ---- config - location /rand { - set $from 37; - set $to 35; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 3[5-7] - - - -=== TEST 4: sanity (two digits, from == to) ---- config - location /rand { - set $from 117; - set $to 117; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body -117 - - - -=== TEST 5: negative number not allowed in from arg ---- config - location /rand { - set $from -2; - set $to 4; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 6: negative number not allowed in to arg ---- config - location /rand { - set $from 2; - set $to -4; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 7: empty string not allowed in from arg ---- config - location /rand { - set $from ''; - set $to 4; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 8: empty string not allowed in to arg ---- config - location /rand { - set $from 2; - set $to ''; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 9: wrong number of arguments ---- config - location /rand { - set $from 2; - set_random $res $from; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 ---- SKIP - - - -=== TEST 10: zero is fine ---- config - location /rand { - set_random $res 0 0; - - echo $res; - } ---- request - GET /rand ---- response_body -0 diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/rotate.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/rotate.t deleted file mode 100644 index 2982a71..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/rotate.t +++ /dev/null @@ -1,270 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (3 * blocks()); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /bar { - set $a 1; - set_rotate $a 1 3; - - set $b 2; - set_rotate $b 1 3; - - set $c 3; - set_rotate $c 1 3; - - set $d 0; - set_rotate $d 1 3; - - set $e 1; - set_rotate $e 3 5; - - echo "a = $a"; - echo "b = $b"; - echo "c = $c"; - echo "d = $d"; - echo "e = $e"; - } ---- request - GET /bar ---- response_body -a = 2 -b = 3 -c = 1 -d = 1 -e = 3 ---- no_error_log -[error] - - - -=== TEST 2: bad current value ---- config - location /bar { - set $a abc; - set_rotate $a 1 3; - - echo "a = $a"; - } ---- request - GET /bar ---- response_body_like: ^a = [12]$ ---- error_log -set_rotate: bad current value: "abc" - - - -=== TEST 3: bad "from" value ---- config - location /bar { - set $a 2; - set_rotate $a abc 3; - - echo "a = $a"; - } ---- request - GET /bar ---- response_body_like: 500 Internal Server Error ---- error_code: 500 ---- error_log -set_rotate: bad "from" argument value: "abc" - - - -=== TEST 4: bad "to" argument value ---- config - location /bar { - set $a 2; - set_rotate $a 1 abc; - - echo "a = $a"; - } ---- request - GET /bar ---- response_body_like: 500 Internal Server Error ---- error_code: 500 ---- error_log -set_rotate: bad "to" argument value: "abc" - - - -=== TEST 5: when no current value is given ---- config - location /incr { - set_rotate $a 1 3; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - } ---- request - GET /t ---- response_body -a = 1 -a = 2 -a = 3 -a = 1 -a = 2 -a = 3 ---- no_error_log -[error] - - - -=== TEST 6: when no current value is given (starting from 0) ---- config - location /incr { - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - } ---- request - GET /t ---- response_body -a = 0 -a = 1 -a = 2 -a = 0 -a = 1 -a = 2 ---- no_error_log -[error] - - - -=== TEST 7: when a non-integer string value is given ---- config - location /incr { - set $a "hello"; - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - } ---- request - GET /t ---- response_body -a = 0 -a = 1 -a = 2 -a = 0 -a = 1 -a = 2 ---- error_log -set_rotate: bad current value: "hello" - - - -=== TEST 8: when an empty string value is given ---- config - location /incr { - set $a ""; - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - } ---- request - GET /t ---- response_body -a = 0 -a = 1 -a = 2 -a = 0 -a = 1 -a = 2 ---- no_error_log -[error] - - - -=== TEST 9: value persistence is per-location ---- config - location /incr { - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /incr2 { - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - } ---- request - GET /t ---- response_body -a = 0 -a = 0 -a = 1 -a = 1 -a = 2 -a = 2 -a = 0 -a = 0 -a = 1 -a = 1 -a = 2 -a = 2 ---- no_error_log -[error] diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/secure-random.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/secure-random.t deleted file mode 100644 index 1f0b4a3..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/secure-random.t +++ /dev/null @@ -1,107 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: a 32-character alphanum ---- config - location /alphanum { - set_secure_random_alphanum $res 32; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: ^[a-zA-Z0-9]{32}$ - - - -=== TEST 2: a 16-character alphanum ---- config - location /alphanum { - set_secure_random_alphanum $res 16; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: ^[a-zA-Z0-9]{16}$ - - - -=== TEST 3: a 1-character alphanum ---- config - location /alphanum { - set_secure_random_alphanum $res 1; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: ^[a-zA-Z0-9]{1}$ - - - -=== TEST 4: length less than <= 0 should fail ---- config - location /alphanum { - set_secure_random_alphanum $res 0; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 5: length less than <= 0 should fail ---- config - location /alphanum { - set_secure_random_alphanum $res -4; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 6: non-numeric length should fail ---- config - location /alphanum { - set_secure_random_alphanum $res bob; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 7: a 16-character lcalpha ---- config - location /lcalpha { - set_secure_random_lcalpha $res 16; - - echo $res; - } ---- request - GET /lcalpha ---- response_body_like: ^[a-z]{16}$ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/unescape-uri.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/unescape-uri.t deleted file mode 100644 index ad52b59..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/unescape-uri.t +++ /dev/null @@ -1,58 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set unescape uri -buggy? ---- config - location /foo { - set $foo "hello%20world"; - set_unescape_uri $foo $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -hello world - - - -=== TEST 2: set unescape uri (in-place) -buggy? ---- config - location /foo { - set $foo "hello%20world"; - set_unescape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -hello world - - - -=== TEST 3: unescape '+' to ' ' ---- config - location /bar { - set $a 'a+b'; - set_unescape_uri $a; - echo $a; - } ---- request - GET /bar ---- response_body -a b diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/util/build.sh b/modules_deb/libnginx-mod-http-set-misc-0.33/util/build.sh deleted file mode 100755 index dc2bcb6..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/util/build.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# this file is mostly meant to be used by the author himself. - -root=`pwd` -home=~ -version=$1 -force=$2 - - #--with-cc="gcc46" \ - #--with-ld-opt="-rdynamic" \ - #--with-mail \ - #--with-mail_ssl_module \ - -ngx-build $force $version \ - --with-cc-opt="-I$PCRE_INC -I$OPENSSL_INC" \ - --with-ld-opt="-L$PCRE_LIB -L$OPENSSL_LIB -Wl,-rpath,$PCRE_LIB:$OPENSSL_LIB" \ - --with-http_ssl_module \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --without-http_upstream_ip_hash_module \ - --without-http_empty_gif_module \ - --without-http_memcached_module \ - --without-http_referer_module \ - --without-http_autoindex_module \ - --without-http_auth_basic_module \ - --without-http_userid_module \ - --add-module=$root/../echo-nginx-module \ - --add-module=$root/../ndk-nginx-module \ - --add-module=$root/../iconv-nginx-module \ - --add-module=$root $opts \ - --with-debug \ - || exit 1 - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/valgrind.suppress b/modules_deb/libnginx-mod-http-set-misc-0.33/valgrind.suppress deleted file mode 100644 index 470978e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/valgrind.suppress +++ /dev/null @@ -1,105 +0,0 @@ -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_create_pool - fun:ngx_http_init_request -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_create_pool - fun:ngx_event_accept -} -{ - - Memcheck:Addr4 - fun:ngx_init_cycle - fun:ngx_master_process_cycle - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_calloc - fun:ngx_event_process_init -} -{ - - exp-sgcheck:SorG - fun:ngx_http_variables_init_vars - fun:ngx_http_block -} -{ - - exp-sgcheck:SorG - fun:ngx_conf_parse -} -{ - - exp-sgcheck:SorG - fun:ngx_vslprintf - fun:ngx_log_error_core -} -{ - - exp-sgcheck:SorG - fun:ngx_conf_parse - fun:ngx_http_core_location -} -{ - nginx-core-process-init - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - nginx-core-crc32-init - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_crc32_table_init - fun:main -} -{ - libc-2.12.so - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl -} -{ - - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_worker_process_init - fun:ngx_worker_process_cycle -} diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitattributes b/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitignore b/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitignore deleted file mode 100644 index 5e0cb97..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitignore +++ /dev/null @@ -1,79 +0,0 @@ -*.mobi -genmobi.sh -.libs -*.swp -*.slo -*.la -*.swo -*.lo -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[78] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -src/handler.h -src/util.c -src/module.h -src/module.c -src/drizzle.c -src/processor.h -src/handler.c -src/util.h -src/drizzle.h -src/processor.c -src/output.c -src/output.h -libdrizzle -ctags -src/stream.h -nginx -keepalive -reindex -src/keepalive.c -src/keepalive.h -src/checker.h -src/checker.c -src/quoting.h -src/quoting.c -src/module.h -src/module.c -src/util.h -src/util.c -src/processor.h -src/processor.c -src/rds.h -src/utils.h -src/handler.c -src/handler.h -src/var.[ch] -util/bench -*.html -trace.out* -try.sh -build9 -src/fetch.[ch] -src/store.[ch] -t/servroot/ -headers.[ch] -buildroot/ -build1[0-9] -go -all -analyze -addr2line -*.plist -Makefile diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.travis.yml b/modules_deb/libnginx-mod-http-srcache-filter-0.33/.travis.yml deleted file mode 100644 index 600cf7d..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.travis.yml +++ /dev/null @@ -1,87 +0,0 @@ -sudo: required -dist: bionic - -os: linux - -language: c - -cache: - directories: - - download-cache - -compiler: - - gcc - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LUA_INCLUDE_DIR=$LUAJIT_INC - - LUA_CMODULE_DIR=/lib - - JOBS=3 - - NGX_BUILD_JOBS=$JOBS - matrix: - - NGINX_VERSION=1.17.8 - - NGINX_VERSION=1.19.9 - - NGINX_VERSION=1.23.0 - -services: - - memcache - - redis-server - - postgresql - - mysql - -before_install: - - sudo apt-get install -qq -y axel cpanminus libtest-base-perl libtext-diff-perl liburi-perl libwww-perl libtest-longstring-perl liblist-moreutils-perl > build.log 2>&1 || (cat build.log && exit 1) - -install: - - echo $HOME - - if [ ! -d download-cache ]; then mkdir download-cache; fi - - if [ ! -f download-cache/ngx_http_redis-0.3.7.tar.gz ]; then wget -O download-cache/ngx_http_redis-0.3.7.tar.gz http://people.freebsd.org/~osa/ngx_http_redis-0.3.7.tar.gz; fi - - if [ ! -f download-cache/drizzle7-2011.07.21.tar.gz ]; then wget -O download-cache/drizzle7-2011.07.21.tar.gz http://openresty.org/download/drizzle7-2011.07.21.tar.gz; fi - - mkdir -p ~/work/nginx && cp download-cache/ngx_http_redis-0.3.7.tar.gz ~/work/nginx/ - - git clone https://github.com/openresty/nginx-devel-utils.git - - git clone https://github.com/openresty/openresty.git ../openresty - - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module - - git clone https://github.com/openresty/test-nginx.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/nginx-eval-module.git ../eval-nginx-module - - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - - git clone https://github.com/openresty/set-misc-nginx-module.git ../set-misc-nginx-module - - git clone https://github.com/openresty/xss-nginx-module.git ../xss-nginx-module - - git clone https://github.com/openresty/redis2-nginx-module.git ../redis2-nginx-module - - git clone https://github.com/openresty/headers-more-nginx-module.git ../headers-more-nginx-module - - git clone https://github.com/openresty/rds-json-nginx-module.git ../rds-json-nginx-module - - git clone https://github.com/openresty/drizzle-nginx-module.git ../drizzle-nginx-module - - git clone https://github.com/openresty/memc-nginx-module.git ../memc-nginx-module - - git clone https://github.com/openresty/ngx_postgres.git ../postgres-nginx-module - - git clone https://github.com/openresty/openresty.git ../ngx_openresty - -before_script: - - mysql -uroot -e 'create database ngx_test; grant all on ngx_test.* to "ngx_test"@"%" identified by "ngx_test"; flush privileges;' - - psql -c "create database ngx_test;" -U postgres - - psql -c "create user ngx_test with password 'ngx_test';" -U postgres - - psql -c "grant all privileges on database ngx_test to ngx_test;" -U postgres - -script: - - tar xzf download-cache/drizzle7-2011.07.21.tar.gz && cd drizzle7-2011.07.21 - - ./configure --prefix=/usr --without-server > build.log 2>&1 || (cat build.log && exit 1) - - sudo PATH=$PATH make libdrizzle-1.0 install-libdrizzle-1.0 > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - - cd luajit2 - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - - cd test-nginx && sudo cpanm . && cd .. - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH - - export NGX_BUILD_CC=$CC - - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - - nginx -V - - ldd `which nginx`|grep luajit - - prove -I. -r t diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/Changes b/modules_deb/libnginx-mod-http-srcache-filter-0.33/Changes deleted file mode 100644 index 5f257fe..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/Changes +++ /dev/null @@ -1,16 +0,0 @@ -v0.12 - 11 July 2011 -* now we properly support fetch/store subrequests with internal redirection in them. main requests with internal redirection will still not be stored into the cache if there is a cache miss. thanks Liseen Wan for reporting it. -* fixed spots that trigger the unused-but-set-variable warning by gcc 4.6. -* added srcache_store_skip and srcache_fetch_skip directives to skip cache fetching or storing based on variables that are set and not empty nor 0. thanks Andre. Examples of using Lua to set $nocache to avoid storing URIs that contain /tmp: - set_by_lua $nocache ' - if string.match(ngx.var.request_uri, "/tmp") then - return "true" - else - return "" - end'; - - srcache_store_skip $nocache; -* added new directive srcache_store_max_size. thanks Andre. -* made our filter optimization work with nginx HUP by clearing the ngx_http_srcache_used flag at nginx pre-config callback. thanks Marcus Clyne. -* now we skip NULL chains in our output filters and also removed the SUBREQUEST_IN_MEMORY flag for our srcache_store subrequests because it will cause mysterious hanging issues when memcached returns CLIENT_ERROR for "get". - diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/README.markdown b/modules_deb/libnginx-mod-http-srcache-filter-0.33/README.markdown deleted file mode 100644 index e880b9c..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/README.markdown +++ /dev/null @@ -1,1258 +0,0 @@ -Name -==== - -**ngx_srcache** - Transparent subrequest-based caching layout for arbitrary nginx locations - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Name](#name) -* [Status](#status) -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) - * [Subrequest caching](#subrequest-caching) - * [Distributed Memcached Caching](#distributed-memcached-caching) - * [Caching with Redis](#caching-with-redis) - * [Cache Key Preprocessing](#cache-key-preprocessing) -* [Directives](#directives) - * [srcache_fetch](#srcache_fetch) - * [srcache_fetch_skip](#srcache_fetch_skip) - * [srcache_store](#srcache_store) - * [srcache_store_max_size](#srcache_store_max_size) - * [srcache_store_skip](#srcache_store_skip) - * [srcache_store_statuses](#srcache_store_statuses) - * [srcache_store_ranges](#srcache_store_ranges) - * [srcache_header_buffer_size](#srcache_header_buffer_size) - * [srcache_store_hide_header](#srcache_store_hide_header) - * [srcache_store_pass_header](#srcache_store_pass_header) - * [srcache_methods](#srcache_methods) - * [srcache_ignore_content_encoding](#srcache_ignore_content_encoding) - * [srcache_request_cache_control](#srcache_request_cache_control) - * [srcache_response_cache_control](#srcache_response_cache_control) - * [srcache_store_no_store](#srcache_store_no_store) - * [srcache_store_no_cache](#srcache_store_no_cache) - * [srcache_store_private](#srcache_store_private) - * [srcache_default_expire](#srcache_default_expire) - * [srcache_max_expire](#srcache_max_expire) -* [Variables](#variables) - * [$srcache_expire](#srcache_expire) - * [$srcache_fetch_status](#srcache_fetch_status) - * [$srcache_store_status](#srcache_store_status) -* [Known Issues](#known-issues) -* [Caveats](#caveats) -* [Trouble Shooting](#trouble-shooting) -* [Installation](#installation) -* [Compatibility](#compatibility) -* [Community](#community) - * [English Mailing List](#english-mailing-list) - * [Chinese Mailing List](#chinese-mailing-list) -* [Bugs and Patches](#bugs-and-patches) -* [Source Repository](#source-repository) -* [Test Suite](#test-suite) -* [TODO](#todo) -* [Getting involved](#getting-involved) -* [Author](#author) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Status -====== - -This module is production ready. - -Version -======= - -This document describes srcache-nginx-module [v0.32](https://github.com/openresty/srcache-nginx-module/tags) released on 2 July 2020. - -Synopsis -======== - -```nginx - - upstream my_memcached { - server 10.62.136.7:11211; - keepalive 10; - } - - location = /memc { - internal; - - memc_connect_timeout 100ms; - memc_send_timeout 100ms; - memc_read_timeout 100ms; - memc_ignore_client_abort on; - - set $memc_key $query_string; - set $memc_exptime 300; - - memc_pass my_memcached; - } - - location /foo { - set $key $uri$args; - srcache_fetch GET /memc $key; - srcache_store PUT /memc $key; - srcache_store_statuses 200 301 302 307 308; - - # proxy_pass/fastcgi_pass/drizzle_pass/echo/etc... - # or even static files on the disk - } -``` - -```nginx - - location = /memc2 { - internal; - - memc_connect_timeout 100ms; - memc_send_timeout 100ms; - memc_read_timeout 100ms; - memc_ignore_client_abort on; - - set_unescape_uri $memc_key $arg_key; - set $memc_exptime $arg_exptime; - - memc_pass unix:/tmp/memcached.sock; - } - - location /bar { - set_escape_uri $key $uri$args; - srcache_fetch GET /memc2 key=$key; - srcache_store PUT /memc2 key=$key&exptime=$srcache_expire; - - # proxy_pass/fastcgi_pass/drizzle_pass/echo/etc... - # or even static files on the disk - } -``` - -```nginx - - map $request_method $skip_fetch { - default 0; - POST 1; - PUT 1; - } - - server { - listen 8080; - - location /api/ { - set $key "$uri?$args"; - - srcache_fetch GET /memc $key; - srcache_store PUT /memc $key; - - srcache_methods GET PUT POST; - srcache_fetch_skip $skip_fetch; - - # proxy_pass/drizzle_pass/content_by_lua/echo/... - } - } -``` - -[Back to TOC](#table-of-contents) - -Description -=========== - -This module provides a transparent caching layer for arbitrary nginx locations (like those use an upstream or even serve static disk files). The caching behavior is mostly compatible with [RFC 2616](http://www.ietf.org/rfc/rfc2616.txt). - -Usually, [memc-nginx-module](https://github.com/openresty/memc-nginx-module) is used together with this module to provide a concrete caching storage backend. But technically, any modules that provide a REST interface can be used as the fetching and storage subrequests used by this module. - -For main requests, the [srcache_fetch](#srcache_fetch) directive works at the end of the access phase, so the [standard access module](http://nginx.org/en/docs/http/ngx_http_access_module.html)'s [allow](http://nginx.org/en/docs/http/ngx_http_access_module.html#allow) and [deny](http://nginx.org/en/docs/http/ngx_http_access_module.html#deny) direcives run *before* ours, which is usually the desired behavior for security reasons. - -The workflow of this module looks like below: - -![srcache flowchart](http://agentzh.org/misc/image/srcache-flowchart.png "srcache flowchart") - -[Back to TOC](#table-of-contents) - -Subrequest caching ------------------- - -For *subrequests*, we explicitly **disallow** the use of this module because it's too difficult to get right. There used to be an implementation but it was buggy and I finally gave up fixing it and abandoned it. - -However, if you're using [lua-nginx-module](https://github.com/openresty/lua-nginx-module), it's easy to do subrequest caching in Lua all by yourself. That is, first issue a subrequest to an [memc-nginx-module](https://github.com/openresty/memc-nginx-module) location to do an explicit cache lookup, if cache hit, just use the cached data returned; otherwise, fall back to the true backend, and finally do a cache insertion to feed the data into the cache. - -Using this module for main request caching and Lua for subrequest caching is the approach that we're taking in our business. This hybrid solution works great in production. - -[Back to TOC](#table-of-contents) - -Distributed Memcached Caching ------------------------------ - -Here is a simple example demonstrating a distributed memcached caching mechanism built atop this module. Suppose we do have three different memcached nodes and we use simple modulo to hash our keys. - -```nginx - - http { - upstream moon { - server 10.62.136.54:11211; - server unix:/tmp/memcached.sock backup; - } - - upstream earth { - server 10.62.136.55:11211; - } - - upstream sun { - server 10.62.136.56:11211; - } - - upstream_list universe moon earth sun; - - server { - memc_connect_timeout 100ms; - memc_send_timeout 100ms; - memc_read_timeout 100ms; - - location = /memc { - internal; - - set $memc_key $query_string; - set_hashed_upstream $backend universe $memc_key; - set $memc_exptime 3600; # in seconds - memc_pass $backend; - } - - location / { - set $key $uri; - srcache_fetch GET /memc $key; - srcache_store PUT /memc $key; - - # proxy_pass/fastcgi_pass/content_by_lua/drizzle_pass/... - } - } - } -``` -Here's what is going on in the sample above: -1. We first define three upstreams, `moon`, `earth`, and `sun`. These are our three memcached servers. -1. And then we group them together as an upstream list entity named `universe` with the `upstream_list` directive provided by [set-misc-nginx-module](https://github.com/openresty/set-misc-nginx-module). -1. After that, we define an internal location named `/memc` for talking to the memcached cluster. -1. In this `/memc` location, we first set the `$memc_key` variable with the query string (`$args`), and then use the [set_hashed_upstream](https://github.com/openresty/set-misc-nginx-module#set_hashed_upstream) directive to hash our [$memc_key](https://github.com/openresty/memc-nginx-module#memc_key) over the upsteam list `universe`, so as to obtain a concrete upstream name to be assigned to the variable `$backend`. -1. We pass this `$backend` variable into the [memc_pass](https://github.com/openresty/memc-nginx-module#memc_pass) directive. The `$backend` variable can hold a value among `moon`, `earth`, and `sun`. -1. Also, we define the memcached caching expiration time to be 3600 seconds (i.e., an hour) by overriding the [$memc_exptime](https://github.com/openresty/memc-nginx-module#memc_exptime) variable. -1. In our main public location `/`, we configure the `$uri` variable as our cache key, and then configure [srcache_fetch](#srcache_fetch) for cache lookups and [srcache_store](#srcache_store) for cache updates. We're using two subrequests to our `/memc` location defined earlier in these two directives. - -One can use [lua-nginx-module](https://github.com/openresty/lua-nginx-module)'s [set_by_lua](https://github.com/openresty/lua-nginx-module#set_by_lua) or [rewrite_by_lua](https://github.com/openresty/lua-nginx-module#rewrite_by_lua) directives to inject custom Lua code to compute the `$backend` and/or `$key` variables in the sample above. - -One thing that should be taken care of is that memcached does have restriction on key lengths, i.e., 250 bytes, so for keys that may be very long, one could use the [set_md5](https://github.com/openresty/set-misc-nginx-module#set_md5) directive or its friends to pre-hash the key to a fixed-length digest before assigning it to `$memc_key` in the `/memc` location or the like. - -Further, one can utilize the [srcache_fetch_skip](#srcache_fetch_skip) and [srcache_store_skip](#srcache_store_skip) directives to control what to cache and what not on a per-request basis, and Lua can also be used here in a similar way. So the possibility is really unlimited. - -To maximize speed, we often enable TCP (or Unix Domain Socket) connection pool for our memcached upstreams provided by [HttpUpstreamKeepaliveModule](http://wiki.nginx.org/HttpUpstreamKeepaliveModule), for example, - -```nginx - - upstream moon { - server 10.62.136.54:11211; - server unix:/tmp/memcached.sock backup; - keepalive 10; - } -``` - -where we define a connection pool which holds up to 10 keep-alive connections (per nginx worker process) for our `moon` upstream (cluster). - -[Back to TOC](#table-of-contents) - -Caching with Redis ------------------- - -Redis is an alternative key-value store with many additional features. - -Here is a working example using the lua-resty-redis module: - -``` - location ~ '\.php$|^/update.php' { - # cache setup - set $key $request_uri; - try_files $uri =404; - - srcache_fetch_skip $skip_cache; - srcache_store_skip $skip_cache; - - srcache_response_cache_control off; - srcache_store_statuses 200 201 301 302 307 308 404 503; - - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis-fetch $key; - srcache_store PUT /redis-store key=$escaped_key; - - more_set_headers 'X-Cache-Fetch-Status $srcache_fetch_status'; - more_set_headers 'X-Cache-Store-Status $srcache_store_status'; - - fastcgi_split_path_info ^(.+?\.php)(|/.*)$; - # Security note: If you're running a version of PHP older than the - # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. - # See http://serverfault.com/q/627903/94922 for details. - include fastcgi_params; - # Block httproxy attacks. See https://httpoxy.org/. - fastcgi_param HTTP_PROXY ""; - fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param QUERY_STRING $query_string; - fastcgi_intercept_errors on; - - fastcgi_pass upstream-name; - } - - location /redis-fetch { - internal; - - resolver 8.8.8.8 valid=300s; - resolver_timeout 10s; - - content_by_lua_block { - local key = assert(ngx.var.request_uri, "no key found") - local redis = require "resty.redis" - local red, err = redis:new() - if not red then - ngx.log(ngx.ERR, "Failed to create redis variable, error -> ", err) - ngx.exit(500) - end - assert(red:connect("redis-master.default.svc.cluster.local", 6379)) - if not red then - ngx.log(ngx.ERR, "Failed to connect to redis, error -> ", err) - ngx.exit(500) - end - local res, err = red:auth("redispassword") - if not res then - ngx.say("failed to authenticate, ", err) - ngx.exit(500) - end - local data = assert(red:get(key)) - assert(red:set_keepalive(10000, 100)) - if res == ngx.null then - return ngx.exit(404) - end - ngx.print(data) - } - } - - location /redis-store { - internal; - - resolver 8.8.8.8 valid=300s; - resolver_timeout 10s; - - content_by_lua_block { - local value = assert(ngx.req.get_body_data(), "no value found") - local key = assert(ngx.var.request_uri, "no key found") - local redis = require "resty.redis" - local red, err = redis:new() - if not red then - ngx.log(ngx.ERR, "Failed to create redis variable, error -> ", err) - ngx.exit(500) - end - assert(red:connect("redis-master.default.svc.cluster.local", 6379)) - if not red then - ngx.log(ngx.ERR, "Failed to connect to redis, error -> ", err) - ngx.exit(500) - end - local res, err = red:auth("redispassword") - if not res then - ngx.say("failed to authenticate, ", err) - ngx.exit(500) - end - local data = assert(red:set(key, value)) - assert(red:set_keepalive(10000, 100)) - if res == ngx.null then - return ngx.exit(404) - end - } - } -``` - - -Here is a working example by using the HTTPRedis (fetch) and Redis2 (store) modules: - -```nginx - - location /api { - default_type text/css; - - set $key $uri; - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis $key; - srcache_store PUT /redis2 key=$escaped_key&exptime=120; - - # fastcgi_pass/proxy_pass/drizzle_pass/postgres_pass/echo/etc - } - - location = /redis { - internal; - - set_md5 $redis_key $args; - redis_pass 127.0.0.1:6379; - } - - location = /redis2 { - internal; - - set_unescape_uri $exptime $arg_exptime; - set_unescape_uri $key $arg_key; - set_md5 $key; - - redis2_query set $key $echo_request_body; - redis2_query expire $key $exptime; - redis2_pass 127.0.0.1:6379; - } -``` - -This example makes use of the [$echo_request_body](https://github.com/openresty/echo-nginx-module#echo_request_body) variable provided by [echo-nginx-module](https://github.com/openresty/echo-nginx-module). Note that you need the latest version of [echo-nginx-module](https://github.com/openresty/echo-nginx-module), `v0.38rc2` because earlier versions may not work reliably. - -Also, you need both [HttpRedisModule](http://wiki.nginx.org/HttpRedisModule) and [redis2-nginx-module](https://github.com/openresty/redis2-nginx-module). The former is used in the [srcache_fetch](#srcache_fetch) subrequest and the latter is used in the [srcache_store](#srcache_store) subrequest. - -The Nginx core also has a bug that could prevent [redis2-nginx-module](https://github.com/openresty/redis2-nginx-module)'s pipelining support from working properly in certain extreme conditions. And the following patch fixes this: - - http://mailman.nginx.org/pipermail/nginx-devel/2012-March/002040.html - -Note that, however, if you are using the [OpenResty](http://openresty.org/) 1.0.15.3 bundle or later, then you already have everything that you need here in the bundle. - -[Back to TOC](#table-of-contents) - -Cache Key Preprocessing ------------------------ - -It is often desired to preprocess the cache key to exclude random noises that may hurt the cache hit rate. For example, random session IDs in the URI arguments are usually desired to get removed. - -Consider the following URI querystring - - SID=BC3781C3-2E02-4A11-89CF-34E5CFE8B0EF&UID=44332&L=EN&M=1&H=1&UNC=0&SRC=LK&RT=62 - -we want to remove the `SID` and `UID` arguments from it. It is easy to achieve if you use [lua-nginx-module](https://github.com/openresty/lua-nginx-module) at the same time: - -```nginx - - location = /t { - rewrite_by_lua ' - local args = ngx.req.get_uri_args() - args.SID = nil - args.UID = nil - ngx.req.set_uri_args(args) - '; - - echo $args; - } -``` - -Here we use the [echo](https://github.com/openresty/echo-nginx-module#echo) directive from [echo-nginx-module](https://github.com/openresty/echo-nginx-module) to dump out -the final value of [$args](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_args) in the end. You can replace it with your -[srcache-nginx-module](https://github.com/openresty/srcache-nginx-module) configurations and upstream configurations instead for -your case. Let's test this /t interface with curl: - - $ curl 'localhost:8081/t?RT=62&SID=BC3781C3-2E02-4A11-89CF-34E5CFE8B0EF&UID=44332&L=EN&M=1&H=1&UNC=0&SRC=LK' - M=1&UNC=0&RT=62&H=1&L=EN&SRC=LK - -It is worth mentioning that, if you want to retain the order of the URI -arguments, then you can do string substitutions on the value of [$args](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_args) -directly, for example, - - location = /t { - rewrite_by_lua ' - local args = ngx.var.args - newargs, n, err = ngx.re.gsub(args, [[\b[SU]ID=[^&]*&?]], "", "jo") - if n and n > 0 then - ngx.var.args = newargs - end - '; - - echo $args; - } - -Now test it with the original curl command again, we get exactly what -we would expect: - - RT=62&L=EN&M=1&H=1&UNC=0&SRC=LK - -But for caching purposes, it's good to normalize the URI argument -order so that you can increase the cache hit rate. And the hash table -entry order used by LuaJIT or Lua can be used to normalize the order -as a nice side effect. - -[Back to TOC](#table-of-contents) - -Directives -========== - -[Back to TOC](#table-of-contents) - -srcache_fetch -------------- -**syntax:** *srcache_fetch <method> <uri> <args>?* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *post-access* - -This directive registers an access phase handler that will issue an Nginx subrequest to lookup the cache. - -When the subrequest returns status code other than `200`, than a cache miss is signaled and the control flow will continue to the later phases including the content phase configured by [ngx_http_proxy_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html), [ngx_http_fastcgi_module](http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html), and others. If the subrequest returns `200 OK`, then a cache hit is signaled and this module will send the subrequest's response as the current main request's response to the client directly. - -This directive will always run at the end of the access phase, such that [ngx_http_access_module](http://nginx.org/en/docs/http/ngx_http_access_module.html)'s [allow](http://nginx.org/en/docs/http/ngx_http_access_module.html#allow) and [deny](http://nginx.org/en/docs/http/ngx_http_access_module.html#deny) will always run *before* this. - -You can use the [srcache_fetch_skip](#srcache_fetch_skip) directive to disable cache look-up selectively. - -[Back to TOC](#table-of-contents) - -srcache_fetch_skip ------------------- -**syntax:** *srcache_fetch_skip <flag>* - -**default:** *srcache_fetch_skip 0* - -**context:** *http, server, location, location if* - -**phase:** *post-access* - -The `` argument supports nginx variables. When this argument's value is not empty *and* not equal to `0`, then the fetching process will be unconditionally skipped. - -For example, to skip caching requests which have a cookie named `foo` with the value `bar`, we can write - -```nginx - - location / { - set $key ...; - set_by_lua $skip ' - if ngx.var.cookie_foo == "bar" then - return 1 - end - return 0 - '; - - srcache_fetch_skip $skip; - srcache_store_skip $skip; - - srcache_fetch GET /memc $key; - srcache_store GET /memc $key; - - # proxy_pass/fastcgi_pass/content_by_lua/... - } -``` -where [lua-nginx-module](https://github.com/openresty/lua-nginx-module) is used to calculate the value of the `$skip` variable at the (earlier) rewrite phase. Similarly, the `$key` variable can be computed by Lua using the [set_by_lua](https://github.com/openresty/lua-nginx-module#set_by_lua) or [rewrite_by_lua](https://github.com/openresty/lua-nginx-module#rewrite_by_lua) directive too. - -The standard [map](http://nginx.org/en/docs/http/ngx_http_map_module.html#map) directive can also be used to compute the value of the `$skip` variable used in the sample above: - -```nginx - - map $cookie_foo $skip { - default 0; - bar 1; - } -``` - -but your [map](http://nginx.org/en/docs/http/ngx_http_map_module.html#map) statement should be put into the `http` config block in your `nginx.conf` file though. - -[Back to TOC](#table-of-contents) - -srcache_store -------------- -**syntax:** *srcache_store <method> <uri> <args>?* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-filter* - -This directive registers an output filter handler that will issue an Nginx subrequest to save the response of the current main request into a cache backend. The status code of the subrequest will be ignored. - -You can use the [srcache_store_skip](#srcache_store_skip) and [srcache_store_max_size](#srcache_store_max_size) directives to disable caching for certain requests in case of a cache miss. - -Since the `v0.12rc7` release, both the response status line, response headers, and response bodies will be put into the cache. By default, the following special response headers will not be cached: - -* Connection -* Keep-Alive -* Proxy-Authenticate -* Proxy-Authorization -* TE -* Trailers -* Transfer-Encoding -* Upgrade -* Set-Cookie - -You can use the [srcache_store_pass_header](#srcache_store_pass_header) and/or [srcache_store_hide_header](#srcache_store_hide_header) directives to control what headers to cache and what not. - -The original response's data chunks get emitted as soon as -they arrive. `srcache_store` just copies and collects the data in an output filter without postponing them from being sent downstream. - -But please note that even though all the response data will be sent immediately, the current Nginx request lifetime will not finish until the srcache_store subrequest completes. That means a delay in closing the TCP connection on the server side (when HTTP keepalive is disabled, but proper HTTP clients should close the connection actively on the client side, which adds no extra delay or other issues at all) or serving the next request sent on the same TCP connection (when HTTP keepalive is in action). - -[Back to TOC](#table-of-contents) - -srcache_store_max_size ----------------------- -**syntax:** *srcache_store_max_size <size>* - -**default:** *srcache_store_max_size 0* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -When the response body length is exceeding this size, this module will not try to store the response body into the cache using the subrequest template that is specified in [srcache_store](#srcache_store). - -This is particular useful when using a cache storage backend that does have a hard upper limit on the input data. For example, the Memcached server has a default limit of `1 MB` by item. - -When `0` is specified (the default value), there's no limit check at all. - -[Back to TOC](#table-of-contents) - -srcache_store_skip ------------------- -**syntax:** *srcache_store_skip <flag>* - -**default:** *srcache_store_skip 0* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -The `` argument supports Nginx variables. When this argument's value is not empty *and* not equal to `0`, then the storing process will be unconditionally skipped. - -Starting from the `v0.25` release, the `` expression (possibly containing Nginx variables) can be evaluated up to twice: the first time is right after the response header is being sent and when the `` expression is not evaluated to true values it will be evaluated again right after the end of the response body data stream is seen. Before `v0.25`, only the first time evaluation is performed. - -Here's an example using Lua to set $nocache to avoid storing URIs that contain the string "/tmp": - -```nginx - - set_by_lua $nocache ' - if string.match(ngx.var.uri, "/tmp") then - return 1 - end - return 0'; - - srcache_store_skip $nocache; -``` - -[Back to TOC](#table-of-contents) - -srcache_store_statuses ----------------------- -**syntax:** *srcache_store_statuses <status1> <status2> ..* - -**default:** *srcache_store_statuses 200 301 302 307 308* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -This directive controls what responses to store to the cache according to their status code. - -By default, only `200`, `301`, `302`, `307` and `308` responses will be stored to cache and any other responses will skip [srcache_store](#srcache_store). - -You can specify arbitrary positive numbers for the response status code that you'd like to cache, even including error code like `404` and `503`. For example: - -```nginx - - srcache_store_statuses 200 201 301 302 307 308 404 503; -``` - -At least one argument should be given to this directive. - -This directive was first introduced in the `v0.13rc2` release. - -[Back to TOC](#table-of-contents) - -srcache_store_ranges --------------------- -**syntax:** *srcache_store_ranges on|off* - -**default:** *srcache_store_ranges off* - -**context:** *http, server, location, location if* - -**phase:** *output-body-filter* - -When this directive is turned on (default to `off`), [srcache_store](#srcache_store) will also store 206 Partial Content responses generated by the standard `ngx_http_range_filter_module`. If you turn this directive on, you MUST add `$http_range` to your cache keys. For example, - -```nginx - - location / { - set $key "$uri$args$http_range"; - srcache_fetch GET /memc $key; - srcache_store PUT /memc $key; - } -``` - -This directive was first introduced in the `v0.27` release. - -[Back to TOC](#table-of-contents) - -srcache_header_buffer_size --------------------------- -**syntax:** *srcache_header_buffer_size <size>* - -**default:** *srcache_header_buffer_size 4k/8k* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -This directive controles the header buffer when serializing response headers for [srcache_store](#srcache_store). The default size is the page size, usually `4k` or `8k` depending on specific platforms. - -Note that the buffer is not used to hold all the response headers, but just each individual header. So the buffer is merely needed to be big enough to hold the longest response header. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_store_hide_header -------------------------- -**syntax:** *srcache_store_hide_header <header>* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -By default, this module caches all the response headers except the following ones: - -* Connection -* Keep-Alive -* Proxy-Authenticate -* Proxy-Authorization -* TE -* Trailers -* Transfer-Encoding -* Upgrade -* Set-Cookie - -You can hide even more response headers from [srcache_store](#srcache_store) by listing their names (case-insensitive) by means of this directive. For examples, - -```nginx - - srcache_store_hide_header X-Foo; - srcache_store_hide_header Last-Modified; -``` - -Multiple occurrences of this directive are allowed in a single location. - -This directive was first introduced in the `v0.12rc7` release. - -See also [srcache_store_pass_header](#srcache_store_pass_header). - -[Back to TOC](#table-of-contents) - -srcache_store_pass_header -------------------------- -**syntax:** *srcache_store_pass_header <header>* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -By default, this module caches all the response headers except the following ones: - -* Connection -* Keep-Alive -* Proxy-Authenticate -* Proxy-Authorization -* TE -* Trailers -* Transfer-Encoding -* Upgrade -* Set-Cookie - -You can force [srcache_store](#srcache_store) to store one or more of these response headers from [srcache_store](#srcache_store) by listing their names (case-insensitive) by means of this directive. For examples, - -```nginx - - srcache_store_pass_header Set-Cookie; - srcache_store_pass_header Proxy-Autenticate; -``` - -Multiple occurrences of this directive are allowed in a single location. - -This directive was first introduced in the `v0.12rc7` release. - -See also [srcache_store_hide_header](#srcache_store_hide_header). - -[Back to TOC](#table-of-contents) - -srcache_methods ---------------- -**syntax:** *srcache_methods <method>...* - -**default:** *srcache_methods GET HEAD* - -**context:** *http, server, location* - -**phase:** *post-access, output-header-filter* - -This directive specifies HTTP request methods that are considered by either [srcache_fetch](#srcache_fetch) or [srcache_store](#srcache_store). HTTP request methods not listed will be skipped completely from the cache. - -The following HTTP methods are allowed: `GET`, `HEAD`, `POST`, `PUT`, and `DELETE`. The `GET` and `HEAD` methods are always implicitly included in the list regardless of their presence in this directive. - -Note that since the `v0.17` release `HEAD` requests are always skipped by [srcache_store](#srcache_store) because their responses never carry a response body. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_ignore_content_encoding -------------------------------- -**syntax:** *srcache_ignore_content_encoding on|off* - -**default:** *srcache_ignore_content_encoding off* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -When this directive is turned `off` (which is the default), non-empty `Content-Encoding` response header will cause [srcache_store](#srcache_store) skip storing the whole response into the cache and issue a warning into nginx's `error.log` file like this: - - - [warn] 12500#0: *1 srcache_store skipped due to response header "Content-Encoding: gzip" - (maybe you forgot to disable compression on the backend?) - - -Turning on this directive will ignore the `Content-Encoding` response header and store the response as usual (and also without warning). - -It's recommended to always disable gzip/deflate compression on your backend server by specifying the following line in your `nginx.conf` file: - -```nginx - - proxy_set_header Accept-Encoding ""; -``` - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_request_cache_control ------------------------------ -**syntax:** *srcache_request_cache_control on|off* - -**default:** *srcache_request_cache_control off* - -**context:** *http, server, location* - -**phase:** *post-access, output-header-filter* - -When this directive is turned `on`, the request headers `Cache-Control` and `Pragma` will be honored by this module in the following ways: - -1. [srcache_fetch](#srcache_fetch), i.e., the cache lookup operation, will be skipped when request headers `Cache-Control: no-cache` and/or `Pragma: no-cache` are present. -1. [srcache_store](#srcache_store), i.e., the cache store operation, will be skipped when the request header `Cache-Control: no-store` is specified. - -Turning off this directive will disable this functionality and is considered safer for busy sites mainly relying on cache for speed. - -This directive was first introduced in the `v0.12rc7` release. - -See also [srcache_response_cache_control](#srcache_response_cache_control). - -[Back to TOC](#table-of-contents) - -srcache_response_cache_control ------------------------------- -**syntax:** *srcache_response_cache_control on|off* - -**default:** *srcache_response_cache_control on* - -**context:** *http, server, location* - -**phase:** *output-header-filter* - -When this directive is turned `on`, the response headers `Cache-Control` and `Expires` will be honored by this module in the following ways: - -* `Cache-Control: private` skips [srcache_store](#srcache_store), -* `Cache-Control: no-store` skips [srcache_store](#srcache_store), -* `Cache-Control: no-cache` skips [srcache_store](#srcache_store), -* `Cache-Control: max-age=0` skips [srcache_store](#srcache_store), -* and `Expires: ` skips [srcache_store](#srcache_store). - -This directive takes priority over the [srcache_store_no_store](#srcache_store_no_store), [srcache_store_no_cache](#srcache_store_no_cache), and [srcache_store_private](#srcache_store_private) directives. - -This directive was first introduced in the `v0.12rc7` release. - -See also [srcache_request_cache_control](#srcache_request_cache_control). - -[Back to TOC](#table-of-contents) - -srcache_store_no_store ----------------------- -**syntax:** *srcache_store_no_store on|off* - -**default:** *srcache_store_no_store off* - -**context:** *http, server, location* - -**phase:** *output-header-filter* - -Turning this directive on will force responses with the header `Cache-Control: no-store` to be stored into the cache when [srcache_response_cache_control](#srcache_response_cache_control) is turned `on` *and* other conditions are met. Default to `off`. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_store_no_cache ----------------------- -**syntax:** *srcache_store_no_cache on|off* - -**default:** *srcache_store_no_cache off* - -**context:** *http, server, location* - -**phase:** *output-header-filter* - -Turning this directive on will force responses with the header `Cache-Control: no-cache` to be stored into the cache when [srcache_response_cache_control](#srcache_response_cache_control) is turned `on` *and* other conditions are met. Default to `off`. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_store_private ---------------------- -**syntax:** *srcache_store_private on|off* - -**default:** *srcache_store_private off* - -**context:** *http, server, location* - -**phase:** *output-header-filter* - -Turning this directive on will force responses with the header `Cache-Control: private` to be stored into the cache when [srcache_response_cache_control](#srcache_response_cache_control) is turned `on` *and* other conditions are met. Default to `off`. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_default_expire ----------------------- -**syntax:** *srcache_default_expire <time>* - -**default:** *srcache_default_expire 60s* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -This directive controls the default expiration time period that is allowed for the [$srcache_expire](#srcache_expire) variable value when neither `Cache-Control: max-age=N` nor `Expires` are specified in the response headers. - -The `