comparison src/core/ngx_conf_file.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 a8424ffa495c
children ed5e10fb40fc
comparison
equal deleted inserted replaced
481:0c98173187ac 482:392c16f2d858
796 { 796 {
797 size_t len; 797 size_t len;
798 u_char *p, *prefix; 798 u_char *p, *prefix;
799 ngx_str_t old; 799 ngx_str_t old;
800 800
801 if (name->data[0] == '/') {
802 return NGX_OK;
803 }
804
805 #if (NGX_WIN32) 801 #if (NGX_WIN32)
806 802
807 if (name->len > 2 803 if (name->len > 2
808 && name->data[1] == ':' 804 && name->data[1] == ':'
809 && ((name->data[0] >= 'a' && name->data[0] <= 'z') 805 && ((name->data[0] >= 'a' && name->data[0] <= 'z')
810 || (name->data[0] >= 'A' && name->data[0] <= 'Z'))) 806 || (name->data[0] >= 'A' && name->data[0] <= 'Z')))
811 { 807 {
812 return NGX_OK; 808 return NGX_OK;
813 } 809 }
814 810
811 #else
812
813 if (name->data[0] == '/') {
814 return NGX_OK;
815 }
816
815 #endif 817 #endif
816 818
817 old = *name; 819 old = *name;
818 820
819 if (conf_prefix) { 821 if (conf_prefix) {
820 len = sizeof(NGX_CONF_PREFIX) - 1; 822 len = cycle->conf_prefix.len;
821 prefix = (u_char *) NGX_CONF_PREFIX; 823 prefix = cycle->conf_prefix.data;
822 824
823 } else { 825 } else {
824 len = cycle->root.len; 826 len = cycle->prefix.len;
825 prefix = cycle->root.data; 827 prefix = cycle->prefix.data;
826 } 828 }
827 829
828 name->len = len + old.len; 830 name->len = len + old.len;
829 name->data = ngx_pnalloc(cycle->pool, name->len + 1); 831 name->data = ngx_pnalloc(cycle->pool, name->len + 1);
830 if (name->data == NULL) { 832 if (name->data == NULL) {
849 #if (NGX_SUPPRESS_WARN) 851 #if (NGX_SUPPRESS_WARN)
850 full.len = 0; 852 full.len = 0;
851 full.data = NULL; 853 full.data = NULL;
852 #endif 854 #endif
853 855
854 if (name) { 856 if (name && name->len) {
855 full = *name; 857 full = *name;
856 858
857 if (ngx_conf_full_name(cycle, &full, 0) != NGX_OK) { 859 if (ngx_conf_full_name(cycle, &full, 0) != NGX_OK) {
858 return NULL; 860 return NULL;
859 } 861 }
885 file = ngx_list_push(&cycle->open_files); 887 file = ngx_list_push(&cycle->open_files);
886 if (file == NULL) { 888 if (file == NULL) {
887 return NULL; 889 return NULL;
888 } 890 }
889 891
890 if (name) { 892 if (name && name->len) {
891 file->fd = NGX_INVALID_FILE; 893 file->fd = NGX_INVALID_FILE;
892 file->name = full; 894 file->name = full;
893 895
894 } else { 896 } else {
895 file->fd = ngx_stderr_fileno; 897 file->fd = ngx_stderr;
896 file->name.len = 0; 898 file->name.len = 0;
897 file->name.data = NULL; 899 file->name.data = NULL;
898 } 900 }
899 901
900 file->buffer = NULL; 902 file->buffer = NULL;