comparison src/http/modules/ngx_http_geo_module.c @ 2398:f2e0e1fa87f0

remove before nginx-0.1.25 compatibility code
author Igor Sysoev <igor@sysoev.ru>
date Thu, 11 Dec 2008 07:48:48 +0000
parents 8522a901df2f
children aecf0755cee3
comparison
equal deleted inserted replaced
2397:da6f70bb41f0 2398:f2e0e1fa87f0
168 static char * 168 static char *
169 ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 169 ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
170 { 170 {
171 char *rv; 171 char *rv;
172 size_t len; 172 size_t len;
173 ngx_str_t *value, name; 173 ngx_str_t *value;
174 ngx_uint_t i; 174 ngx_uint_t i;
175 ngx_conf_t save; 175 ngx_conf_t save;
176 ngx_pool_t *pool; 176 ngx_pool_t *pool;
177 ngx_array_t *a; 177 ngx_array_t *a;
178 ngx_http_variable_t *var; 178 ngx_http_variable_t *var;
179 ngx_http_geo_conf_ctx_t ctx; 179 ngx_http_geo_conf_ctx_t ctx;
180 180
181 value = cf->args->elts; 181 value = cf->args->elts;
182 182
183 name = value[1]; 183 var = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE);
184
185 if (name.data[0] != '$') {
186 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
187 "\"%V\" variable name should start with '$'",
188 &value[1]);
189 } else {
190 name.len--;
191 name.data++;
192 }
193
194 var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
195 if (var == NULL) { 184 if (var == NULL) {
196 return NGX_CONF_ERROR; 185 return NGX_CONF_ERROR;
197 } 186 }
198 187
199 pool = ngx_create_pool(16384, cf->log); 188 pool = ngx_create_pool(16384, cf->log);