comparison src/http/ngx_http_script.c @ 468:56baf312c1b5 NGINX_0_7_46

nginx 0.7.46 *) Bugfix: the previous release tarball was incorrect.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Mar 2009 00:00:00 +0400
parents c8cfb6c462ef
children 392c16f2d858
comparison
equal deleted inserted replaced
467:d46142e61c30 468:56baf312c1b5
30 30
31 static uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL; 31 static uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL;
32 32
33 33
34 void 34 void
35 ngx_http_scrip_flush_complex_value(ngx_http_request_t *r, 35 ngx_http_script_flush_complex_value(ngx_http_request_t *r,
36 ngx_http_complex_value_t *val) 36 ngx_http_complex_value_t *val)
37 { 37 {
38 ngx_uint_t *index; 38 ngx_uint_t *index;
39 39
40 index = val->flushes; 40 index = val->flushes;
65 if (val->lengths == NULL) { 65 if (val->lengths == NULL) {
66 *value = val->value; 66 *value = val->value;
67 return NGX_OK; 67 return NGX_OK;
68 } 68 }
69 69
70 ngx_http_scrip_flush_complex_value(r, val); 70 ngx_http_script_flush_complex_value(r, val);
71 71
72 ngx_memzero(&e, sizeof(ngx_http_script_engine_t)); 72 ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
73 73
74 e.ip = val->lengths; 74 e.ip = val->lengths;
75 e.request = r; 75 e.request = r;
116 if (v->len == 0) { 116 if (v->len == 0) {
117 ngx_conf_log_error(NGX_LOG_EMERG, ccv->cf, 0, "empty parameter"); 117 ngx_conf_log_error(NGX_LOG_EMERG, ccv->cf, 0, "empty parameter");
118 return NGX_ERROR; 118 return NGX_ERROR;
119 } 119 }
120 120
121 nv = 0;
122 nc = 0;
123
124 for (i = 0; i < v->len; i++) {
125 if (v->data[i] == '$') {
126 if (v->data[i + 1] >= '1' && v->data[i + 1] <= '9') {
127 nc++;
128
129 } else {
130 nv++;
131 }
132 }
133 }
134
135 if (v->data[0] != '$' && (ccv->conf_prefix || ccv->root_prefix)) {
136
137 if (ngx_conf_full_name(ccv->cf->cycle, v, ccv->conf_prefix) != NGX_OK) {
138 return NGX_ERROR;
139 }
140
141 ccv->conf_prefix = 0;
142 ccv->root_prefix = 0;
143 }
144
121 ccv->complex_value->value = *v; 145 ccv->complex_value->value = *v;
122 ccv->complex_value->flushes = NULL; 146 ccv->complex_value->flushes = NULL;
123 ccv->complex_value->lengths = NULL; 147 ccv->complex_value->lengths = NULL;
124 ccv->complex_value->values = NULL; 148 ccv->complex_value->values = NULL;
125
126 nv = 0;
127 nc = 0;
128
129 for (i = 0; i < v->len; i++) {
130 if (v->data[i] == '$') {
131 if (v->data[i + 1] >= '1' && v->data[i + 1] <= '9') {
132 nc++;
133
134 } else {
135 nv++;
136 }
137 }
138 }
139
140 if (v->data[0] != '$' && (ccv->conf_prefix || ccv->root_prefix)) {
141
142 if (ngx_conf_full_name(ccv->cf->cycle, v, ccv->conf_prefix) != NGX_OK) {
143 return NGX_ERROR;
144 }
145
146 ccv->conf_prefix = 0;
147 ccv->root_prefix = 0;
148 }
149 149
150 if (nv == 0 && nc == 0) { 150 if (nv == 0 && nc == 0) {
151 return NGX_OK; 151 return NGX_OK;
152 } 152 }
153 153