Changeset 2ac4f5 for server/src/http/modules/ngx_http_fastcgi_module.c
- Timestamp:
- 02/03/09 19:43:30 (3 years ago)
- Branches:
- master-v0.7, nginx-v0.7, nginx-v0.8, upstream_count_limit
- Children:
- 8310b2
- Parents:
- e7b311
- git-author:
- George Potapov <nephrite@…> (02/03/09 19:43:30)
- git-committer:
- George Potapov <nephrite@…> (02/03/09 19:43:30)
- File:
-
- 1 edited
-
server/src/http/modules/ngx_http_fastcgi_module.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
server/src/http/modules/ngx_http_fastcgi_module.c
re7b311 r2ac4f5 136 136 static ngx_int_t ngx_http_fastcgi_path_info_variable(ngx_http_request_t *r, 137 137 ngx_http_variable_value_t *v, uintptr_t data); 138 static ngx_ int_tngx_http_fastcgi_split(ngx_http_request_t *r,139 ngx_http_fastcgi_ ctx_t *f, ngx_http_fastcgi_loc_conf_t *flcf);138 static ngx_http_fastcgi_ctx_t *ngx_http_fastcgi_split(ngx_http_request_t *r, 139 ngx_http_fastcgi_loc_conf_t *flcf); 140 140 141 141 static char *ngx_http_fastcgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, … … 2112 2112 ngx_http_fastcgi_loc_conf_t *flcf; 2113 2113 2114 f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);2115 2114 flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module); 2116 2115 2117 if (ngx_http_fastcgi_split(r, f, flcf) != NGX_OK) { 2116 f = ngx_http_fastcgi_split(r, flcf); 2117 2118 if (f == NULL) { 2118 2119 return NGX_ERROR; 2119 2120 } … … 2152 2153 ngx_http_fastcgi_loc_conf_t *flcf; 2153 2154 2154 f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);2155 2155 flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module); 2156 2156 2157 if (ngx_http_fastcgi_split(r, f, flcf) != NGX_OK) { 2157 f = ngx_http_fastcgi_split(r, flcf); 2158 2159 if (f == NULL) { 2158 2160 return NGX_ERROR; 2159 2161 } … … 2169 2171 2170 2172 2171 static ngx_int_t 2172 ngx_http_fastcgi_split(ngx_http_request_t *r, ngx_http_fastcgi_ctx_t *f, 2173 ngx_http_fastcgi_loc_conf_t *flcf) 2173 static ngx_http_fastcgi_ctx_t * 2174 ngx_http_fastcgi_split(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf) 2174 2175 { 2176 ngx_http_fastcgi_ctx_t *f; 2175 2177 #if (NGX_PCRE) 2176 ngx_int_t n; 2177 int captures[(1 + 2) * 3]; 2178 ngx_int_t n; 2179 int captures[(1 + 2) * 3]; 2180 2181 f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module); 2182 2183 if (f == NULL) { 2184 f = ngx_pcalloc(r->pool, sizeof(ngx_http_fastcgi_ctx_t)); 2185 if (f == NULL) { 2186 return NULL; 2187 } 2188 2189 ngx_http_set_ctx(r, f, ngx_http_fastcgi_module); 2190 } 2178 2191 2179 2192 if (f->script_name.len) { 2180 return NGX_OK;2193 return f; 2181 2194 } 2182 2195 2183 2196 if (flcf->split_regex == NULL) { 2184 2197 f->script_name = r->uri; 2185 return NGX_OK;2198 return f; 2186 2199 } 2187 2200 … … 2190 2203 if (n == NGX_REGEX_NO_MATCHED) { 2191 2204 f->script_name = r->uri; 2192 return NGX_OK;2205 return f; 2193 2206 } 2194 2207 … … 2197 2210 ngx_regex_exec_n " failed: %d on \"%V\" using \"%V\"", 2198 2211 n, &r->uri, &flcf->split_name); 2199 return N GX_ERROR;2212 return NULL; 2200 2213 } 2201 2214 … … 2208 2221 f->path_info.data = r->uri.data + f->script_name.len; 2209 2222 2210 return NGX_OK;2223 return f; 2211 2224 2212 2225 #else 2213 2226 2227 f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module); 2228 2229 if (f == NULL) { 2230 f = ngx_pcalloc(r->pool, sizeof(ngx_http_fastcgi_ctx_t)); 2231 if (f == NULL) { 2232 return NULL; 2233 } 2234 2235 ngx_http_set_ctx(r, f, ngx_http_fastcgi_module); 2236 } 2237 2214 2238 f->script_name = r->uri; 2215 2239 2216 return NGX_OK;2240 return f; 2217 2241 2218 2242 #endif
Note: See TracChangeset
for help on using the changeset viewer.
