~ubuntu-branches/ubuntu/saucy/nginx/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/src/ngx_http_lua_socket.h

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry, Cyril Lavier, Michael Lustfield
  • Date: 2012-12-18 10:29:18 UTC
  • mfrom: (4.2.56 sid)
  • Revision ID: package-import@ubuntu.com-20121218102918-dxtwj9vj89sbj8dz
Tags: 1.2.6-1
[ 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 <skirpichev@gmail.com> (Closes: #695374).
* debian/po/ja.po:
  + Added new Japanese translation. Thanks to victory <victory.deb@gmail.com>
    (Closes: #692481).
* debian/po/pt_BR.po:
  + Added new Brazilian Portuguese translation. Thanks to
    Adriano Rafael Gomes <adrianorg@gmail.com> (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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef NGX_HTTP_LUA_SOCKET_H
2
 
#define NGX_HTTP_LUA_SOCKET_H
3
 
 
4
 
 
5
 
#include "ngx_http_lua_common.h"
6
 
 
7
 
typedef struct ngx_http_lua_socket_upstream_s  ngx_http_lua_socket_upstream_t;
8
 
 
9
 
 
10
 
typedef
11
 
    int (*ngx_http_lua_socket_retval_handler)(ngx_http_request_t *r,
12
 
        ngx_http_lua_socket_upstream_t *u, lua_State *L);
13
 
 
14
 
 
15
 
typedef void (*ngx_http_lua_socket_upstream_handler_pt)(ngx_http_request_t *r,
16
 
    ngx_http_lua_socket_upstream_t *u);
17
 
 
18
 
 
19
 
typedef struct {
20
 
    ngx_http_lua_main_conf_t          *conf;
21
 
    ngx_uint_t                         active_connections;
22
 
 
23
 
    /* queues of ngx_http_lua_socket_pool_item_t: */
24
 
    ngx_queue_t                        cache;
25
 
    ngx_queue_t                        free;
26
 
 
27
 
    u_char                             key[1];
28
 
 
29
 
} ngx_http_lua_socket_pool_t;
30
 
 
31
 
 
32
 
struct ngx_http_lua_socket_upstream_s {
33
 
    ngx_http_lua_socket_retval_handler          prepare_retvals;
34
 
    ngx_http_lua_socket_upstream_handler_pt     read_event_handler;
35
 
    ngx_http_lua_socket_upstream_handler_pt     write_event_handler;
36
 
 
37
 
    ngx_http_lua_socket_pool_t      *socket_pool;
38
 
 
39
 
    ngx_http_lua_loc_conf_t         *conf;
40
 
    ngx_http_cleanup_pt             *cleanup;
41
 
    ngx_http_request_t              *request;
42
 
    ngx_peer_connection_t            peer;
43
 
 
44
 
    ngx_msec_t                       read_timeout;
45
 
    ngx_msec_t                       send_timeout;
46
 
    ngx_msec_t                       connect_timeout;
47
 
 
48
 
    ngx_http_upstream_resolved_t    *resolved;
49
 
 
50
 
    ngx_chain_t                     *bufs_in; /* input data buffers */
51
 
    ngx_chain_t                     *buf_in; /* last input data buffer */
52
 
    ngx_buf_t                        buffer; /* receive buffer */
53
 
 
54
 
    size_t                           length;
55
 
    size_t                           rest;
56
 
 
57
 
    ngx_uint_t                       ft_type;
58
 
    ngx_err_t                        socket_errno;
59
 
 
60
 
    ngx_output_chain_ctx_t           output;
61
 
    ngx_chain_writer_ctx_t           writer;
62
 
 
63
 
    ngx_int_t                      (*input_filter)(void *data, ssize_t bytes);
64
 
    void                            *input_filter_ctx;
65
 
 
66
 
    ssize_t                          recv_bytes;
67
 
    size_t                           request_len;
68
 
    ngx_chain_t                     *request_bufs;
69
 
 
70
 
    ngx_uint_t                       reused;
71
 
 
72
 
    unsigned                         request_sent:1;
73
 
 
74
 
    unsigned                         waiting:1;
75
 
    unsigned                         eof:1;
76
 
    unsigned                         is_downstream:1;
77
 
};
78
 
 
79
 
 
80
 
typedef struct ngx_http_lua_dfa_edge_s ngx_http_lua_dfa_edge_t;
81
 
 
82
 
 
83
 
struct ngx_http_lua_dfa_edge_s {
84
 
    u_char                           chr;
85
 
    int                              new_state;
86
 
    ngx_http_lua_dfa_edge_t         *next;
87
 
};
88
 
 
89
 
 
90
 
typedef struct {
91
 
    ngx_http_lua_socket_upstream_t      *upstream;
92
 
 
93
 
    ngx_str_t                            pattern;
94
 
    int                                  state;
95
 
    ngx_http_lua_dfa_edge_t            **recovering;
96
 
} ngx_http_lua_socket_compiled_pattern_t;
97
 
 
98
 
 
99
 
typedef struct {
100
 
    ngx_http_lua_socket_pool_t      *socket_pool;
101
 
 
102
 
    ngx_queue_t                      queue;
103
 
    ngx_connection_t                *connection;
104
 
 
105
 
    socklen_t                        socklen;
106
 
    struct sockaddr_storage          sockaddr;
107
 
 
108
 
    ngx_uint_t                       reused;
109
 
 
110
 
} ngx_http_lua_socket_pool_item_t;
111
 
 
112
 
 
113
 
void ngx_http_lua_inject_socket_api(ngx_log_t *log, lua_State *L);
114
 
 
115
 
void ngx_http_lua_inject_req_socket_api(lua_State *L);
116
 
 
117
 
 
118
 
#endif /* NGX_HTTP_LUA_SOCKET_H */
119