~ubuntu-branches/ubuntu/quantal/nginx/quantal-updates

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/src/ngx_http_lua_consts.c

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry
  • Date: 2011-09-26 10:17:04 UTC
  • mfrom: (4.2.38 sid)
  • Revision ID: package-import@ubuntu.com-20110926101704-x8pxngiujrmkxnn3
Tags: 1.1.4-2
[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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef DDEBUG
 
2
#define DDEBUG 0
 
3
#endif
 
4
 
 
5
#include "ddebug.h"
 
6
 
 
7
#include "ngx_http_lua_consts.h"
 
8
 
 
9
 
 
10
void
 
11
ngx_http_lua_inject_core_consts(lua_State *L)
 
12
{
 
13
    /* {{{ core constants */
 
14
    lua_pushinteger(L, NGX_OK);
 
15
    lua_setfield(L, -2, "OK");
 
16
 
 
17
    lua_pushinteger(L, NGX_AGAIN);
 
18
    lua_setfield(L, -2, "AGAIN");
 
19
 
 
20
    lua_pushinteger(L, NGX_DONE);
 
21
    lua_setfield(L, -2, "DONE");
 
22
 
 
23
    lua_pushinteger(L, NGX_ERROR);
 
24
    lua_setfield(L, -2, "ERROR");
 
25
    /* }}} */
 
26
}
 
27
 
 
28
 
 
29
void
 
30
ngx_http_lua_inject_http_consts(lua_State *L)
 
31
{
 
32
    /* {{{ HTTP status constants */
 
33
    lua_pushinteger(L, NGX_HTTP_GET);
 
34
    lua_setfield(L, -2, "HTTP_GET");
 
35
 
 
36
    lua_pushinteger(L, NGX_HTTP_POST);
 
37
    lua_setfield(L, -2, "HTTP_POST");
 
38
 
 
39
    lua_pushinteger(L, NGX_HTTP_PUT);
 
40
    lua_setfield(L, -2, "HTTP_PUT");
 
41
 
 
42
    lua_pushinteger(L, NGX_HTTP_DELETE);
 
43
    lua_setfield(L, -2, "HTTP_DELETE");
 
44
 
 
45
    lua_pushinteger(L, NGX_HTTP_HEAD);
 
46
    lua_setfield(L, -2, "HTTP_HEAD");
 
47
 
 
48
    lua_pushinteger(L, NGX_HTTP_OK);
 
49
    lua_setfield(L, -2, "HTTP_OK");
 
50
 
 
51
    lua_pushinteger(L, NGX_HTTP_CREATED);
 
52
    lua_setfield(L, -2, "HTTP_CREATED");
 
53
 
 
54
    lua_pushinteger(L, NGX_HTTP_SPECIAL_RESPONSE);
 
55
    lua_setfield(L, -2, "HTTP_SPECIAL_RESPONSE");
 
56
 
 
57
    lua_pushinteger(L, NGX_HTTP_MOVED_PERMANENTLY);
 
58
    lua_setfield(L, -2, "HTTP_MOVED_PERMANENTLY");
 
59
 
 
60
    lua_pushinteger(L, NGX_HTTP_MOVED_TEMPORARILY);
 
61
    lua_setfield(L, -2, "HTTP_MOVED_TEMPORARILY");
 
62
 
 
63
#if defined(nginx_version) && nginx_version >= 8042
 
64
    lua_pushinteger(L, NGX_HTTP_SEE_OTHER);
 
65
    lua_setfield(L, -2, "HTTP_SEE_OTHER");
 
66
#endif
 
67
 
 
68
    lua_pushinteger(L, NGX_HTTP_NOT_MODIFIED);
 
69
    lua_setfield(L, -2, "HTTP_NOT_MODIFIED");
 
70
 
 
71
    lua_pushinteger(L, NGX_HTTP_BAD_REQUEST);
 
72
    lua_setfield(L, -2, "HTTP_BAD_REQUEST");
 
73
 
 
74
    lua_pushinteger(L, NGX_HTTP_UNAUTHORIZED);
 
75
    lua_setfield(L, -2, "HTTP_UNAUTHORIZED");
 
76
 
 
77
 
 
78
    lua_pushinteger(L, NGX_HTTP_FORBIDDEN);
 
79
    lua_setfield(L, -2, "HTTP_FORBIDDEN");
 
80
 
 
81
    lua_pushinteger(L, NGX_HTTP_NOT_FOUND);
 
82
    lua_setfield(L, -2, "HTTP_NOT_FOUND");
 
83
 
 
84
    lua_pushinteger(L, NGX_HTTP_NOT_ALLOWED);
 
85
    lua_setfield(L, -2, "HTTP_NOT_ALLOWED");
 
86
 
 
87
    lua_pushinteger(L, 410);
 
88
    lua_setfield(L, -2, "HTTP_GONE");
 
89
 
 
90
    lua_pushinteger(L, NGX_HTTP_INTERNAL_SERVER_ERROR);
 
91
    lua_setfield(L, -2, "HTTP_INTERNAL_SERVER_ERROR");
 
92
 
 
93
    lua_pushinteger(L, NGX_HTTP_SERVICE_UNAVAILABLE);
 
94
    lua_setfield(L, -2, "HTTP_SERVICE_UNAVAILABLE");
 
95
    /* }}} */
 
96
}
 
97