annotate src/http/modules/ngx_http_uwsgi_module.c @ 3549:0b3613117ac5

./configure --http-uwsgi-temp-path=PATH
author Igor Sysoev <igor@sysoev.ru>
date Tue, 01 Jun 2010 17:44:51 +0000
parents fc7541a6959d
children 9f715c9e5b82
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 /*
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Unbit S.a.s. 2009-2010
3544
6048c77cfbb2 fix copyrights
Igor Sysoev <igor@sysoev.ru>
parents: 3543
diff changeset
4 * Copyright (C) 2008 Manlio Perillo (manlio.perillo@gmail.com)
6048c77cfbb2 fix copyrights
Igor Sysoev <igor@sysoev.ru>
parents: 3543
diff changeset
5 * Copyright (C) Igor Sysoev
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 *
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 * Redistribution and use in source and binary forms, with or without
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 * modification, are permitted provided that the following conditions
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 * are met:
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 * 1. Redistributions of source code must retain the above copyright
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 * notice, this list of conditions and the following disclaimer.
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 *
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26 * SUCH DAMAGE.
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
27 */
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
29
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30 #include <ngx_config.h>
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
31 #include <ngx_core.h>
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
32 #include <ngx_http.h>
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
33
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
34
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
35 typedef struct {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
36 ngx_http_upstream_conf_t upstream;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
37
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
38 ngx_array_t *flushes;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
39 ngx_array_t *params_len;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
40 ngx_array_t *params;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
41 ngx_array_t *params_source;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
42
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
43 ngx_array_t *uwsgi_lengths;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
44 ngx_array_t *uwsgi_values;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
45
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
46 ngx_str_t uwsgi_string ;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
47
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
48 u_char modifier1;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
49 u_char modifier2;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
50 } ngx_http_uwsgi_loc_conf_t;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
51
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
52 typedef struct {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
53 ngx_uint_t status;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
54 ngx_uint_t status_count;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
55 u_char *status_start;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
56 u_char *status_end;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
57 } ngx_http_uwsgi_ctx_t;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
58
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
59
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
60 #define NGX_HTTP_UWSGI_PARSE_NO_HEADER 20
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
61
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
62
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
63 static ngx_int_t ngx_http_uwsgi_eval(ngx_http_request_t *r,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
64 ngx_http_uwsgi_loc_conf_t *uwcf);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
65 static ngx_int_t ngx_http_uwsgi_create_request(ngx_http_request_t *r);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
66 static ngx_int_t ngx_http_uwsgi_reinit_request(ngx_http_request_t *r);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
67 static ngx_int_t ngx_http_uwsgi_process_status_line(ngx_http_request_t *r);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
68 static ngx_int_t ngx_http_uwsgi_parse_status_line(ngx_http_request_t *r,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
69 ngx_http_uwsgi_ctx_t *ctx);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
70 static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
71 static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
72 static void ngx_http_uwsgi_abort_request(ngx_http_request_t *r);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
73 static void ngx_http_uwsgi_finalize_request(ngx_http_request_t *r,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
74 ngx_int_t rc);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
75
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
76 static char *ngx_http_uwsgi_modifier1(ngx_conf_t *cf, ngx_command_t *cmd,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
77 void *conf);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
78
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
79 static char *ngx_http_uwsgi_modifier2(ngx_conf_t *cf, ngx_command_t *cmd,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
80 void *conf);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
81
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
82 static ngx_int_t ngx_http_uwsgi_add_variables(ngx_conf_t *cf);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
83 static void *ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
84 static char *ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
85 void *child);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
86
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
87 static char *ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
88 void *conf);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
89
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
90
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
91 static ngx_conf_bitmask_t ngx_http_uwsgi_next_upstream_masks[] = {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
92 { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
93 { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
94 { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
95 { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
96 { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
97 { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
98 { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
99 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
100 { ngx_null_string, 0 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
101 };
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
102
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
103
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
104 static ngx_conf_bitmask_t ngx_http_uwsgi_ignore_headers_masks[] = {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
105 { ngx_string("X-Accel-Redirect"), NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
106 { ngx_string("X-Accel-Expires"), NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
107 { ngx_string("Expires"), NGX_HTTP_UPSTREAM_IGN_EXPIRES },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
108 { ngx_string("Cache-Control"), NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL },
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
109 { ngx_null_string, 0 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
110 };
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
111
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
112
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
113 ngx_module_t ngx_http_uwsgi_module;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
114
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
115
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
116 static ngx_command_t ngx_http_uwsgi_commands[] = {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
117
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
118 { ngx_string("uwsgi_pass"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
119 NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
120 ngx_http_uwsgi_pass,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
121 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
122 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
123 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
124
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
125 { ngx_string("uwsgi_modifier1"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
126 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
127 ngx_http_uwsgi_modifier1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
128 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
129 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
130 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
131
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
132 { ngx_string("uwsgi_modifier2"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
133 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
134 ngx_http_uwsgi_modifier2,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
135 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
136 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
137 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
138
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
139 { ngx_string("uwsgi_ignore_client_abort"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
140 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
141 ngx_conf_set_flag_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
142 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
143 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ignore_client_abort),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
144 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
145
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
146 { ngx_string("uwsgi_connect_timeout"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
147 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
148 ngx_conf_set_msec_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
149 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
150 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.connect_timeout),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
151 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
152
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
153 { ngx_string("uwsgi_send_timeout"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
154 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
155 ngx_conf_set_msec_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
156 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
157 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.send_timeout),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
158 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
159
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
160 { ngx_string("uwsgi_buffer_size"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
161 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
162 ngx_conf_set_size_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
163 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
164 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.buffer_size),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
165 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
166
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
167 { ngx_string("uwsgi_pass_request_headers"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
168 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
169 ngx_conf_set_flag_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
170 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
171 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_request_headers),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
172 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
173
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
174 { ngx_string("uwsgi_pass_request_body"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
175 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
176 ngx_conf_set_flag_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
177 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
178 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_request_body),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
179 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
180
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
181 { ngx_string("uwsgi_intercept_errors"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
182 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
183 ngx_conf_set_flag_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
184 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
185 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.intercept_errors),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
186 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
187
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
188 { ngx_string("uwsgi_read_timeout"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
189 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
190 ngx_conf_set_msec_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
191 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
192 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.read_timeout),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
193 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
194
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
195 { ngx_string("uwsgi_buffers"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
196 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
197 ngx_conf_set_bufs_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
198 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
199 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.bufs),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
200 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
201
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
202 { ngx_string("uwsgi_busy_buffers_size"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
203 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
204 ngx_conf_set_size_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
205 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
206 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.busy_buffers_size_conf),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
207 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
208
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
209 { ngx_string("uwsgi_temp_path"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
210 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
211 ngx_conf_set_path_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
212 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
213 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.temp_path),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
214 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
215
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
216 { ngx_string("uwsgi_max_temp_file_size"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
217 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
218 ngx_conf_set_size_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
219 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
220 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.max_temp_file_size_conf),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
221 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
222
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
223 { ngx_string("uwsgi_temp_file_write_size"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
224 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
225 ngx_conf_set_size_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
226 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
227 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.temp_file_write_size_conf),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
228 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
229
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
230 { ngx_string("uwsgi_next_upstream"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
231 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
232 ngx_conf_set_bitmask_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
233 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
234 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
235 &ngx_http_uwsgi_next_upstream_masks },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
236
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
237 { ngx_string("uwsgi_param"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
238 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
239 ngx_conf_set_keyval_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
240 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
241 offsetof(ngx_http_uwsgi_loc_conf_t, params_source),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
242 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
243
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
244 { ngx_string("uwsgi_string"),
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
245 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
246 ngx_conf_set_str_slot,
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
247 NGX_HTTP_LOC_CONF_OFFSET,
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
248 offsetof(ngx_http_uwsgi_loc_conf_t, uwsgi_string),
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
249 NULL },
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
250
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
251 { ngx_string("uwsgi_pass_header"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
252 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
253 ngx_conf_set_str_array_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
254 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
255 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_headers),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
256 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
257
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
258 { ngx_string("uwsgi_hide_header"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
259 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
260 ngx_conf_set_str_array_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
261 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
262 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.hide_headers),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
263 NULL },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
264
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
265 { ngx_string("uwsgi_ignore_headers"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
266 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
267 ngx_conf_set_bitmask_slot,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
268 NGX_HTTP_LOC_CONF_OFFSET,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
269 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ignore_headers),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
270 &ngx_http_uwsgi_ignore_headers_masks },
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
271
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
272 ngx_null_command
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
273 };
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
274
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
275
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
276 static ngx_http_module_t ngx_http_uwsgi_module_ctx = {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
277 ngx_http_uwsgi_add_variables, /* preconfiguration */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
278 NULL, /* postconfiguration */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
279
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
280 NULL, /* create main configuration */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
281 NULL, /* init main configuration */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
282
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
283 NULL, /* create server configuration */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
284 NULL, /* merge server configuration */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
285
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
286 ngx_http_uwsgi_create_loc_conf, /* create location configuration */
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
287 ngx_http_uwsgi_merge_loc_conf /* merge location configuration */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
288 };
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
289
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
290
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
291 ngx_module_t ngx_http_uwsgi_module = {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
292 NGX_MODULE_V1,
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
293 &ngx_http_uwsgi_module_ctx, /* module context */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
294 ngx_http_uwsgi_commands, /* module directives */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
295 NGX_HTTP_MODULE, /* module type */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
296 NULL, /* init master */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
297 NULL, /* init module */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
298 NULL, /* init process */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
299 NULL, /* init thread */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
300 NULL, /* exit thread */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
301 NULL, /* exit process */
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
302 NULL, /* exit master */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
303 NGX_MODULE_V1_PADDING
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
304 };
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
305
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
306
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
307 static ngx_http_variable_t ngx_http_uwsgi_vars[] = {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
308
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
309 { ngx_null_string, NULL, NULL, 0, 0, 0 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
310 };
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
311
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
312
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
313 static ngx_str_t ngx_http_uwsgi_hide_headers[] = {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
314 ngx_string("Status"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
315 ngx_string("X-Accel-Expires"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
316 ngx_string("X-Accel-Redirect"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
317 ngx_string("X-Accel-Limit-Rate"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
318 ngx_string("X-Accel-Buffering"),
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
319 ngx_string("X-Accel-Charset"),
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
320 ngx_null_string
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
321 };
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
322
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
323
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
324 static ngx_path_init_t ngx_http_uwsgi_temp_path = {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
325 ngx_string(NGX_HTTP_UWSGI_TEMP_PATH), { 1, 2, 0 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
326 };
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
327
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
328
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
329 static ngx_int_t
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
330 ngx_http_uwsgi_handler(ngx_http_request_t *r)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
331 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
332 ngx_int_t rc;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
333 ngx_http_upstream_t *u;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
334 ngx_http_uwsgi_ctx_t *ctx;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
335 ngx_http_uwsgi_loc_conf_t *uwcf;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
336
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
337 if (r->subrequest_in_memory) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
338 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
339 "ngx_http_uwsgi_module does not support "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
340 "subrequests in memory");
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
341 return NGX_HTTP_INTERNAL_SERVER_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
342 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
343
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
344 if (ngx_http_upstream_create(r) != NGX_OK) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
345 return NGX_HTTP_INTERNAL_SERVER_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
346 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
347
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
348 ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_uwsgi_ctx_t));
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
349 if (ctx == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
350 return NGX_HTTP_INTERNAL_SERVER_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
351 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
352
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
353 ngx_http_set_ctx(r, ctx, ngx_http_uwsgi_module);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
354
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
355 uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
356
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
357 if (uwcf->uwsgi_lengths) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
358 if (ngx_http_uwsgi_eval(r, uwcf) != NGX_OK) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
359 return NGX_HTTP_INTERNAL_SERVER_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
360 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
361 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
362
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
363 u = r->upstream;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
364
3545
11c4f3a1e439 use ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents: 3544
diff changeset
365 ngx_str_set(&u->schema, "uwsgi://");
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
366 u->output.tag = (ngx_buf_tag_t) &ngx_http_uwsgi_module;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
367
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
368 u->conf = &uwcf->upstream;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
369
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
370 u->create_request = ngx_http_uwsgi_create_request;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
371 u->reinit_request = ngx_http_uwsgi_reinit_request;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
372 u->process_header = ngx_http_uwsgi_process_status_line;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
373 u->abort_request = ngx_http_uwsgi_abort_request;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
374 u->finalize_request = ngx_http_uwsgi_finalize_request;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
375
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
376 u->buffering = 1;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
377
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
378 u->pipe = ngx_pcalloc(r->pool, sizeof(ngx_event_pipe_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
379 if (u->pipe == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
380 return NGX_HTTP_INTERNAL_SERVER_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
381 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
382
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
383 u->pipe->input_filter = ngx_event_pipe_copy_input_filter;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
384 u->pipe->input_ctx = r;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
385
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
386 rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
387
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
388 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
389 return rc;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
390 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
391
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
392 return NGX_DONE;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
393 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
394
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
395
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
396 static ngx_int_t
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
397 ngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
398 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
399 ngx_url_t u;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
400
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
401 ngx_memzero(&u, sizeof(ngx_url_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
402
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
403 if (ngx_http_script_run(r, &u.url, uwcf->uwsgi_lengths->elts, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
404 uwcf->uwsgi_values->elts)
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
405 == NULL)
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
406 {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
407 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
408 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
409
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
410 u.no_resolve = 1;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
411
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
412 if (ngx_parse_url(r->pool, &u) != NGX_OK) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
413 if (u.err) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
414 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
415 "%s in upstream \"%V\"", u.err, &u.url);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
416 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
417
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
418 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
419 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
420
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
421 if (u.no_port) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
422 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
423 "no port in upstream \"%V\"", &u.url);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
424 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
425 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
426
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
427 r->upstream->resolved = ngx_pcalloc(r->pool,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
428 sizeof(ngx_http_upstream_resolved_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
429 if (r->upstream->resolved == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
430 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
431 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
432
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
433 if (u.addrs && u.addrs[0].sockaddr) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
434 r->upstream->resolved->sockaddr = u.addrs[0].sockaddr;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
435 r->upstream->resolved->socklen = u.addrs[0].socklen;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
436 r->upstream->resolved->naddrs = 1;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
437 r->upstream->resolved->host = u.addrs[0].name;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
438
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
439 } else {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
440 r->upstream->resolved->host = u.host;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
441 r->upstream->resolved->port = u.port;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
442 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
443
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
444 return NGX_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
445 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
446
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
447
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
448 static ngx_int_t
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
449 ngx_http_uwsgi_create_request(ngx_http_request_t *r)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
450 {
3547
c2da61796410 remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents: 3546
diff changeset
451 u_char ch;
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
452 size_t key_len, val_len, len;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
453 ngx_uint_t i, n;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
454 ngx_buf_t *b;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
455 ngx_chain_t *cl, *body;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
456 ngx_list_part_t *part;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
457 ngx_table_elt_t *header;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
458 ngx_http_script_code_pt code;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
459 ngx_http_script_engine_t e, le;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
460 ngx_http_uwsgi_loc_conf_t *uwcf;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
461 ngx_http_script_len_code_pt lcode;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
462
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
463 len = 0;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
464
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
465 uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
466
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
467 if (uwcf->params_len) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
468 ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
469
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
470 ngx_http_script_flush_no_cacheable_variables(r, uwcf->flushes);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
471 le.flushed = 1;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
472
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
473 le.ip = uwcf->params_len->elts;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
474 le.request = r;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
475
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
476 while (*(uintptr_t *) le.ip) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
477
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
478 lcode = *(ngx_http_script_len_code_pt *) le.ip;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
479 key_len = lcode(&le);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
480
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
481 for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode (&le)) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
482 lcode = *(ngx_http_script_len_code_pt *) le.ip;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
483 }
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
484 le.ip += sizeof(uintptr_t);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
485
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
486 len += 2 + key_len + 2 + val_len;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
487 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
488 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
489
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
490 if (uwcf->upstream.pass_request_headers) {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
491
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
492 part = &r->headers_in.headers.part;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
493 header = part->elts;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
494
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
495 for (i = 0; /* void */ ; i++) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
496
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
497 if (i >= part->nelts) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
498 if (part->next == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
499 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
500 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
501
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
502 part = part->next;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
503 header = part->elts;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
504 i = 0;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
505 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
506
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
507 len += 2 + 5 + header[i].key.len + 2 + header[i].value.len;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
508 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
509 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
510
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
511 if (uwcf->uwsgi_string.data && uwcf->uwsgi_string.len) {
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
512 len += uwcf->uwsgi_string.len;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
513 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
514
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
515 #if 0
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
516 /* allow custom uwsgi packet */
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
517 if (len > 0 && len < 2) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
518 ngx_log_error (NGX_LOG_ALERT, r->connection->log, 0,
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
519 "uwsgi request is too little: %uz", len);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
520 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
521 }
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
522 #endif
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
523
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
524 b = ngx_create_temp_buf(r->pool, len + 4);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
525 if (b == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
526 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
527 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
528
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
529 cl = ngx_alloc_chain_link(r->pool);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
530 if (cl == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
531 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
532 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
533
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
534 cl->buf = b;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
535
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
536 *b->last++ = uwcf->modifier1;
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
537 *b->last++ = (u_char) (len & 0xff);
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
538 *b->last++ = (u_char) ((len >> 8) & 0xff);
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
539 *b->last++ = uwcf->modifier2;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
540
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
541 if (uwcf->params_len) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
542 ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
543
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
544 e.ip = uwcf->params->elts;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
545 e.pos = b->last;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
546 e.request = r;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
547 e.flushed = 1;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
548
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
549 le.ip = uwcf->params_len->elts;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
550
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
551 while (*(uintptr_t *) le.ip) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
552
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
553 lcode = *(ngx_http_script_len_code_pt *) le.ip;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
554 key_len = (u_char) lcode (&le);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
555
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
556 for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode(&le)) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
557 lcode = *(ngx_http_script_len_code_pt *) le.ip;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
558 }
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
559 le.ip += sizeof(uintptr_t);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
560
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
561 *e.pos++ = (u_char) (key_len & 0xff);
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
562 *e.pos++ = (u_char) ((key_len >> 8) & 0xff);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
563
3547
c2da61796410 remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents: 3546
diff changeset
564 code = *(ngx_http_script_code_pt *) e.ip;
c2da61796410 remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents: 3546
diff changeset
565 code((ngx_http_script_engine_t *) & e);
c2da61796410 remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents: 3546
diff changeset
566
c2da61796410 remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents: 3546
diff changeset
567 *e.pos++ = (u_char) (val_len & 0xff);
c2da61796410 remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents: 3546
diff changeset
568 *e.pos++ = (u_char) ((val_len >> 8) & 0xff);
c2da61796410 remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents: 3546
diff changeset
569
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
570 while (*(uintptr_t *) e.ip) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
571 code = *(ngx_http_script_code_pt *) e.ip;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
572 code((ngx_http_script_engine_t *) & e);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
573 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
574
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
575 e.ip += sizeof(uintptr_t);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
576 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
577
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
578 b->last = e.pos;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
579 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
580
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
581 if (uwcf->upstream.pass_request_headers) {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
582
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
583 part = &r->headers_in.headers.part;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
584 header = part->elts;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
585
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
586 for (i = 0; /* void */ ; i++) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
587
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
588 if (i >= part->nelts) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
589 if (part->next == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
590 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
591 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
592
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
593 part = part->next;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
594 header = part->elts;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
595 i = 0;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
596 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
597
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
598 key_len = 5 + header[i].key.len;
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
599 *b->last++ = (u_char) (key_len & 0xff);
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
600 *b->last++ = (u_char) ((key_len >> 8) & 0xff);
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
601
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
602 b->last = ngx_cpymem(b->last, "HTTP_", 5);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
603 for (n = 0; n < header[i].key.len; n++) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
604 ch = header[i].key.data[n];
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
605
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
606 if (ch >= 'a' && ch <= 'z') {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
607 ch &= ~0x20;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
608
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
609 } else if (ch == '-') {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
610 ch = '_';
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
611 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
612
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
613 *b->last++ = ch;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
614 }
3546
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
615
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
616 val_len = header[i].value.len;
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
617 *b->last++ = (u_char) (val_len & 0xff);
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
618 *b->last++ = (u_char) ((val_len >> 8) & 0xff);
3a9fca8cbdfc simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents: 3545
diff changeset
619 b->last = ngx_copy(b->last, header[i].value.data, val_len);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
620 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
621 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
622
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
623 if (uwcf->uwsgi_string.data && uwcf->uwsgi_string.len) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
624 b->last = ngx_copy(b->last, uwcf->uwsgi_string.data,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
625 uwcf->uwsgi_string.len);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
626 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
627
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
628 if (uwcf->upstream.pass_request_body) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
629 body = r->upstream->request_bufs;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
630 r->upstream->request_bufs = cl;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
631
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
632 while (body) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
633 b = ngx_alloc_buf(r->pool);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
634 if (b == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
635 return NGX_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
636 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
637
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
638 ngx_memcpy(b, body->buf, sizeof(ngx_buf_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
639
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
640 cl->next = ngx_alloc_chain_link(r->pool);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
641 if (cl->next == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
642 return NGX_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
643 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
644
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
645 cl = cl->next;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
646 cl->buf = b;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
647
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
648 body = body->next;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
649 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
650
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
651 b->flush = 1;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
652
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
653 } else {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
654 r->upstream->request_bufs = cl;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
655 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
656
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
657 cl->next = NULL;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
658
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
659 return NGX_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
660 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
661
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
662
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
663 static ngx_int_t
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
664 ngx_http_uwsgi_reinit_request(ngx_http_request_t *r)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
665 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
666 ngx_http_uwsgi_ctx_t *ctx;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
667
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
668 ctx = ngx_http_get_module_ctx(r, ngx_http_uwsgi_module);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
669
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
670 if (ctx == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
671 return NGX_OK;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
672 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
673
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
674 ctx->status = 0;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
675 ctx->status_count = 0;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
676 ctx->status_start = NULL;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
677 ctx->status_end = NULL;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
678
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
679 r->upstream->process_header = ngx_http_uwsgi_process_status_line;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
680
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
681 return NGX_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
682 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
683
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
684 static ngx_int_t
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
685 ngx_http_uwsgi_parse_status_line(ngx_http_request_t *r,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
686 ngx_http_uwsgi_ctx_t *ctx)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
687 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
688 u_char ch;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
689 u_char *p;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
690 ngx_http_upstream_t *u;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
691 enum {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
692 sw_start = 0,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
693 sw_H,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
694 sw_HT,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
695 sw_HTT,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
696 sw_HTTP,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
697 sw_first_major_digit,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
698 sw_major_digit,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
699 sw_first_minor_digit,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
700 sw_minor_digit,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
701 sw_status,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
702 sw_space_after_status,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
703 sw_status_text,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
704 sw_almost_done
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
705 } state;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
706
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
707 u = r->upstream;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
708
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
709 state = r->state;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
710
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
711 for (p = u->buffer.pos; p < u->buffer.last; p++) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
712 ch = *p;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
713
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
714 switch (state) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
715
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
716 /* "HTTP/" */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
717 case sw_start:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
718 switch (ch) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
719 case 'H':
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
720 state = sw_H;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
721 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
722 default:
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
723 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
724 }
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
725 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
726
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
727 case sw_H:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
728 switch (ch) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
729 case 'T':
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
730 state = sw_HT;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
731 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
732 default:
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
733 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
734 }
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
735 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
736
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
737 case sw_HT:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
738 switch (ch) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
739 case 'T':
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
740 state = sw_HTT;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
741 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
742 default:
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
743 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
744 }
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
745 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
746
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
747 case sw_HTT:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
748 switch (ch) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
749 case 'P':
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
750 state = sw_HTTP;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
751 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
752 default:
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
753 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
754 }
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
755 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
756
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
757 case sw_HTTP:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
758 switch (ch) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
759 case '/':
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
760 state = sw_first_major_digit;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
761 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
762 default:
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
763 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
764 }
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
765 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
766
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
767 /* the first digit of major HTTP version */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
768 case sw_first_major_digit:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
769 if (ch < '1' || ch > '9') {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
770 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
771 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
772
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
773 state = sw_major_digit;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
774 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
775
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
776 /* the major HTTP version or dot */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
777 case sw_major_digit:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
778 if (ch == '.') {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
779 state = sw_first_minor_digit;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
780 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
781 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
782
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
783 if (ch < '0' || ch > '9') {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
784 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
785 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
786
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
787 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
788
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
789 /* the first digit of minor HTTP version */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
790 case sw_first_minor_digit:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
791 if (ch < '0' || ch > '9') {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
792 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
793 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
794
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
795 state = sw_minor_digit;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
796 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
797
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
798 /* the minor HTTP version or the end of the request line */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
799 case sw_minor_digit:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
800 if (ch == ' ') {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
801 state = sw_status;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
802 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
803 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
804
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
805 if (ch < '0' || ch > '9') {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
806 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
807 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
808
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
809 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
810
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
811 /* HTTP status code */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
812 case sw_status:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
813 if (ch == ' ') {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
814 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
815 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
816
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
817 if (ch < '0' || ch > '9') {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
818 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
819 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
820
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
821 ctx->status = ctx->status * 10 + ch - '0';
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
822
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
823 if (++ctx->status_count == 3) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
824 state = sw_space_after_status;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
825 ctx->status_start = p - 2;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
826 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
827
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
828 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
829
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
830 /* space or end of line */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
831 case sw_space_after_status:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
832 switch (ch) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
833 case ' ':
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
834 state = sw_status_text;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
835 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
836 case '.': /* IIS may send 403.1, 403.2, etc */
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
837 state = sw_status_text;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
838 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
839 case CR:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
840 state = sw_almost_done;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
841 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
842 case LF:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
843 goto done;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
844 default:
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
845 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
846 }
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
847 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
848
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
849 /* any text until end of line */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
850 case sw_status_text:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
851 switch (ch) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
852 case CR:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
853 state = sw_almost_done;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
854
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
855 break;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
856 case LF:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
857 goto done;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
858 }
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
859 break;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
860
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
861 /* end of status line */
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
862 case sw_almost_done:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
863 ctx->status_end = p - 1;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
864 switch (ch) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
865 case LF:
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
866 goto done;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
867 default:
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
868 return NGX_HTTP_UWSGI_PARSE_NO_HEADER;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
869 }
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
870 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
871 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
872
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
873 u->buffer.pos = p;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
874 r->state = state;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
875
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
876 return NGX_AGAIN;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
877
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
878 done:
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
879
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
880 u->buffer.pos = p + 1;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
881
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
882 if (ctx->status_end == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
883 ctx->status_end = p;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
884 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
885
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
886 r->state = sw_start;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
887
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
888 return NGX_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
889 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
890
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
891
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
892 static ngx_int_t
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
893 ngx_http_uwsgi_process_status_line(ngx_http_request_t *r)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
894 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
895 ngx_int_t rc;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
896 ngx_http_upstream_t *u;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
897 ngx_http_uwsgi_ctx_t *ctx;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
898
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
899 ctx = ngx_http_get_module_ctx(r, ngx_http_uwsgi_module);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
900
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
901 if (ctx == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
902 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
903 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
904
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
905 rc = ngx_http_uwsgi_parse_status_line(r, ctx);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
906
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
907 if (rc == NGX_AGAIN) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
908 return rc;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
909 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
910
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
911 u = r->upstream;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
912
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
913 if (rc == NGX_HTTP_UWSGI_PARSE_NO_HEADER) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
914
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
915 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
916 "upstream sent no valid HTTP/1.0 header");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
917
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
918 r->http_version = NGX_HTTP_VERSION_9;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
919 u->headers_in.status_n = NGX_HTTP_OK;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
920 u->state->status = NGX_HTTP_OK;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
921
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
922 return NGX_OK;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
923 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
924
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
925 if (u->state) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
926 u->state->status = ctx->status;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
927 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
928
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
929 u->headers_in.status_n = ctx->status;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
930
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
931 u->headers_in.status_line.len = ctx->status_end - ctx->status_start;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
932 u->headers_in.status_line.data = ngx_pnalloc(r->pool,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
933 u->headers_in.status_line.len);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
934 if (u->headers_in.status_line.data == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
935 return NGX_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
936 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
937
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
938 ngx_memcpy(u->headers_in.status_line.data, ctx->status_start,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
939 u->headers_in.status_line.len);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
940
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
941 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
942 "http uwsgi status %ui \"%V\"",
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
943 u->headers_in.status_n, &u->headers_in.status_line);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
944
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
945 u->process_header = ngx_http_uwsgi_process_header;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
946
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
947 return ngx_http_uwsgi_process_header(r);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
948 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
949
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
950
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
951 static ngx_int_t
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
952 ngx_http_uwsgi_process_header(ngx_http_request_t *r)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
953 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
954 ngx_int_t rc;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
955 ngx_table_elt_t *h;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
956 ngx_http_upstream_header_t *hh;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
957 ngx_http_upstream_main_conf_t *umcf;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
958
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
959 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
960
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
961 for ( ;; ) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
962
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
963 rc = ngx_http_parse_header_line(r, &r->upstream->buffer, 1);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
964
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
965 if (rc == NGX_OK) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
966
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
967 /* a header line has been parsed successfully */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
968
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
969 h = ngx_list_push(&r->upstream->headers_in.headers);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
970 if (h == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
971 return NGX_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
972 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
973
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
974 h->hash = r->header_hash;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
975
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
976 h->key.len = r->header_name_end - r->header_name_start;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
977 h->value.len = r->header_end - r->header_start;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
978
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
979 h->key.data = ngx_pnalloc(r->pool,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
980 h->key.len + 1 + h->value.len + 1
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
981 + h->key.len);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
982 if (h->key.data == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
983 return NGX_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
984 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
985
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
986 h->value.data = h->key.data + h->key.len + 1;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
987 h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
988
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
989 ngx_cpystrn(h->key.data, r->header_name_start, h->key.len + 1);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
990 ngx_cpystrn(h->value.data, r->header_start, h->value.len + 1);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
991
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
992 if (h->key.len == r->lowcase_index) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
993 ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
994
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
995 } else {
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
996 ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
997 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
998
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
999 hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1000 h->lowcase_key, h->key.len);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1001
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1002 if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1003 return NGX_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1004 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1005
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1006 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1007 "http uwsgi header: \"%V: %V\"", &h->key, &h->value);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1008
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1009 continue;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1010 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1011
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1012 if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1013
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1014 /* a whole header has been parsed successfully */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1015
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1016 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1017 "http uwsgi header done");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1018
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1019 /*
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1020 * if no "Server" and "Date" in header line,
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1021 * then add the special empty headers
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1022 */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1023
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1024 if (r->upstream->headers_in.server == NULL) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1025 h = ngx_list_push(&r->upstream->headers_in.headers);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1026 if (h == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1027 return NGX_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1028 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1029
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1030 h->hash = ngx_hash(ngx_hash(ngx_hash(ngx_hash(
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1031 ngx_hash ('s', 'e'), 'r'), 'v'), 'e'), 'r');
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1032
3545
11c4f3a1e439 use ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents: 3544
diff changeset
1033 ngx_str_set(&h->key, "Server");
11c4f3a1e439 use ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents: 3544
diff changeset
1034 ngx_str_null(&h->value);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1035 h->lowcase_key = (u_char *) "server";
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1036 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1037
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1038 if (r->upstream->headers_in.date == NULL) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1039 h = ngx_list_push(&r->upstream->headers_in.headers);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1040 if (h == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1041 return NGX_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1042 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1043
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1044 h->hash = ngx_hash(ngx_hash(ngx_hash('d', 'a'), 't'), 'e');
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1045
3545
11c4f3a1e439 use ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents: 3544
diff changeset
1046 ngx_str_set(&h->key, "Date");
11c4f3a1e439 use ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents: 3544
diff changeset
1047 ngx_str_null(&h->value);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1048 h->lowcase_key = (u_char *) "date";
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1049 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1050
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1051 return NGX_OK;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1052 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1053
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1054 if (rc == NGX_AGAIN) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1055 return NGX_AGAIN;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1056 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1057
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1058 /* there was error while a header line parsing */
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1059
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1060 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1061 "upstream sent invalid header");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1062
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1063 return NGX_HTTP_UPSTREAM_INVALID_HEADER;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1064 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1065 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1066
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1067
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1068 static void
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1069 ngx_http_uwsgi_abort_request(ngx_http_request_t *r)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1070 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1071 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1072 "abort http uwsgi request");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1073
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1074 return;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1075 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1076
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1077
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1078 static void
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1079 ngx_http_uwsgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1080 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1081 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1082 "finalize http uwsgi request");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1083
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1084 return;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1085 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1086
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1087
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1088 static ngx_int_t
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1089 ngx_http_uwsgi_add_variables(ngx_conf_t *cf)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1090 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1091 ngx_http_variable_t *var, *v;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1092
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1093 for (v = ngx_http_uwsgi_vars; v->name.len; v++) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1094 var = ngx_http_add_variable(cf, &v->name, v->flags);
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1095 if (var == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1096 return NGX_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1097 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1098
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1099 var->get_handler = v->get_handler;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1100 var->data = v->data;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1101 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1102
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1103 return NGX_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1104 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1105
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1106
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1107 static void *
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1108 ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1109 {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1110 ngx_http_uwsgi_loc_conf_t *conf;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1111
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1112 conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_uwsgi_loc_conf_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1113 if (conf == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1114 return NULL;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1115 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1116
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1117 conf->upstream.store = NGX_CONF_UNSET;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1118 conf->upstream.store_access = NGX_CONF_UNSET_UINT;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1119 conf->upstream.buffering = NGX_CONF_UNSET;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1120 conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1121
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1122 conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1123 conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1124 conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1125
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1126 conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1127 conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1128
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1129 conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1130 conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1131 conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1132
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1133 conf->upstream.pass_request_headers = NGX_CONF_UNSET;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1134 conf->upstream.pass_request_body = NGX_CONF_UNSET;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1135
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1136 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1137 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1138
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1139 conf->upstream.intercept_errors = NGX_CONF_UNSET;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1140
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1141 /* "uwsgi_cyclic_temp_file" is disabled */
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1142 conf->upstream.cyclic_temp_file = 0;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1143
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1144 return conf;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1145 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1146
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1147
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1148 static char *
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1149 ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1150 {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1151 ngx_http_uwsgi_loc_conf_t *prev = parent;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1152 ngx_http_uwsgi_loc_conf_t *conf = child;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1153
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1154 u_char *p;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1155 size_t size;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1156 uintptr_t *code;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1157 ngx_uint_t i;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1158 ngx_keyval_t *src;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1159 ngx_hash_init_t hash;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1160 ngx_http_script_compile_t sc;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1161 ngx_http_script_copy_code_t *copy;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1162
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1163 if (conf->upstream.store != 0) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1164 ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1165
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1166 if (conf->upstream.store_lengths == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1167 conf->upstream.store_lengths = prev->upstream.store_lengths;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1168 conf->upstream.store_values = prev->upstream.store_values;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1169 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1170 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1171
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1172 ngx_conf_merge_uint_value(conf->upstream.store_access,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1173 prev->upstream.store_access, 0600);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1174
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1175 ngx_conf_merge_value(conf->upstream.buffering,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1176 prev->upstream.buffering, 1);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1177
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1178 ngx_conf_merge_value(conf->upstream.ignore_client_abort,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1179 prev->upstream.ignore_client_abort, 0);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1180
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1181 ngx_conf_merge_msec_value(conf->upstream.connect_timeout,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1182 prev->upstream.connect_timeout, 60000);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1183
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1184 ngx_conf_merge_msec_value(conf->upstream.send_timeout,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1185 prev->upstream.send_timeout, 60000);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1186
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1187 ngx_conf_merge_msec_value(conf->upstream.read_timeout,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1188 prev->upstream.read_timeout, 60000);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1189
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1190 ngx_conf_merge_size_value(conf->upstream.send_lowat,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1191 prev->upstream.send_lowat, 0);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1192
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1193 ngx_conf_merge_size_value(conf->upstream.buffer_size,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1194 prev->upstream.buffer_size,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1195 (size_t) ngx_pagesize);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1196
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1197
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1198 ngx_conf_merge_bufs_value(conf->upstream.bufs, prev->upstream.bufs,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1199 8, ngx_pagesize);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1200
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1201 if (conf->upstream.bufs.num < 2) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1202 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1203 "there must be at least 2 \"uwsgi_buffers\"");
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1204 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1205 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1206
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1207
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1208 size = conf->upstream.buffer_size;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1209 if (size < conf->upstream.bufs.size) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1210 size = conf->upstream.bufs.size;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1211 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1212
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1213
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1214 ngx_conf_merge_size_value(conf->upstream.busy_buffers_size_conf,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1215 prev->upstream.busy_buffers_size_conf,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1216 NGX_CONF_UNSET_SIZE);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1217
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1218 if (conf->upstream.busy_buffers_size_conf == NGX_CONF_UNSET_SIZE) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1219 conf->upstream.busy_buffers_size = 2 * size;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1220 } else {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1221 conf->upstream.busy_buffers_size =
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1222 conf->upstream.busy_buffers_size_conf;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1223 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1224
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1225 if (conf->upstream.busy_buffers_size < size) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1226 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1227 "\"uwsgi_busy_buffers_size\" must be equal or bigger "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1228 "than maximum of the value of \"uwsgi_buffer_size\" and "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1229 "one of the \"uwsgi_buffers\"");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1230
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1231 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1232 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1233
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1234 if (conf->upstream.busy_buffers_size
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1235 > (conf->upstream.bufs.num - 1) * conf->upstream.bufs.size)
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1236 {
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1237 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1238 "\"uwsgi_busy_buffers_size\" must be less than "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1239 "the size of all \"uwsgi_buffers\" minus one buffer");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1240
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1241 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1242 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1243
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1244
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1245 ngx_conf_merge_size_value(conf->upstream.temp_file_write_size_conf,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1246 prev->upstream.temp_file_write_size_conf,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1247 NGX_CONF_UNSET_SIZE);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1248
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1249 if (conf->upstream.temp_file_write_size_conf == NGX_CONF_UNSET_SIZE) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1250 conf->upstream.temp_file_write_size = 2 * size;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1251 } else {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1252 conf->upstream.temp_file_write_size =
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1253 conf->upstream.temp_file_write_size_conf;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1254 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1255
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1256 if (conf->upstream.temp_file_write_size < size) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1257 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1258 "\"uwsgi_temp_file_write_size\" must be equal or bigger than "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1259 "maximum of the value of \"uwsgi_buffer_size\" and "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1260 "one of the \"uwsgi_buffers\"");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1261
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1262 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1263 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1264
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1265
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1266 ngx_conf_merge_size_value(conf->upstream.max_temp_file_size_conf,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1267 prev->upstream.max_temp_file_size_conf,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1268 NGX_CONF_UNSET_SIZE);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1269
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1270 if (conf->upstream.max_temp_file_size_conf == NGX_CONF_UNSET_SIZE) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1271 conf->upstream.max_temp_file_size = 1024 * 1024 * 1024;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1272 } else {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1273 conf->upstream.max_temp_file_size =
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1274 conf->upstream.max_temp_file_size_conf;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1275 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1276
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1277 if (conf->upstream.max_temp_file_size != 0
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1278 && conf->upstream.max_temp_file_size < size) {
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1279 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1280 "\"uwsgi_max_temp_file_size\" must be equal to zero to disable "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1281 "the temporary files usage or must be equal or bigger than "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1282 "maximum of the value of \"uwsgi_buffer_size\" and "
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1283 "one of the \"uwsgi_buffers\"");
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1284
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1285 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1286 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1287
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1288
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1289 ngx_conf_merge_bitmask_value(conf->upstream.ignore_headers,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1290 prev->upstream.ignore_headers,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1291 NGX_CONF_BITMASK_SET);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1292
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1293
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1294 ngx_conf_merge_bitmask_value(conf->upstream.next_upstream,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1295 prev->upstream.next_upstream,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1296 (NGX_CONF_BITMASK_SET
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1297 |NGX_HTTP_UPSTREAM_FT_ERROR
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1298 |NGX_HTTP_UPSTREAM_FT_TIMEOUT));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1299
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1300 if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1301 conf->upstream.next_upstream = NGX_CONF_BITMASK_SET
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1302 |NGX_HTTP_UPSTREAM_FT_OFF;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1303 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1304
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1305 if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1306 prev->upstream.temp_path,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1307 &ngx_http_uwsgi_temp_path)
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1308 != NGX_OK)
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1309 {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1310 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1311 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1312
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1313 ngx_conf_merge_value(conf->upstream.pass_request_headers,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1314 prev->upstream.pass_request_headers, 1);
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1315 ngx_conf_merge_value(conf->upstream.pass_request_body,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1316 prev->upstream.pass_request_body, 1);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1317
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1318 ngx_conf_merge_value(conf->upstream.intercept_errors,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1319 prev->upstream.intercept_errors, 0);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1320
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1321 ngx_conf_merge_str_value(conf->uwsgi_string, prev->uwsgi_string, "");
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1322
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1323 hash.max_size = 512;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1324 hash.bucket_size = ngx_align(64, ngx_cacheline_size);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1325 hash.name = "uwsgi_hide_headers_hash";
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1326
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1327 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1328 &prev->upstream,
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1329 ngx_http_uwsgi_hide_headers, &hash)
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1330 != NGX_OK)
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1331 {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1332 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1333 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1334
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1335 if (conf->upstream.upstream == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1336 conf->upstream.upstream = prev->upstream.upstream;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1337 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1338
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1339 if (conf->uwsgi_lengths == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1340 conf->uwsgi_lengths = prev->uwsgi_lengths;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1341 conf->uwsgi_values = prev->uwsgi_values;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1342 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1343
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1344 if (conf->modifier1 == 0) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1345 conf->modifier1 = prev->modifier1;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1346 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1347
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1348 if (conf->modifier2 == 0) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1349 conf->modifier2 = prev->modifier2;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1350 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1351
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1352 if (conf->params_source == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1353 conf->flushes = prev->flushes;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1354 conf->params_len = prev->params_len;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1355 conf->params = prev->params;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1356 conf->params_source = prev->params_source;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1357
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1358 if (conf->params_source == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1359 return NGX_CONF_OK;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1360 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1361 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1362
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1363 conf->params_len = ngx_array_create(cf->pool, 64, 1);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1364 if (conf->params_len == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1365 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1366 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1367
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1368 conf->params = ngx_array_create(cf->pool, 512, 1);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1369 if (conf->params == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1370 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1371 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1372
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1373 src = conf->params_source->elts;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1374 for (i = 0; i < conf->params_source->nelts; i++) {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1375
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1376 copy = ngx_array_push_n(conf->params_len,
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1377 sizeof(ngx_http_script_copy_code_t));
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1378 if (copy == NULL) {
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1379 return NGX_CONF_ERROR;
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1380 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1381
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1382 copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1383 copy->len = src[i].key.len;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1384
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1385
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1386 size = (sizeof(ngx_http_script_copy_code_t)
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1387 + src[i].key.len + sizeof(uintptr_t) - 1)
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1388 & ~(sizeof(uintptr_t) - 1);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1389
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1390 copy = ngx_array_push_n(conf->params, size);
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1391 if (copy == NULL) {
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1392 return NGX_CONF_ERROR;
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1393 }
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1394
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1395 copy->code = ngx_http_script_copy_code;
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1396 copy->len = src[i].key.len;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1397
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1398 p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1399 ngx_memcpy(p, src[i].key.data, src[i].key.len);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1400
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1401
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1402 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1403
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1404 sc.cf = cf;
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1405 sc.source = &src[i].value;
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1406 sc.flushes = &conf->flushes;
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1407 sc.lengths = &conf->params_len;
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1408 sc.values = &conf->params;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1409
3548
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1410 if (ngx_http_script_compile(&sc) != NGX_OK) {
fc7541a6959d fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents: 3547
diff changeset
1411 return NGX_CONF_ERROR;
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1412 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1413
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1414 code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1415 if (code == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1416 return NGX_CONF_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1417 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1418
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1419 *code = (uintptr_t) NULL;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1420
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1421
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1422 code = ngx_array_push_n(conf->params, sizeof(uintptr_t));
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1423 if (code == NULL) {
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1424 return NGX_CONF_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1425 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1426
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1427 *code = (uintptr_t) NULL;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1428 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1429
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1430 code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1431 if (code == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1432 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1433 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1434
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1435 *code = (uintptr_t) NULL;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1436
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1437 return NGX_CONF_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1438 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1439
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1440
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1441 static char *
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1442 ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1443 {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1444 ngx_http_uwsgi_loc_conf_t *uwcf = conf;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1445
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1446 ngx_url_t u;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1447 ngx_str_t *value, *url;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1448 ngx_uint_t n;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1449 ngx_http_core_loc_conf_t *clcf;
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1450 ngx_http_script_compile_t sc;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1451
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1452 if (uwcf->upstream.upstream || uwcf->uwsgi_lengths) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1453 return "is duplicate";
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1454 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1455
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1456 clcf = ngx_http_conf_get_module_loc_conf (cf, ngx_http_core_module);
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1457 clcf->handler = ngx_http_uwsgi_handler;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1458
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1459 value = cf->args->elts;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1460
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1461 url = &value[1];
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1462
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1463 n = ngx_http_script_variables_count(url);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1464
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1465 if (n) {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1466
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1467 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1468
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1469 sc.cf = cf;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1470 sc.source = url;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1471 sc.lengths = &uwcf->uwsgi_lengths;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1472 sc.values = &uwcf->uwsgi_values;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1473 sc.variables = n;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1474 sc.complete_lengths = 1;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1475 sc.complete_values = 1;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1476
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1477 if (ngx_http_script_compile(&sc) != NGX_OK) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1478 return NGX_CONF_ERROR;
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1479 }
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1480
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1481 return NGX_CONF_OK;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1482 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1483
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1484 ngx_memzero(&u, sizeof(ngx_url_t));
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1485
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1486 u.url = value[1];
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1487 u.no_resolve = 1;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1488
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1489 uwcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1490 if (uwcf->upstream.upstream == NULL) {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1491 return NGX_CONF_ERROR;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1492 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1493
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1494 if (clcf->name.data[clcf->name.len - 1] == '/') {
3542
9bf51b3fc1c1 style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents: 3541
diff changeset
1495 clcf->auto_redirect = 1;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1496 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1497
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1498 return NGX_CONF_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1499 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1500
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1501
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1502 static char *
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1503 ngx_http_uwsgi_modifier1(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1504 {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1505 ngx_http_uwsgi_loc_conf_t *uwcf = conf;
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1506 ngx_str_t *value;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1507
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1508 value = cf->args->elts;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1509
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1510 uwcf->modifier1 = (u_char) ngx_atoi(value[1].data, value[1].len);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1511
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1512 return NGX_CONF_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1513 }
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1514
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1515
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1516 static char *
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1517 ngx_http_uwsgi_modifier2(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1518 {
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1519 ngx_http_uwsgi_loc_conf_t *uwcf = conf;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1520
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1521 ngx_str_t *value;
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1522
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1523 value = cf->args->elts;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1524
3543
e132566a942e fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents: 3542
diff changeset
1525 uwcf->modifier2 = (u_char) ngx_atoi(value[1].data, value[1].len);
3541
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1526
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1527 return NGX_CONF_OK;
21452748d165 import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1528 }