Skip to content

Commit 886e27b

Browse files
author
Aviram
committed
Merged with 0.8.1
2 parents 3f39535 + 06da40f commit 886e27b

38 files changed

+829
-157
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ tsubreq
158158
tthread
159159
addr2line
160160
hup
161+
theaders

README

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Status
88
This module is under active development and is production ready.
99

1010
Version
11-
This document describes ngx_lua v0.8.0
12-
(<https://github.com/chaoslawful/lua-nginx-module/tags>) released on 23
11+
This document describes ngx_lua v0.8.1
12+
(<https://github.com/chaoslawful/lua-nginx-module/tags>) released on 26
1313
April 2013.
1414

1515
Synopsis
@@ -346,7 +346,7 @@ Directives
346346
modules at server start-up by means of this hook. Here is an example for
347347
pre-loading Lua modules:
348348

349-
init_by_lua 'require "cjson"';
349+
init_by_lua 'cjson = require "cjson"';
350350

351351
server {
352352
location = /api {
@@ -1546,7 +1546,16 @@ Nginx API for Lua
15461546
ngx.HTTP_PUT
15471547
ngx.HTTP_POST
15481548
ngx.HTTP_DELETE
1549-
ngx.HTTP_OPTIONS (first introduced in the v0.5.0rc24 release)
1549+
ngx.HTTP_OPTIONS (added in the v0.5.0rc24 release)
1550+
ngx.HTTP_MKCOL (added in the v0.8.2 release)
1551+
ngx.HTTP_COPY (added in the v0.8.2 release)
1552+
ngx.HTTP_MOVE (added in the v0.8.2 release)
1553+
ngx.HTTP_PROPFIND (added in the v0.8.2 release)
1554+
ngx.HTTP_PROPPATCH (added in the v0.8.2 release)
1555+
ngx.HTTP_LOCK (added in the v0.8.2 release)
1556+
ngx.HTTP_UNLOCK (added in the v0.8.2 release)
1557+
ngx.HTTP_PATCH (added in the v0.8.2 release)
1558+
ngx.HTTP_TRACE (added in the v0.8.2 release)
15501559

15511560
These constants are usually used in ngx.location.capture and
15521561
ngx.location.capture_multi method calls.
@@ -3689,6 +3698,9 @@ Nginx API for Lua
36893698
u UTF-8 mode. this requires PCRE to be built with
36903699
the --enable-utf8 option or else a Lua exception will be thrown.
36913700

3701+
U similar to "u" but disables PCRE's UTF-8 validity check on
3702+
the subject string. first introduced in ngx_lua v0.8.1.
3703+
36923704
x extended mode (similar to Perl's /x modifier)
36933705

36943706
These options can be combined:
@@ -5359,10 +5371,10 @@ Nginx API for Lua
53595371
callbacks, like stream/datagram cosockets (ngx.socket.tcp and
53605372
ngx.socket.udp), shared memory dictionaries (ngx.shared.DICT), user
53615373
coroutines (coroutine.*), user "light threads" (ngx.thread.*), ngx.exit,
5362-
ngx.now/ngx.time, ngx.md5/ngx.sha1, are all allowed. But the subrequest
5363-
API (like ngx.location.capture), the ngx.req.* API, the downstream
5364-
output API (like ngx.say, ngx.print, and ngx.flush) are explicitly
5365-
disabled in this context.
5374+
ngx.now/ngx.time, ngx.md5/ngx.sha1_bin, are all allowed. But the
5375+
subrequest API (like ngx.location.capture), the ngx.req.* API, the
5376+
downstream output API (like ngx.say, ngx.print, and ngx.flush) are
5377+
explicitly disabled in this context.
53665378

53675379
This API was first introduced in the "v0.8.0" release.
53685380

@@ -5844,7 +5856,7 @@ Nginx Compatibility
58445856

58455857
* 1.3.x (last tested: 1.3.11)
58465858

5847-
* 1.2.x (last tested: 1.2.7)
5859+
* 1.2.x (last tested: 1.2.8)
58485860

58495861
* 1.1.x (last tested: 1.1.5)
58505862

@@ -5885,9 +5897,9 @@ Installation
58855897

58865898
Build the source with this module:
58875899

5888-
wget 'http://nginx.org/download/nginx-1.2.7.tar.gz'
5889-
tar -xzvf nginx-1.2.7.tar.gz
5890-
cd nginx-1.2.7/
5900+
wget 'http://nginx.org/download/nginx-1.2.8.tar.gz'
5901+
tar -xzvf nginx-1.2.8.tar.gz
5902+
cd nginx-1.2.8/
58915903

58925904
# tell nginx's build system where to find LuaJIT:
58935905
export LUAJIT_LIB=/path/to/luajit/lib

README.markdown

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This module is under active development and is production ready.
1818
Version
1919
=======
2020

21-
This document describes ngx_lua [v0.8.0](https://github.com/chaoslawful/lua-nginx-module/tags) released on 23 April 2013.
21+
This document describes ngx_lua [v0.8.1](https://github.com/chaoslawful/lua-nginx-module/tags) released on 26 April 2013.
2222

2323
Synopsis
2424
========
@@ -322,7 +322,7 @@ When Nginx receives the `HUP` signal and starts reloading the config file, the L
322322
Usually you can register (true) Lua global variables or pre-load Lua modules at server start-up by means of this hook. Here is an example for pre-loading Lua modules:
323323

324324

325-
init_by_lua 'require "cjson"';
325+
init_by_lua 'cjson = require "cjson"';
326326

327327
server {
328328
location = /api {
@@ -1364,7 +1364,16 @@ HTTP method constants
13641364
ngx.HTTP_PUT
13651365
ngx.HTTP_POST
13661366
ngx.HTTP_DELETE
1367-
ngx.HTTP_OPTIONS (first introduced in the v0.5.0rc24 release)
1367+
ngx.HTTP_OPTIONS (added in the v0.5.0rc24 release)
1368+
ngx.HTTP_MKCOL (added in the v0.8.2 release)
1369+
ngx.HTTP_COPY (added in the v0.8.2 release)
1370+
ngx.HTTP_MOVE (added in the v0.8.2 release)
1371+
ngx.HTTP_PROPFIND (added in the v0.8.2 release)
1372+
ngx.HTTP_PROPPATCH (added in the v0.8.2 release)
1373+
ngx.HTTP_LOCK (added in the v0.8.2 release)
1374+
ngx.HTTP_UNLOCK (added in the v0.8.2 release)
1375+
ngx.HTTP_PATCH (added in the v0.8.2 release)
1376+
ngx.HTTP_TRACE (added in the v0.8.2 release)
13681377

13691378

13701379
These constants are usually used in [ngx.location.capture](http://wiki.nginx.org/HttpLuaModule#ngx.location.capture) and [ngx.location.capture_multi](http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi) method calls.
@@ -3422,6 +3431,9 @@ Specify `options` to control how the match operation will be performed. The foll
34223431
u UTF-8 mode. this requires PCRE to be built with
34233432
the --enable-utf8 option or else a Lua exception will be thrown.
34243433

3434+
U similar to "u" but disables PCRE's UTF-8 validity check on
3435+
the subject string. first introduced in ngx_lua v0.8.1.
3436+
34253437
x extended mode (similar to Perl's /x modifier)
34263438

34273439

@@ -4805,7 +4817,7 @@ A lot of the Lua APIs for Nginx are enabled in the context of the timer
48054817
callbacks, like stream/datagram cosockets ([ngx.socket.tcp](http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp) and [ngx.socket.udp](http://wiki.nginx.org/HttpLuaModule#ngx.socket.udp)), shared
48064818
memory dictionaries ([ngx.shared.DICT](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT)), user coroutines ([coroutine.*](http://wiki.nginx.org/HttpLuaModule#coroutine.create)),
48074819
user "light threads" ([ngx.thread.*](http://wiki.nginx.org/HttpLuaModule#ngx.thread.spawn)), [ngx.exit](http://wiki.nginx.org/HttpLuaModule#ngx.exit), [ngx.now](http://wiki.nginx.org/HttpLuaModule#ngx.now)/[ngx.time](http://wiki.nginx.org/HttpLuaModule#ngx.time),
4808-
[ngx.md5](http://wiki.nginx.org/HttpLuaModule#ngx.md5)/[ngx.sha1](http://wiki.nginx.org/HttpLuaModule#ngx.sha1), are all allowed. But the subrequest API (like
4820+
[ngx.md5](http://wiki.nginx.org/HttpLuaModule#ngx.md5)/[ngx.sha1_bin](http://wiki.nginx.org/HttpLuaModule#ngx.sha1_bin), are all allowed. But the subrequest API (like
48094821
[ngx.location.capture](http://wiki.nginx.org/HttpLuaModule#ngx.location.capture)), the [ngx.req.*](http://wiki.nginx.org/HttpLuaModule#ngx.req.start_time) API, the downstream output API
48104822
(like [ngx.say](http://wiki.nginx.org/HttpLuaModule#ngx.say), [ngx.print](http://wiki.nginx.org/HttpLuaModule#ngx.print), and [ngx.flush](http://wiki.nginx.org/HttpLuaModule#ngx.flush)) are explicitly disabled in
48114823
this context.
@@ -5196,7 +5208,7 @@ Nginx Compatibility
51965208
The latest module is compatible with the following versions of Nginx:
51975209

51985210
* 1.3.x (last tested: 1.3.11)
5199-
* 1.2.x (last tested: 1.2.7)
5211+
* 1.2.x (last tested: 1.2.8)
52005212
* 1.1.x (last tested: 1.1.5)
52015213
* 1.0.x (last tested: 1.0.15)
52025214
* 0.9.x (last tested: 0.9.4)
@@ -5222,9 +5234,9 @@ Alternatively, ngx_lua can be manually compiled into Nginx:
52225234
Build the source with this module:
52235235

52245236

5225-
wget 'http://nginx.org/download/nginx-1.2.7.tar.gz'
5226-
tar -xzvf nginx-1.2.7.tar.gz
5227-
cd nginx-1.2.7/
5237+
wget 'http://nginx.org/download/nginx-1.2.8.tar.gz'
5238+
tar -xzvf nginx-1.2.8.tar.gz
5239+
cd nginx-1.2.8/
52285240

52295241
# tell nginx's build system where to find LuaJIT:
52305242
export LUAJIT_LIB=/path/to/luajit/lib

doc/HttpLuaModule.wiki

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This module is under active development and is production ready.
1010

1111
= Version =
1212

13-
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/tags v0.8.0] released on 23 April 2013.
13+
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/tags v0.8.1] released on 26 April 2013.
1414

1515
= Synopsis =
1616
<geshi lang="nginx">
@@ -306,7 +306,7 @@ When Nginx receives the <code>HUP</code> signal and starts reloading the config
306306
Usually you can register (true) Lua global variables or pre-load Lua modules at server start-up by means of this hook. Here is an example for pre-loading Lua modules:
307307

308308
<geshi lang="nginx">
309-
init_by_lua 'require "cjson"';
309+
init_by_lua 'cjson = require "cjson"';
310310

311311
server {
312312
location = /api {
@@ -1311,7 +1311,16 @@ The <code>ngx.DECLINED</code> constant was first introduced in the <code>v0.5.0r
13111311
ngx.HTTP_PUT
13121312
ngx.HTTP_POST
13131313
ngx.HTTP_DELETE
1314-
ngx.HTTP_OPTIONS (first introduced in the v0.5.0rc24 release)
1314+
ngx.HTTP_OPTIONS (added in the v0.5.0rc24 release)
1315+
ngx.HTTP_MKCOL (added in the v0.8.2 release)
1316+
ngx.HTTP_COPY (added in the v0.8.2 release)
1317+
ngx.HTTP_MOVE (added in the v0.8.2 release)
1318+
ngx.HTTP_PROPFIND (added in the v0.8.2 release)
1319+
ngx.HTTP_PROPPATCH (added in the v0.8.2 release)
1320+
ngx.HTTP_LOCK (added in the v0.8.2 release)
1321+
ngx.HTTP_UNLOCK (added in the v0.8.2 release)
1322+
ngx.HTTP_PATCH (added in the v0.8.2 release)
1323+
ngx.HTTP_TRACE (added in the v0.8.2 release)
13151324
</geshi>
13161325
13171326
These constants are usually used in [[#ngx.location.capture|ngx.location.capture]] and [[#ngx.location.capture_multi|ngx.location.capture_multi]] method calls.
@@ -3304,6 +3313,9 @@ Specify <code>options</code> to control how the match operation will be performe
33043313
u UTF-8 mode. this requires PCRE to be built with
33053314
the --enable-utf8 option or else a Lua exception will be thrown.
33063315
3316+
U similar to "u" but disables PCRE's UTF-8 validity check on
3317+
the subject string. first introduced in ngx_lua v0.8.1.
3318+
33073319
x extended mode (similar to Perl's /x modifier)
33083320
</geshi>
33093321
@@ -4650,7 +4662,7 @@ A lot of the Lua APIs for Nginx are enabled in the context of the timer
46504662
callbacks, like stream/datagram cosockets ([[#ngx.socket.tcp|ngx.socket.tcp]] and [[#ngx.socket.udp|ngx.socket.udp]]), shared
46514663
memory dictionaries ([[#ngx.shared.DICT|ngx.shared.DICT]]), user coroutines ([[#coroutine.create|coroutine.*]]),
46524664
user "light threads" ([[#ngx.thread.spawn|ngx.thread.*]]), [[#ngx.exit|ngx.exit]], [[#ngx.now|ngx.now]]/[[#ngx.time|ngx.time]],
4653-
[[#ngx.md5|ngx.md5]]/[[#ngx.sha1|ngx.sha1]], are all allowed. But the subrequest API (like
4665+
[[#ngx.md5|ngx.md5]]/[[#ngx.sha1_bin|ngx.sha1_bin]], are all allowed. But the subrequest API (like
46544666
[[#ngx.location.capture|ngx.location.capture]]), the [[#ngx.req.start_time|ngx.req.*]] API, the downstream output API
46554667
(like [[#ngx.say|ngx.say]], [[#ngx.print|ngx.print]], and [[#ngx.flush|ngx.flush]]) are explicitly disabled in
46564668
this context.
@@ -5023,7 +5035,7 @@ On a ThinkPad T400 2.80 GHz laptop, the Hello World example readily achieves 28k
50235035
The latest module is compatible with the following versions of Nginx:
50245036
50255037
* 1.3.x (last tested: 1.3.11)
5026-
* 1.2.x (last tested: 1.2.7)
5038+
* 1.2.x (last tested: 1.2.8)
50275039
* 1.1.x (last tested: 1.1.5)
50285040
* 1.0.x (last tested: 1.0.15)
50295041
* 0.9.x (last tested: 0.9.4)
@@ -5047,9 +5059,9 @@ Alternatively, ngx_lua can be manually compiled into Nginx:
50475059
Build the source with this module:
50485060
50495061
<geshi lang="bash">
5050-
wget 'http://nginx.org/download/nginx-1.2.7.tar.gz'
5051-
tar -xzvf nginx-1.2.7.tar.gz
5052-
cd nginx-1.2.7/
5062+
wget 'http://nginx.org/download/nginx-1.2.8.tar.gz'
5063+
tar -xzvf nginx-1.2.8.tar.gz
5064+
cd nginx-1.2.8/
50535065
50545066
# tell nginx's build system where to find LuaJIT:
50555067
export LUAJIT_LIB=/path/to/luajit/lib

src/ngx_http_lua_consts.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,33 @@ ngx_http_lua_inject_http_consts(lua_State *L)
6060

6161
lua_pushinteger(L, NGX_HTTP_OPTIONS);
6262
lua_setfield(L, -2, "HTTP_OPTIONS");
63+
64+
lua_pushinteger(L, NGX_HTTP_MKCOL);
65+
lua_setfield(L, -2, "HTTP_MKCOL");
66+
67+
lua_pushinteger(L, NGX_HTTP_COPY);
68+
lua_setfield(L, -2, "HTTP_COPY");
69+
70+
lua_pushinteger(L, NGX_HTTP_MOVE);
71+
lua_setfield(L, -2, "HTTP_MOVE");
72+
73+
lua_pushinteger(L, NGX_HTTP_PROPFIND);
74+
lua_setfield(L, -2, "HTTP_PROPFIND");
75+
76+
lua_pushinteger(L, NGX_HTTP_PROPPATCH);
77+
lua_setfield(L, -2, "HTTP_PROPPATCH");
78+
79+
lua_pushinteger(L, NGX_HTTP_LOCK);
80+
lua_setfield(L, -2, "HTTP_LOCK");
81+
82+
lua_pushinteger(L, NGX_HTTP_UNLOCK);
83+
lua_setfield(L, -2, "HTTP_UNLOCK");
84+
85+
lua_pushinteger(L, NGX_HTTP_PATCH);
86+
lua_setfield(L, -2, "HTTP_PATCH");
87+
88+
lua_pushinteger(L, NGX_HTTP_TRACE);
89+
lua_setfield(L, -2, "HTTP_TRACE");
6390
/* }}} */
6491

6592
lua_pushinteger(L, NGX_HTTP_OK);

0 commit comments

Comments
 (0)