Mercurial > hg > nginx
comparison src/http/ngx_http.c @ 499:64d9afb209da release-0.1.24
nginx-0.1.24-RELEASE import
*) Feature: the ngx_http_ssi_filter_module supports the QUERY_STRING
and DOCUMENT_URI variables.
*) Bugfix: the ngx_http_autoindex_module may some times return the 404
response for existent directory, if this directory was used in
"alias" directive.
*) Bugfix: the ngx_http_ssi_filter_module ran incorrectly for large
responses.
*) Bugfix: the lack of the "Referer" header line was always accounted
as valid referrer.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 04 Mar 2005 14:06:57 +0000 |
parents | 4ebe09b07e30 |
children | d4ea69372b94 |
comparison
equal
deleted
inserted
replaced
498:58fcf570b0cb | 499:64d9afb209da |
---|---|
11 | 11 |
12 | 12 |
13 static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); | 13 static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
14 static int ngx_cmp_server_names(const void *one, const void *two); | 14 static int ngx_cmp_server_names(const void *one, const void *two); |
15 static ngx_int_t ngx_http_add_address(ngx_conf_t *cf, | 15 static ngx_int_t ngx_http_add_address(ngx_conf_t *cf, |
16 ngx_http_in_port_t *in_port, | 16 ngx_http_in_port_t *in_port, ngx_http_listen_t *lscf, |
17 ngx_http_listen_t *lscf, | 17 ngx_http_core_srv_conf_t *cscf); |
18 ngx_http_core_srv_conf_t *cscf); | |
19 static ngx_int_t ngx_http_add_names(ngx_conf_t *cf, | 18 static ngx_int_t ngx_http_add_names(ngx_conf_t *cf, |
20 ngx_http_in_addr_t *in_addr, | 19 ngx_http_in_addr_t *in_addr, ngx_http_core_srv_conf_t *cscf); |
21 ngx_http_core_srv_conf_t *cscf); | |
22 | |
23 static char *ngx_http_merge_locations(ngx_conf_t *cf, | 20 static char *ngx_http_merge_locations(ngx_conf_t *cf, |
24 ngx_array_t *locations, | 21 ngx_array_t *locations, void **loc_conf, ngx_http_module_t *module, |
25 void **loc_conf, | 22 ngx_uint_t ctx_index); |
26 ngx_http_module_t *module, | |
27 ngx_uint_t ctx_index); | |
28 | 23 |
29 ngx_uint_t ngx_http_max_module; | 24 ngx_uint_t ngx_http_max_module; |
30 | 25 |
31 ngx_uint_t ngx_http_total_requests; | 26 ngx_uint_t ngx_http_total_requests; |
32 uint64_t ngx_http_total_sent; | 27 uint64_t ngx_http_total_sent; |
36 ngx_int_t (*ngx_http_top_body_filter) (ngx_http_request_t *r, ngx_chain_t *ch); | 31 ngx_int_t (*ngx_http_top_body_filter) (ngx_http_request_t *r, ngx_chain_t *ch); |
37 | 32 |
38 | 33 |
39 static ngx_command_t ngx_http_commands[] = { | 34 static ngx_command_t ngx_http_commands[] = { |
40 | 35 |
41 {ngx_string("http"), | 36 { ngx_string("http"), |
42 NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, | 37 NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, |
43 ngx_http_block, | 38 ngx_http_block, |
44 0, | 39 0, |
45 0, | 40 0, |
46 NULL}, | 41 NULL }, |
47 | 42 |
48 ngx_null_command | 43 ngx_null_command |
49 }; | 44 }; |
50 | 45 |
51 | 46 |
52 static ngx_core_module_t ngx_http_module_ctx = { | 47 static ngx_core_module_t ngx_http_module_ctx = { |
53 ngx_string("http"), | 48 ngx_string("http"), |
60 NGX_MODULE, | 55 NGX_MODULE, |
61 &ngx_http_module_ctx, /* module context */ | 56 &ngx_http_module_ctx, /* module context */ |
62 ngx_http_commands, /* module directives */ | 57 ngx_http_commands, /* module directives */ |
63 NGX_CORE_MODULE, /* module type */ | 58 NGX_CORE_MODULE, /* module type */ |
64 NULL, /* init module */ | 59 NULL, /* init module */ |
65 NULL /* init child */ | 60 NULL /* init process */ |
66 }; | 61 }; |
67 | 62 |
68 | 63 |
69 static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 64 static char * |
65 ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
70 { | 66 { |
71 char *rv; | 67 char *rv; |
72 ngx_uint_t mi, m, s, l, p, a, n; | 68 ngx_uint_t mi, m, s, l, p, a, n; |
73 ngx_uint_t port_found, addr_found, virtual_names, key; | 69 ngx_uint_t port_found, addr_found, virtual_names, key; |
74 ngx_conf_t pcf; | 70 ngx_conf_t pcf; |
684 | 680 |
685 return NGX_CONF_OK; | 681 return NGX_CONF_OK; |
686 } | 682 } |
687 | 683 |
688 | 684 |
689 static int ngx_cmp_server_names(const void *one, const void *two) | 685 static int |
686 ngx_cmp_server_names(const void *one, const void *two) | |
690 { | 687 { |
691 ngx_http_server_name_t *first = (ngx_http_server_name_t *) one; | 688 ngx_http_server_name_t *first = (ngx_http_server_name_t *) one; |
692 ngx_http_server_name_t *second = (ngx_http_server_name_t *) two; | 689 ngx_http_server_name_t *second = (ngx_http_server_name_t *) two; |
693 | 690 |
694 return ngx_strcmp(first->name.data, second->name.data); | 691 return ngx_strcmp(first->name.data, second->name.data); |
698 /* | 695 /* |
699 * add the server address, the server names and the server core module | 696 * add the server address, the server names and the server core module |
700 * configurations to the port (in_port) | 697 * configurations to the port (in_port) |
701 */ | 698 */ |
702 | 699 |
703 static ngx_int_t ngx_http_add_address(ngx_conf_t *cf, | 700 static ngx_int_t |
704 ngx_http_in_port_t *in_port, | 701 ngx_http_add_address(ngx_conf_t *cf, ngx_http_in_port_t *in_port, |
705 ngx_http_listen_t *lscf, | 702 ngx_http_listen_t *lscf, ngx_http_core_srv_conf_t *cscf) |
706 ngx_http_core_srv_conf_t *cscf) | |
707 { | 703 { |
708 ngx_http_in_addr_t *in_addr; | 704 ngx_http_in_addr_t *in_addr; |
709 | 705 |
710 if (in_port->addrs.elts == NULL) { | 706 if (in_port->addrs.elts == NULL) { |
711 if (ngx_array_init(&in_port->addrs, cf->pool, 10, | 707 if (ngx_array_init(&in_port->addrs, cf->pool, 10, |
742 /* | 738 /* |
743 * add the server names and the server core module | 739 * add the server names and the server core module |
744 * configurations to the address:port (in_addr) | 740 * configurations to the address:port (in_addr) |
745 */ | 741 */ |
746 | 742 |
747 static ngx_int_t ngx_http_add_names(ngx_conf_t *cf, | 743 static ngx_int_t |
748 ngx_http_in_addr_t *in_addr, | 744 ngx_http_add_names(ngx_conf_t *cf, ngx_http_in_addr_t *in_addr, |
749 ngx_http_core_srv_conf_t *cscf) | 745 ngx_http_core_srv_conf_t *cscf) |
750 { | 746 { |
751 ngx_uint_t i, n; | 747 ngx_uint_t i, n; |
752 ngx_array_t *array; | 748 ngx_array_t *array; |
753 ngx_http_server_name_t *server_names, *name; | 749 ngx_http_server_name_t *server_names, *name; |
754 | 750 |
798 | 794 |
799 return NGX_OK; | 795 return NGX_OK; |
800 } | 796 } |
801 | 797 |
802 | 798 |
803 static char *ngx_http_merge_locations(ngx_conf_t *cf, | 799 static char * |
804 ngx_array_t *locations, | 800 ngx_http_merge_locations(ngx_conf_t *cf, ngx_array_t *locations, |
805 void **loc_conf, | 801 void **loc_conf, ngx_http_module_t *module, ngx_uint_t ctx_index) |
806 ngx_http_module_t *module, | |
807 ngx_uint_t ctx_index) | |
808 { | 802 { |
809 char *rv; | 803 char *rv; |
810 ngx_uint_t i; | 804 ngx_uint_t i; |
811 ngx_http_core_loc_conf_t **clcfp; | 805 ngx_http_core_loc_conf_t **clcfp; |
812 | 806 |