~spuul/nginx/trunk

« back to all changes in this revision

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

  • 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:
30
30
#define MD5_DIGEST_LENGTH 16
31
31
#endif
32
32
 
 
33
#define ngx_http_lua_assert(a)  assert(a)
 
34
 
33
35
/* Nginx HTTP Lua Inline tag prefix */
34
36
 
35
37
#define NGX_HTTP_LUA_INLINE_TAG "nhli_"
80
82
#define NGX_HTTP_LUA_CONTEXT_TIMER          0x80
81
83
 
82
84
 
 
85
#ifndef NGX_HTTP_LUA_NO_FFI_API
 
86
#define NGX_HTTP_LUA_FFI_NO_REQ_CTX         -100
 
87
#define NGX_HTTP_LUA_FFI_BAD_CONTEXT        -101
 
88
#endif
 
89
 
 
90
 
83
91
typedef struct ngx_http_lua_main_conf_s ngx_http_lua_main_conf_t;
84
92
 
85
93
 
99
107
    ngx_str_t            lua_path;
100
108
    ngx_str_t            lua_cpath;
101
109
 
 
110
    ngx_cycle_t         *cycle;
102
111
    ngx_pool_t          *pool;
103
112
 
104
113
    ngx_int_t            max_pending_timers;
112
121
#if (NGX_PCRE)
113
122
    ngx_int_t            regex_cache_entries;
114
123
    ngx_int_t            regex_cache_max_entries;
 
124
    ngx_int_t            regex_match_limit;
115
125
#endif
116
126
 
117
127
    ngx_array_t         *shm_zones;  /* of ngx_shm_zone_t* */
200
210
    ngx_flag_t                       transform_underscores_in_resp_headers;
201
211
    ngx_flag_t                       log_socket_errors;
202
212
    ngx_flag_t                       check_client_abort;
 
213
    ngx_flag_t                       use_default_type;
203
214
} ngx_http_lua_loc_conf_t;
204
215
 
205
216
 
271
282
    unsigned                 waited_by_parent:1;  /* whether being waited by
272
283
                                                     a parent coroutine */
273
284
 
274
 
    ngx_http_lua_co_status_t co_status:3;  /* the current coroutine's status */
 
285
    unsigned                 co_status:3;  /* the current coroutine's status */
275
286
 
276
287
    unsigned                 flushing:1; /* indicates whether the current
277
288
                                            coroutine is waiting for
286
297
};
287
298
 
288
299
 
 
300
typedef struct {
 
301
    lua_State       *vm;
 
302
    ngx_int_t        count;
 
303
} ngx_http_lua_vm_state_t;
 
304
 
 
305
 
289
306
typedef struct ngx_http_lua_ctx_s {
 
307
    /* for lua_coce_cache off: */
 
308
    ngx_http_lua_vm_state_t  *vm_state;
 
309
 
 
310
    ngx_http_request_t      *request;
290
311
    ngx_http_handler_pt      resume_handler;
291
312
 
292
313
    ngx_http_lua_co_ctx_t   *cur_co_ctx; /* co ctx for the current coroutine */
328
349
 
329
350
    ngx_int_t                exit_code;
330
351
 
331
 
    ngx_http_lua_co_ctx_t   *req_body_reader_co_ctx; /* co ctx for the coroutine
332
 
                                                        reading the request
333
 
                                                        body */
 
352
    ngx_http_lua_co_ctx_t   *downstream_co_ctx; /* co ctx for the coroutine
 
353
                                                   reading the request body */
334
354
 
335
355
    ngx_uint_t               index;              /* index of the current
336
356
                                                    subrequest in its parent
350
370
                                                       request body data;
351
371
                                                       0: no need to wait */
352
372
 
353
 
    ngx_http_lua_user_coro_op_t   co_op:2; /*  coroutine API operation */
 
373
    unsigned         co_op:2; /*  coroutine API operation */
354
374
 
355
375
    unsigned         exited:1;
356
376
 
357
 
    unsigned         headers_sent:1;    /*  1: response header has been sent;
358
 
                                            0: header not sent yet */
359
 
 
360
377
    unsigned         eof:1;             /*  1: last_buf has been sent;
361
378
                                            0: last_buf not sent yet */
362
379
 
384
401
 
385
402
    unsigned         seen_last_in_filter:1;  /* used by body_filter_by_lua* */
386
403
    unsigned         seen_last_for_subreq:1; /* used by body capture filter */
 
404
    unsigned         writing_raw_req_socket:1; /* used by raw downstream
 
405
                                                  socket */
 
406
    unsigned         acquired_raw_req_socket:1;  /* whether a raw req socket
 
407
                                                    is acquired */
387
408
} ngx_http_lua_ctx_t;
388
409
 
389
410