Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 1149:b8fe8a80e019
the "include" support inside the "types" directive
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 29 Mar 2007 10:27:24 +0000 |
parents | 3a95870b3229 |
children | 39a3aa08eefe |
comparison
equal
deleted
inserted
replaced
1148:3a95870b3229 | 1149:b8fe8a80e019 |
---|---|
1896 static char * | 1896 static char * |
1897 ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) | 1897 ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) |
1898 { | 1898 { |
1899 ngx_http_core_loc_conf_t *lcf = conf; | 1899 ngx_http_core_loc_conf_t *lcf = conf; |
1900 | 1900 |
1901 ngx_str_t *value, *content_type, *old; | 1901 ngx_str_t *value, *content_type, *old, file; |
1902 ngx_uint_t i, n; | 1902 ngx_uint_t i, n; |
1903 ngx_hash_key_t *type; | 1903 ngx_hash_key_t *type; |
1904 | |
1905 value = cf->args->elts; | |
1906 | |
1907 if (ngx_strcmp(value[0].data, "include") == 0) { | |
1908 file = value[1]; | |
1909 | |
1910 if (ngx_conf_full_name(cf->cycle, &file) == NGX_ERROR){ | |
1911 return NGX_CONF_ERROR; | |
1912 } | |
1913 | |
1914 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); | |
1915 | |
1916 return ngx_conf_parse(cf, &file); | |
1917 } | |
1904 | 1918 |
1905 content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t)); | 1919 content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t)); |
1906 if (content_type == NULL) { | 1920 if (content_type == NULL) { |
1907 return NGX_CONF_ERROR; | 1921 return NGX_CONF_ERROR; |
1908 } | 1922 } |
1909 | 1923 |
1910 value = cf->args->elts; | |
1911 *content_type = value[0]; | 1924 *content_type = value[0]; |
1912 | 1925 |
1913 for (i = 1; i < cf->args->nelts; i++) { | 1926 for (i = 1; i < cf->args->nelts; i++) { |
1914 | 1927 |
1915 for (n = 0; n < value[i].len; n++) { | 1928 for (n = 0; n < value[i].len; n++) { |