#include "ngx_http_lua_subrequest.h"
#include "ngx_http_lua_util.h"
#include "ngx_http_lua_ctx.h"
#include "ngx_http_lua_contentby.h"
#if defined(NGX_DTRACE) && NGX_DTRACE
#include "ngx_http_probe.h"
#endif


#define NGX_HTTP_LUA_SHARE_ALL_VARS     0x01
#define NGX_HTTP_LUA_COPY_ALL_VARS      0x02


#define ngx_http_lua_method_name(m) { sizeof(m) - 1, (u_char *) m " " }

ngx_str_t  ngx_http_lua_get_method = ngx_http_lua_method_name("GET");
ngx_str_t  ngx_http_lua_put_method = ngx_http_lua_method_name("PUT");
ngx_str_t  ngx_http_lua_post_method = ngx_http_lua_method_name("POST");
ngx_str_t  ngx_http_lua_head_method = ngx_http_lua_method_name("HEAD");
ngx_str_t  ngx_http_lua_delete_method =
        ngx_http_lua_method_name("DELETE");
ngx_str_t  ngx_http_lua_options_method =
        ngx_http_lua_method_name("OPTIONS");
ngx_str_t  ngx_http_lua_copy_method = ngx_http_lua_method_name("COPY");
ngx_str_t  ngx_http_lua_move_method = ngx_http_lua_method_name("MOVE");
ngx_str_t  ngx_http_lua_lock_method = ngx_http_lua_method_name("LOCK");
ngx_str_t  ngx_http_lua_mkcol_method =
        ngx_http_lua_method_name("MKCOL");
ngx_str_t  ngx_http_lua_propfind_method =
        ngx_http_lua_method_name("PROPFIND");
ngx_str_t  ngx_http_lua_proppatch_method =
#include "ngx_http_lua_subrequest.h"
#include "ngx_http_lua_util.h"
#include "ngx_http_lua_ctx.h"
#include "ngx_http_lua_contentby.h"
#if defined(NGX_DTRACE) && NGX_DTRACE
#include "ngx_http_probe.h"
#endif


#define NGX_HTTP_LUA_SHARE_ALL_VARS     0x01
#define NGX_HTTP_LUA_COPY_ALL_VARS      0x02


#define ngx_http_lua_method_name(m) { sizeof(m) - 1, (u_char *) m " " }

ngx_str_t  ngx_http_lua_get_method = ngx_http_lua_method_name("GET");
ngx_str_t  ngx_http_lua_put_method = ngx_http_lua_method_name("PUT");
ngx_str_t  ngx_http_lua_post_method = ngx_http_lua_method_name("POST");
ngx_str_t  ngx_http_lua_head_method = ngx_http_lua_method_name("HEAD");
ngx_str_t  ngx_http_lua_delete_method =
        ngx_http_lua_method_name("DELETE");
ngx_str_t  ngx_http_lua_options_method =
        ngx_http_lua_method_name("OPTIONS");


static ngx_str_t  ngx_http_lua_content_length_header_key =
    ngx_string("Content-Length");


static ngx_int_t ngx_http_lua_set_content_length_header(ngx_http_request_t *r,
    off_t len);