comparison src/http/ngx_http_script.c @ 482:392c16f2d858 NGINX_0_7_53

nginx 0.7.53 *) Change: now a log set by --error-log-path is created from the very start-up. *) Feature: now the start up errors and warnings are outputted to an error_log and stderr. *) Feature: the empty --prefix= configure parameter forces nginx to use a directory where it was run as prefix. *) Feature: the -p switch. *) Feature: the -s switch on Unix platforms. *) Feature: the -? and -h switches. Thanks to Jerome Loyet. *) Feature: now switches may be set in condensed form. *) Bugfix: nginx/Windows did not work if configuration file was given by the -c switch. *) Bugfix: temporary files might be not removed if the "proxy_store", "fastcgi_store", "proxy_cache", or "fastcgi_cache" were used. Thanks to Maxim Dounin. *) Bugfix: an incorrect value was passed to mail proxy authentication server in "Auth-Method" header line; the bug had appeared in 0.7.34. Thanks to Simon Lecaille. *) Bugfix: system error text descriptions were not logged on Linux; the bug had appeared in 0.7.45. *) Bugfix: the "fastcgi_cache_min_uses" directive did not work. Thanks to Andrew Vorobyoff.
author Igor Sysoev <http://sysoev.ru>
date Mon, 27 Apr 2009 00:00:00 +0400
parents 56baf312c1b5
children f39b9e29530d
comparison
equal deleted inserted replaced
481:0c98173187ac 482:392c16f2d858
1211 if (code == NULL) { 1211 if (code == NULL) {
1212 return NGX_ERROR; 1212 return NGX_ERROR;
1213 } 1213 }
1214 1214
1215 code->code = (ngx_http_script_code_pt) ngx_http_script_full_name_len_code; 1215 code->code = (ngx_http_script_code_pt) ngx_http_script_full_name_len_code;
1216 code->prefix = sc->conf_prefix; 1216 code->conf_prefix = sc->conf_prefix;
1217 1217
1218 code = ngx_http_script_add_code(*sc->values, 1218 code = ngx_http_script_add_code(*sc->values,
1219 sizeof(ngx_http_script_full_name_code_t), 1219 sizeof(ngx_http_script_full_name_code_t),
1220 &sc->main); 1220 &sc->main);
1221 if (code == NULL) { 1221 if (code == NULL) {
1222 return NGX_ERROR; 1222 return NGX_ERROR;
1223 } 1223 }
1224 1224
1225 code->code = ngx_http_script_full_name_code; 1225 code->code = ngx_http_script_full_name_code;
1226 code->prefix = sc->conf_prefix; 1226 code->conf_prefix = sc->conf_prefix;
1227 1227
1228 return NGX_OK; 1228 return NGX_OK;
1229 } 1229 }
1230 1230
1231 1231
1236 1236
1237 code = (ngx_http_script_full_name_code_t *) e->ip; 1237 code = (ngx_http_script_full_name_code_t *) e->ip;
1238 1238
1239 e->ip += sizeof(ngx_http_script_full_name_code_t); 1239 e->ip += sizeof(ngx_http_script_full_name_code_t);
1240 1240
1241 return code->prefix ? sizeof(NGX_CONF_PREFIX) : ngx_cycle->root.len; 1241 return code->conf_prefix ? ngx_cycle->conf_prefix.len:
1242 ngx_cycle->prefix.len;
1242 } 1243 }
1243 1244
1244 1245
1245 static void 1246 static void
1246 ngx_http_script_full_name_code(ngx_http_script_engine_t *e) 1247 ngx_http_script_full_name_code(ngx_http_script_engine_t *e)
1252 code = (ngx_http_script_full_name_code_t *) e->ip; 1253 code = (ngx_http_script_full_name_code_t *) e->ip;
1253 1254
1254 value.data = e->buf.data; 1255 value.data = e->buf.data;
1255 value.len = e->pos - e->buf.data; 1256 value.len = e->pos - e->buf.data;
1256 1257
1257 if (ngx_conf_full_name((ngx_cycle_t *) ngx_cycle, &value, code->prefix) 1258 if (ngx_conf_full_name((ngx_cycle_t *) ngx_cycle, &value, code->conf_prefix)
1258 != NGX_OK) 1259 != NGX_OK)
1259 { 1260 {
1260 e->ip = ngx_http_script_exit; 1261 e->ip = ngx_http_script_exit;
1261 e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; 1262 e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
1262 return; 1263 return;
1411 ngx_memzero(&of, sizeof(ngx_open_file_info_t)); 1412 ngx_memzero(&of, sizeof(ngx_open_file_info_t));
1412 1413
1413 of.directio = clcf->directio; 1414 of.directio = clcf->directio;
1414 of.valid = clcf->open_file_cache_valid; 1415 of.valid = clcf->open_file_cache_valid;
1415 of.min_uses = clcf->open_file_cache_min_uses; 1416 of.min_uses = clcf->open_file_cache_min_uses;
1417 of.test_only = 1;
1416 of.errors = clcf->open_file_cache_errors; 1418 of.errors = clcf->open_file_cache_errors;
1417 of.events = clcf->open_file_cache_events; 1419 of.events = clcf->open_file_cache_events;
1418 1420
1419 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) 1421 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
1420 != NGX_OK) 1422 != NGX_OK)
1421 { 1423 {
1422 if (of.err != NGX_ENOENT && of.err != NGX_ENOTDIR) { 1424 if (of.err != NGX_ENOENT && of.err != NGX_ENOTDIR) {
1423 ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, 1425 ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
1424 ngx_file_info_n " \"%s\" failed", value->data); 1426 "%s \"%s\" failed", of.failed, value->data);
1425 } 1427 }
1426 1428
1427 switch (code->op) { 1429 switch (code->op) {
1428 1430
1429 case ngx_http_script_file_plain: 1431 case ngx_http_script_file_plain: