mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
ee9cf6c407 | |||
5136657315 | |||
b5e945fb9f | |||
b8217145ed | |||
c2dc7e3b69 | |||
4730dea151 | |||
a13135e34e | |||
beb32b132f | |||
48635d83e3 | |||
a3eea311e9 | |||
06091efe32 | |||
b11711a509 | |||
733e37e053 |
69
patches/nginx-1.0.6-variable_header_ignore_no_hash.patch
Normal file
69
patches/nginx-1.0.6-variable_header_ignore_no_hash.patch
Normal file
@ -0,0 +1,69 @@
|
||||
--- nginx-1.0.6/src/http/ngx_http_variables.c 2011-05-30 05:36:17.000000000 -0700
|
||||
+++ nginx-1.0.6-patched/src/http/ngx_http_variables.c 2011-09-30 10:59:05.000000000 -0700
|
||||
@@ -648,7 +648,17 @@
|
||||
|
||||
a = (ngx_array_t *) ((char *) r + data);
|
||||
|
||||
- n = a->nelts;
|
||||
+ h = a->elts;
|
||||
+ n = 0;
|
||||
+
|
||||
+ for (i = 0; i < a->nelts; i++) {
|
||||
+
|
||||
+ if (h[i]->hash == 0) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ n++;
|
||||
+ }
|
||||
|
||||
if (n == 0) {
|
||||
v->not_found = 1;
|
||||
@@ -659,9 +669,7 @@
|
||||
v->no_cacheable = 0;
|
||||
v->not_found = 0;
|
||||
|
||||
- h = a->elts;
|
||||
-
|
||||
- if (n == 1) {
|
||||
+ if (n == 1 && a->nelts == 1) {
|
||||
v->len = (*h)->value.len;
|
||||
v->data = (*h)->value.data;
|
||||
|
||||
@@ -670,7 +678,12 @@
|
||||
|
||||
len = - (ssize_t) (sizeof("; ") - 1);
|
||||
|
||||
- for (i = 0; i < n; i++) {
|
||||
+ for (i = 0; i < a->nelts; i++) {
|
||||
+
|
||||
+ if (h[i]->hash == 0) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
len += h[i]->value.len + sizeof("; ") - 1;
|
||||
}
|
||||
|
||||
@@ -683,6 +696,11 @@
|
||||
v->data = p;
|
||||
|
||||
for (i = 0; /* void */ ; i++) {
|
||||
+
|
||||
+ if (h[i]->hash == 0) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
p = ngx_copy(p, h[i]->value.data, h[i]->value.len);
|
||||
|
||||
if (i == n - 1) {
|
||||
@@ -738,6 +756,10 @@
|
||||
i = 0;
|
||||
}
|
||||
|
||||
+ if (header[i].hash == 0) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
for (n = 0; n + prefix < var->len && n < header[i].key.len; n++) {
|
||||
ch = header[i].key.data[n];
|
||||
|
69
patches/nginx-1.1.4-variable_header_ignore_no_hash.patch
Normal file
69
patches/nginx-1.1.4-variable_header_ignore_no_hash.patch
Normal file
@ -0,0 +1,69 @@
|
||||
--- nginx-1.1.4/src/http/ngx_http_variables.c 2011-05-30 05:36:17.000000000 -0700
|
||||
+++ nginx-1.1.4-patched/src/http/ngx_http_variables.c 2011-09-30 10:59:05.000000000 -0700
|
||||
@@ -648,7 +648,17 @@
|
||||
|
||||
a = (ngx_array_t *) ((char *) r + data);
|
||||
|
||||
- n = a->nelts;
|
||||
+ h = a->elts;
|
||||
+ n = 0;
|
||||
+
|
||||
+ for (i = 0; i < a->nelts; i++) {
|
||||
+
|
||||
+ if (h[i]->hash == 0) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ n++;
|
||||
+ }
|
||||
|
||||
if (n == 0) {
|
||||
v->not_found = 1;
|
||||
@@ -659,9 +669,7 @@
|
||||
v->no_cacheable = 0;
|
||||
v->not_found = 0;
|
||||
|
||||
- h = a->elts;
|
||||
-
|
||||
- if (n == 1) {
|
||||
+ if (n == 1 && a->nelts == 1) {
|
||||
v->len = (*h)->value.len;
|
||||
v->data = (*h)->value.data;
|
||||
|
||||
@@ -670,7 +678,12 @@
|
||||
|
||||
len = - (ssize_t) (sizeof("; ") - 1);
|
||||
|
||||
- for (i = 0; i < n; i++) {
|
||||
+ for (i = 0; i < a->nelts; i++) {
|
||||
+
|
||||
+ if (h[i]->hash == 0) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
len += h[i]->value.len + sizeof("; ") - 1;
|
||||
}
|
||||
|
||||
@@ -683,6 +696,11 @@
|
||||
v->data = p;
|
||||
|
||||
for (i = 0; /* void */ ; i++) {
|
||||
+
|
||||
+ if (h[i]->hash == 0) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
p = ngx_copy(p, h[i]->value.data, h[i]->value.len);
|
||||
|
||||
if (i == n - 1) {
|
||||
@@ -738,6 +756,10 @@
|
||||
i = 0;
|
||||
}
|
||||
|
||||
+ if (header[i].hash == 0) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
for (n = 0; n + prefix < var->len && n < header[i].key.len; n++) {
|
||||
ch = header[i].key.data[n];
|
||||
|
782
t/sanity.t
782
t/sanity.t
File diff suppressed because it is too large
Load Diff
68
util/configure
vendored
68
util/configure
vendored
@ -110,12 +110,18 @@ my %resty_opts;
|
||||
my $dry_run;
|
||||
my @ngx_rpaths;
|
||||
my $cc;
|
||||
my $cores;
|
||||
|
||||
my (@ngx_opts, @ngx_cc_opts, @ngx_ld_opts);
|
||||
|
||||
for my $opt (@ARGV) {
|
||||
next unless defined $opt;
|
||||
|
||||
if ($opt =~ /^-j(\d+)/) {
|
||||
$cores = $1;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($opt =~ /^--with-cc=(.+)/) {
|
||||
$cc = $1;
|
||||
push @ngx_opts, $opt;
|
||||
@ -138,6 +144,9 @@ for my $opt (@ARGV) {
|
||||
} elsif ($opt eq '--without-lua51') {
|
||||
$resty_opts{no_lua} = 1;
|
||||
|
||||
} elsif ($opt =~ /^--with-lua51=(.*)/) {
|
||||
$resty_opts{lua_path} = $1;
|
||||
|
||||
} elsif ($opt eq '--without-lua_cjson') {
|
||||
$resty_opts{no_lua_cjson} = 1;
|
||||
|
||||
@ -172,6 +181,9 @@ for my $opt (@ARGV) {
|
||||
} elsif ($opt eq '--with-luajit') {
|
||||
$resty_opts{luajit} = 1;
|
||||
|
||||
} elsif ($opt =~ /^--with-luajit=(.*)/) {
|
||||
$resty_opts{luajit_path} = $1;
|
||||
|
||||
} elsif ($opt =~ /^--with-libdrizzle=(.*)/) {
|
||||
$resty_opts{libdrizzle} = $1;
|
||||
|
||||
@ -329,10 +341,17 @@ _END_
|
||||
}
|
||||
}
|
||||
|
||||
if (! $opts->{luajit} && ! $opts->{no_http_lua} && ! $opts->{no_lua}) {
|
||||
if (! $opts->{luajit} && ! $opts->{luajit_path}
|
||||
&& ! $opts->{no_http_lua} && ! $opts->{no_lua}
|
||||
&& ! $opts->{lua_path})
|
||||
{
|
||||
$opts->{lua} = 1;
|
||||
}
|
||||
|
||||
if ($opts->{luajit} && $opts->{luajit_path}) {
|
||||
die "--with-luajit and --with-luajit=PATH are mutually exclusive.\n";
|
||||
}
|
||||
|
||||
if ($opts->{no_http_ssl} && $opts->{http_ssl}) {
|
||||
die "--with-http_ssl_module conflicts with --without-http_ssl_module.\n";
|
||||
}
|
||||
@ -432,7 +451,14 @@ _END_
|
||||
push @ngx_rpaths, $pg_lib;
|
||||
}
|
||||
|
||||
if ($opts->{luajit}) {
|
||||
if ($opts->{luajit_path}) {
|
||||
my $luajit_prefix = $opts->{luajit_path};
|
||||
env LUAJIT_LIB => "$luajit_prefix/lib";
|
||||
env LUAJIT_INC => "$luajit_prefix/include/luajit-2.0";
|
||||
|
||||
push @ngx_rpaths, "$luajit_prefix/lib";
|
||||
|
||||
} elsif ($opts->{luajit}) {
|
||||
my $luajit_src = auto_complete 'LuaJIT';
|
||||
my $luajit_prefix = "$prefix/luajit";
|
||||
my $luajit_root = File::Spec->rel2abs("luajit-root");
|
||||
@ -465,7 +491,11 @@ _END_
|
||||
$extra_opts .= " CC=$cc";
|
||||
}
|
||||
|
||||
if (defined $cores) {
|
||||
shell "${make} -j$cores$extra_opts PREFIX=$luajit_prefix", $dry_run;
|
||||
} else {
|
||||
shell "${make}$extra_opts PREFIX=$luajit_prefix", $dry_run;
|
||||
}
|
||||
|
||||
shell "${make} install$extra_opts PREFIX=$luajit_prefix DESTDIR=$luajit_root", $dry_run;
|
||||
|
||||
@ -482,6 +512,13 @@ _END_
|
||||
|
||||
cd '..';
|
||||
|
||||
} elsif ($opts->{lua_path}) {
|
||||
my $lua_prefix = $opts->{lua_path};
|
||||
env LUA_LIB => "$lua_prefix/lib";
|
||||
env LUA_INC => "$lua_prefix/include";
|
||||
|
||||
push @ngx_rpaths, "$lua_prefix/lib";
|
||||
|
||||
} elsif ($opts->{lua}) {
|
||||
# build stdandard lua
|
||||
|
||||
@ -508,7 +545,12 @@ _END_
|
||||
$extra_opts .= " CC=$cc";
|
||||
}
|
||||
|
||||
if (defined $cores) {
|
||||
shell "${make} -j$cores$extra_opts $platform", $dry_run;
|
||||
} else {
|
||||
shell "${make}$extra_opts $platform", $dry_run;
|
||||
}
|
||||
|
||||
shell "${make} install$extra_opts INSTALL_TOP=$lua_root$lua_prefix", $dry_run;
|
||||
|
||||
env LUA_LIB => "$lua_root$lua_prefix/lib";
|
||||
@ -520,10 +562,11 @@ _END_
|
||||
. "\$(MAKE) install$extra_opts INSTALL_TOP=\$(DESTDIR)$lua_prefix";
|
||||
|
||||
cd '..';
|
||||
|
||||
}
|
||||
|
||||
if ($opts->{lua} || $opts->{luajit}) {
|
||||
if ($opts->{lua} || $opts->{lua_path}
|
||||
|| $opts->{luajit} || $opts->{luajit_path})
|
||||
{
|
||||
# build lua modules
|
||||
|
||||
my $lualib_prefix = "$prefix/lualib";
|
||||
@ -549,7 +592,7 @@ _EOC_
|
||||
}
|
||||
|
||||
my $lua_inc;
|
||||
if ($opts->{luajit}) {
|
||||
if ($opts->{luajit} || $opts->{luajit_path}) {
|
||||
$lua_inc = $ENV{LUAJIT_INC};
|
||||
|
||||
} else {
|
||||
@ -562,10 +605,10 @@ _EOC_
|
||||
if ($on_solaris) {
|
||||
$extra_opts .= " INSTALL=$root_dir/build/install";
|
||||
if ($opts->{debug}) {
|
||||
$extra_opts .= " CFLAGS=\"-g -O0 -Wall -pedantic -D'isinf(x)=0'\"";
|
||||
$extra_opts .= " CFLAGS=\"-g -O0 -Wall -pedantic -DMISSING_ISINF\"";
|
||||
|
||||
} else {
|
||||
$extra_opts .= " CFLAGS=\"-g -O3 -Wall -pedantic -D'isinf(x)=0'\"";
|
||||
$extra_opts .= " CFLAGS=\"-g -O3 -Wall -pedantic -DMISSING_ISINF\"";
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -598,7 +641,7 @@ _EOC_
|
||||
}
|
||||
|
||||
my $lua_inc;
|
||||
if ($opts->{luajit}) {
|
||||
if ($opts->{luajit} || $opts->{luajit_path}) {
|
||||
$lua_inc = $ENV{LUAJIT_INC};
|
||||
|
||||
} else {
|
||||
@ -645,7 +688,7 @@ _EOC_
|
||||
}
|
||||
|
||||
my $lua_inc;
|
||||
if ($opts->{luajit}) {
|
||||
if ($opts->{luajit} || $opts->{luajit_path}) {
|
||||
$lua_inc = $ENV{LUAJIT_INC};
|
||||
|
||||
} else {
|
||||
@ -722,6 +765,9 @@ sub usage ($) {
|
||||
|
||||
--with-no-pool-patch enable the no-pool patch for debugging memory issues.
|
||||
|
||||
-jN pass -jN option to make while building the bundled
|
||||
Lua 5.1 interpreter or LuaJIT 2.0.
|
||||
|
||||
_EOC_
|
||||
|
||||
my $opt_max_len = length " --without-ngx_devel_kit_module ";
|
||||
@ -781,7 +827,9 @@ _EOC_
|
||||
--without-lua_rds_parser disable the lua-rds-parser library
|
||||
|
||||
--without-lua51 disable the bundled Lua 5.1 interpreter
|
||||
--with-luajit enable LuaJIT 2.0
|
||||
--with-lua51=PATH specify the external installation of Lua 5.1 by PATH
|
||||
--with-luajit enable and build LuaJIT 2.0
|
||||
--with-luajit=PATH use the external LuaJIT 2.0 installation specified by PATH
|
||||
--with-libdrizzle=DIR specify the libdrizzle 1.0 (or drizzle) installation prefix
|
||||
--with-libpq=DIR specify the libpq (or postgresql) installation prefix
|
||||
--with-pg_config=PATH specify the path of the pg_config utility
|
||||
|
@ -75,12 +75,12 @@ $root/util/get-tarball "http://github.com/agentzh/set-misc-nginx-module/tarball/
|
||||
tar -xzf set-misc-nginx-module-$ver.tar.gz || exit 1
|
||||
mv agentzh-set-misc-nginx-module-* set-misc-nginx-module-$ver || exit 1
|
||||
|
||||
ver=0.12rc3
|
||||
ver=0.12rc5
|
||||
$root/util/get-tarball "http://github.com/agentzh/rds-json-nginx-module/tarball/v$ver" -O rds-json-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf rds-json-nginx-module-$ver.tar.gz || exit 1
|
||||
mv agentzh-rds-json-nginx-module-* rds-json-nginx-module-$ver || exit 1
|
||||
|
||||
ver=0.02
|
||||
ver=0.03
|
||||
$root/util/get-tarball "http://github.com/agentzh/rds-csv-nginx-module/tarball/v$ver" -O rds-csv-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf rds-csv-nginx-module-$ver.tar.gz || exit 1
|
||||
mv agentzh-rds-csv-nginx-module-* rds-csv-nginx-module-$ver || exit 1
|
||||
@ -92,14 +92,14 @@ mv agentzh-headers-more-nginx-module-* headers-more-nginx-module-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.1.1rc4
|
||||
ver=0.1.1
|
||||
$root/util/get-tarball "http://github.com/chaoslawful/drizzle-nginx-module/tarball/v$ver" -O drizzle-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf drizzle-nginx-module-$ver.tar.gz || exit 1
|
||||
mv chaoslawful-drizzle-nginx-module-* drizzle-nginx-module-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.3.1rc3
|
||||
ver=0.3.1rc8
|
||||
$root/util/get-tarball "http://github.com/chaoslawful/lua-nginx-module/tarball/v$ver" -O lua-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf lua-nginx-module-$ver.tar.gz || exit 1
|
||||
mv chaoslawful-lua-nginx-module-* ngx_lua-$ver || exit 1
|
||||
@ -210,11 +210,11 @@ cd ..
|
||||
|
||||
#################################
|
||||
|
||||
ver=1.0.2
|
||||
ver=1.0.3
|
||||
$root/util/get-tarball "http://www.kyne.com.au/~mark/software/lua-cjson-$ver.tar.gz" -O "lua-cjson-$ver.tar.gz" || exit 1
|
||||
tar -xzf lua-cjson-$ver.tar.gz || exit 1
|
||||
cd lua-cjson-$ver || exit 1
|
||||
patch -p1 < $root/patches/lua_cjson-$ver-array_detection_fix.patch || exit 1
|
||||
#patch -p1 < $root/patches/lua_cjson-$ver-array_detection_fix.patch || exit 1
|
||||
cd ..
|
||||
|
||||
#################################
|
||||
|
Reference in New Issue
Block a user