Mercurial > hg > nginx
comparison src/core/ngx_conf_file.c @ 166:389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 30 Oct 2003 08:51:06 +0000 |
parents | d377ee423603 |
children | 8aef3c72e5da |
comparison
equal
deleted
inserted
replaced
165:894a01c6aea3 | 166:389d7ee9fa60 |
---|---|
59 ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno, | 59 ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno, |
60 ngx_stat_fd_n " %s failed", filename->data); | 60 ngx_stat_fd_n " %s failed", filename->data); |
61 } | 61 } |
62 | 62 |
63 ngx_test_null(cf->conf_file->hunk, | 63 ngx_test_null(cf->conf_file->hunk, |
64 ngx_create_temp_hunk(cf->pool, 1024, 0, 0), | 64 ngx_create_temp_hunk(cf->pool, 1024), |
65 NGX_CONF_ERROR); | 65 NGX_CONF_ERROR); |
66 | 66 |
67 cf->conf_file->file.fd = fd; | 67 cf->conf_file->file.fd = fd; |
68 cf->conf_file->file.name.len = filename->len; | 68 cf->conf_file->file.name.len = filename->len; |
69 cf->conf_file->file.name.data = filename->data; | 69 cf->conf_file->file.name.data = filename->data; |
720 } | 720 } |
721 | 721 |
722 | 722 |
723 char *ngx_conf_set_bufs_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 723 char *ngx_conf_set_bufs_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
724 { | 724 { |
725 char *p = conf; | 725 char *p = conf; |
726 | 726 |
727 ngx_str_t *value; | 727 ngx_str_t *value; |
728 ngx_bufs_t *bufs; | 728 ngx_bufs_t *bufs; |
729 | 729 |
730 | 730 |
747 | 747 |
748 return NGX_CONF_OK; | 748 return NGX_CONF_OK; |
749 } | 749 } |
750 | 750 |
751 | 751 |
752 char *ngx_conf_set_bitmask_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
753 { | |
754 char *p = conf; | |
755 | |
756 int *np, i, m; | |
757 ngx_str_t *value; | |
758 ngx_conf_bitmask_t *mask; | |
759 | |
760 | |
761 np = (int *) (p + cmd->offset); | |
762 value = (ngx_str_t *) cf->args->elts; | |
763 mask = cmd->post; | |
764 | |
765 for (i = 1; i < cf->args->nelts; i++) { | |
766 for (m = 0; mask[m].name.len != 0; m++) { | |
767 | |
768 if (mask[m].name.len != value[i].len | |
769 && ngx_strcasecmp(mask[m].name.data, value[i].data) != 0) | |
770 { | |
771 continue; | |
772 } | |
773 | |
774 if (*np & mask[m].mask) { | |
775 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
776 "duplicate value \"%s\"", value[i].data); | |
777 | |
778 } else { | |
779 *np |= mask[m].mask; | |
780 } | |
781 | |
782 break; | |
783 } | |
784 | |
785 if (mask[m].name.len == 0) { | |
786 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
787 "invalid value \"%s\"", value[i].data); | |
788 | |
789 return NGX_CONF_ERROR; | |
790 } | |
791 } | |
792 | |
793 return NGX_CONF_OK; | |
794 } | |
795 | |
796 | |
752 char *ngx_conf_unsupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 797 char *ngx_conf_unsupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
753 { | 798 { |
754 return "unsupported on this platform"; | 799 return "unsupported on this platform"; |
755 } | 800 } |
756 | 801 |