~spuul/nginx/trunk

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-02-15 03:05:42 UTC
  • mfrom: (4.3.10 sid)
  • Revision ID: package-import@ubuntu.com-20140215030542-71ubtowl24vf7nfn
Tags: 1.4.5-1ubuntu1
* Resynchronise with Debian (LP: #1280511).  Remaining changes:
  - debian/patches/ubuntu-branding.patch:
    + Add Ubuntu branding to server_tokens.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * Copyright (C) Yichun Zhang (agentzh)
 
4
 */
 
5
 
 
6
 
 
7
#ifndef DDEBUG
 
8
#define DDEBUG 0
 
9
#endif
 
10
#include "ddebug.h"
 
11
 
 
12
 
 
13
#include "ngx_http_lua_config.h"
 
14
#include "api/ngx_http_lua_api.h"
 
15
 
 
16
 
 
17
static int ngx_http_lua_config_prefix(lua_State *L);
 
18
 
 
19
 
 
20
void
 
21
ngx_http_lua_inject_config_api(lua_State *L)
 
22
{
 
23
    /* ngx.config */
 
24
 
 
25
    lua_createtable(L, 0, 4 /* nrec */);    /* .config */
 
26
 
 
27
#if (NGX_DEBUG)
 
28
    lua_pushboolean(L, 1);
 
29
#else
 
30
    lua_pushboolean(L, 0);
 
31
#endif
 
32
    lua_setfield(L, -2, "debug");
 
33
 
 
34
    lua_pushcfunction(L, ngx_http_lua_config_prefix);
 
35
    lua_setfield(L, -2, "prefix");
 
36
 
 
37
    lua_pushinteger(L, nginx_version);
 
38
    lua_setfield(L, -2, "nginx_version");
 
39
 
 
40
    lua_pushinteger(L, ngx_http_lua_version);
 
41
    lua_setfield(L, -2, "ngx_lua_version");
 
42
 
 
43
    lua_setfield(L, -2, "config");
 
44
}
 
45
 
 
46
 
 
47
static int
 
48
ngx_http_lua_config_prefix(lua_State *L)
 
49
{
 
50
    lua_pushlstring(L, (char *) ngx_cycle->prefix.data,
 
51
                    ngx_cycle->prefix.len);
 
52
    return 1;
 
53
}