Mercurial > hg > nginx
comparison src/http/modules/ngx_http_log_module.c @ 4517:50143b8fb95f stable-1.0
Merge of r4500: fixed spelling in single-line comments.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 05 Mar 2012 13:26:40 +0000 |
parents | 4919fb357a5d |
children |
comparison
equal
deleted
inserted
replaced
4516:b927410d9638 | 4517:50143b8fb95f |
---|---|
159 NULL, /* init main configuration */ | 159 NULL, /* init main configuration */ |
160 | 160 |
161 NULL, /* create server configuration */ | 161 NULL, /* create server configuration */ |
162 NULL, /* merge server configuration */ | 162 NULL, /* merge server configuration */ |
163 | 163 |
164 ngx_http_log_create_loc_conf, /* create location configration */ | 164 ngx_http_log_create_loc_conf, /* create location configuration */ |
165 ngx_http_log_merge_loc_conf /* merge location configration */ | 165 ngx_http_log_merge_loc_conf /* merge location configuration */ |
166 }; | 166 }; |
167 | 167 |
168 | 168 |
169 ngx_module_t ngx_http_log_module = { | 169 ngx_module_t ngx_http_log_module = { |
170 NGX_MODULE_V1, | 170 NGX_MODULE_V1, |
373 ngx_http_log_loc_conf_t *llcf; | 373 ngx_http_log_loc_conf_t *llcf; |
374 ngx_http_core_loc_conf_t *clcf; | 374 ngx_http_core_loc_conf_t *clcf; |
375 | 375 |
376 if (!r->root_tested) { | 376 if (!r->root_tested) { |
377 | 377 |
378 /* test root directory existance */ | 378 /* test root directory existence */ |
379 | 379 |
380 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { | 380 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { |
381 /* simulate successfull logging */ | 381 /* simulate successful logging */ |
382 return len; | 382 return len; |
383 } | 383 } |
384 | 384 |
385 path.data[root] = '\0'; | 385 path.data[root] = '\0'; |
386 | 386 |
397 | 397 |
398 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) | 398 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) |
399 != NGX_OK) | 399 != NGX_OK) |
400 { | 400 { |
401 if (of.err == 0) { | 401 if (of.err == 0) { |
402 /* simulate successfull logging */ | 402 /* simulate successful logging */ |
403 return len; | 403 return len; |
404 } | 404 } |
405 | 405 |
406 ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, | 406 ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, |
407 "testing \"%s\" existence failed", path.data); | 407 "testing \"%s\" existence failed", path.data); |
408 | 408 |
409 /* simulate successfull logging */ | 409 /* simulate successful logging */ |
410 return len; | 410 return len; |
411 } | 411 } |
412 | 412 |
413 if (!of.is_dir) { | 413 if (!of.is_dir) { |
414 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR, | 414 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR, |
415 "testing \"%s\" existence failed", path.data); | 415 "testing \"%s\" existence failed", path.data); |
416 | 416 |
417 /* simulate successfull logging */ | 417 /* simulate successful logging */ |
418 return len; | 418 return len; |
419 } | 419 } |
420 } | 420 } |
421 | 421 |
422 if (ngx_http_script_run(r, &log, script->lengths->elts, 1, | 422 if (ngx_http_script_run(r, &log, script->lengths->elts, 1, |
423 script->values->elts) | 423 script->values->elts) |
424 == NULL) | 424 == NULL) |
425 { | 425 { |
426 /* simulate successfull logging */ | 426 /* simulate successful logging */ |
427 return len; | 427 return len; |
428 } | 428 } |
429 | 429 |
430 log.data[log.len - 1] = '\0'; | 430 log.data[log.len - 1] = '\0'; |
431 *name = log.data; | 431 *name = log.data; |
445 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) | 445 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) |
446 != NGX_OK) | 446 != NGX_OK) |
447 { | 447 { |
448 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, | 448 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, |
449 "%s \"%s\" failed", of.failed, log.data); | 449 "%s \"%s\" failed", of.failed, log.data); |
450 /* simulate successfull logging */ | 450 /* simulate successful logging */ |
451 return len; | 451 return len; |
452 } | 452 } |
453 | 453 |
454 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 454 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
455 "http log #%d", of.fd); | 455 "http log #%d", of.fd); |