comparison src/http/modules/ngx_http_fastcgi_module.c @ 284:3dbecd747fbb NGINX_0_5_12

nginx 0.5.12 *) Bugfix: nginx could not be built on platforms different from i386, amd64, sparc и ppc; bug appeared in 0.5.8. *) Bugfix: a segmentation fault might occur in worker process if the temporarily files were used while working with FastCGI server; bug appeared in 0.5.8. *) Bugfix: a segmentation fault might occur in worker process if the $fastcgi_script_name variable was logged. *) Bugfix: ngx_http_perl_module could not be built on Solaris.
author Igor Sysoev <http://sysoev.ru>
date Mon, 12 Feb 2007 00:00:00 +0300
parents c5c2b2883984
children 0b1cc3960e27
comparison
equal deleted inserted replaced
283:48810289fcb1 284:3dbecd747fbb
1967 ngx_http_variable_value_t *v, uintptr_t data) 1967 ngx_http_variable_value_t *v, uintptr_t data)
1968 { 1968 {
1969 u_char *p; 1969 u_char *p;
1970 ngx_http_fastcgi_loc_conf_t *flcf; 1970 ngx_http_fastcgi_loc_conf_t *flcf;
1971 1971
1972 v->valid = 1; 1972 if (r->uri.len) {
1973 v->no_cachable = 0; 1973 v->valid = 1;
1974 v->not_found = 0; 1974 v->no_cachable = 0;
1975 1975 v->not_found = 0;
1976 flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module); 1976
1977 1977 flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
1978 if (r->uri.data[r->uri.len - 1] != '/') { 1978
1979 v->len = r->uri.len; 1979 if (r->uri.data[r->uri.len - 1] != '/') {
1980 v->data = r->uri.data; 1980 v->len = r->uri.len;
1981 v->data = r->uri.data;
1982 return NGX_OK;
1983 }
1984
1985 v->len = r->uri.len + flcf->index.len;
1986
1987 v->data = ngx_palloc(r->pool, v->len);
1988 if (v->data == NULL) {
1989 return NGX_ERROR;
1990 }
1991
1992 p = ngx_copy(v->data, r->uri.data, r->uri.len);
1993 ngx_memcpy(p, flcf->index.data, flcf->index.len);
1994
1995 } else {
1996 v->len = 0;
1997 v->valid = 1;
1998 v->no_cachable = 0;
1999 v->not_found = 0;
2000 v->data = NULL;
2001
1981 return NGX_OK; 2002 return NGX_OK;
1982 } 2003 }
1983
1984 v->len = r->uri.len + flcf->index.len;
1985
1986 v->data = ngx_palloc(r->pool, v->len);
1987 if (v->data == NULL) {
1988 return NGX_ERROR;
1989 }
1990
1991 p = ngx_copy(v->data, r->uri.data, r->uri.len);
1992 ngx_memcpy(p, flcf->index.data, flcf->index.len);
1993 2004
1994 return NGX_OK; 2005 return NGX_OK;
1995 } 2006 }
1996 2007
1997 2008