comparison src/http/ngx_http_core_module.c @ 112:408f195b3482 NGINX_0_3_3

nginx 0.3.3 *) Change: the "bl" and "af" parameters of the "listen" directive was renamed to the "backlog" and "accept_filter". *) Feature: the "rcvbuf" and "sndbuf" parameters of the "listen" directive. *) Change: the "$msec" log parameter does not require now the additional the gettimeofday() system call. *) Feature: the -t switch now tests the "listen" directives. *) Bugfix: if the invalid address was specified in the "listen" directive, then after the -HUP signal nginx left an open socket in the CLOSED state. *) Bugfix: the mime type may be incorrectly set to default value for index file with variable in the name; bug appeared in 0.3.0. *) Feature: the "timer_resolution" directive. *) Feature: the millisecond "$upstream_response_time" log parameter. *) Bugfix: a temporary file with client request body now is removed just after the response header was transferred to a client. *) Bugfix: OpenSSL 0.9.6 compatibility. *) Bugfix: the SSL certificate and key file paths could not be relative. *) Bugfix: the "ssl_prefer_server_ciphers" directive did not work in the ngx_imap_ssl_module. *) Bugfix: the "ssl_protocols" directive allowed to specify the single protocol only.
author Igor Sysoev <http://sysoev.ru>
date Wed, 19 Oct 2005 00:00:00 +0400
parents 45f7329b4bd0
children 644a7935144b
comparison
equal deleted inserted replaced
111:a175b609c76d 112:408f195b3482
150 NGX_HTTP_SRV_CONF_OFFSET, 150 NGX_HTTP_SRV_CONF_OFFSET,
151 0, 151 0,
152 NULL }, 152 NULL },
153 153
154 { ngx_string("listen"), 154 { ngx_string("listen"),
155 #if 0
156 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
157 #else
158 NGX_HTTP_SRV_CONF|NGX_CONF_1MORE, 155 NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
159 #endif
160 ngx_http_core_listen, 156 ngx_http_core_listen,
161 NGX_HTTP_SRV_CONF_OFFSET, 157 NGX_HTTP_SRV_CONF_OFFSET,
162 0, 158 0,
163 NULL }, 159 NULL },
164 160
2008 ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 2004 ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
2009 { 2005 {
2010 ngx_http_core_srv_conf_t *scf = conf; 2006 ngx_http_core_srv_conf_t *scf = conf;
2011 2007
2012 char *err; 2008 char *err;
2013 ngx_str_t *value; 2009 ngx_str_t *value, size;
2014 ngx_uint_t n; 2010 ngx_uint_t n;
2015 struct hostent *h; 2011 struct hostent *h;
2016 ngx_http_listen_t *ls; 2012 ngx_http_listen_t *ls;
2017 ngx_inet_upstream_t inet_upstream; 2013 ngx_inet_upstream_t inet_upstream;
2018 2014
2048 ls->port = (in_port_t) (inet_upstream.default_port ? 2044 ls->port = (in_port_t) (inet_upstream.default_port ?
2049 80 : inet_upstream.port); 2045 80 : inet_upstream.port);
2050 ls->file_name = cf->conf_file->file.name; 2046 ls->file_name = cf->conf_file->file.name;
2051 ls->line = cf->conf_file->line; 2047 ls->line = cf->conf_file->line;
2052 ls->conf.backlog = -1; 2048 ls->conf.backlog = -1;
2049 ls->conf.rcvbuf = -1;
2050 ls->conf.sndbuf = -1;
2053 2051
2054 if (inet_upstream.host.len) { 2052 if (inet_upstream.host.len) {
2055 inet_upstream.host.data[inet_upstream.host.len] = '\0'; 2053 inet_upstream.host.data[inet_upstream.host.len] = '\0';
2056 2054
2057 ls->addr = inet_addr((const char *) inet_upstream.host.data); 2055 ls->addr = inet_addr((const char *) inet_upstream.host.data);
2098 if (ngx_strcmp(value[n].data, "bind") == 0) { 2096 if (ngx_strcmp(value[n].data, "bind") == 0) {
2099 ls->conf.bind = 1; 2097 ls->conf.bind = 1;
2100 continue; 2098 continue;
2101 } 2099 }
2102 2100
2103 if (ngx_strncmp(value[n].data, "bl=", 3) == 0) { 2101 if (ngx_strncmp(value[n].data, "backlog=", 8) == 0) {
2104 ls->conf.backlog = ngx_atoi(value[n].data + 3, value[n].len - 3); 2102 ls->conf.backlog = ngx_atoi(value[n].data + 8, value[n].len - 8);
2105 ls->conf.bind = 1; 2103 ls->conf.bind = 1;
2106 2104
2107 if (ls->conf.backlog == NGX_ERROR || ls->conf.backlog == 0) { 2105 if (ls->conf.backlog == NGX_ERROR || ls->conf.backlog == 0) {
2108 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 2106 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2109 "invalid backlog \"%V\"", &value[n]); 2107 "invalid backlog \"%V\"", &value[n]);
2111 } 2109 }
2112 2110
2113 continue; 2111 continue;
2114 } 2112 }
2115 2113
2116 if (ngx_strncmp(value[n].data, "af=", 3) == 0) { 2114 if (ngx_strncmp(value[n].data, "rcvbuf=", 7) == 0) {
2115 size.len = value[n].len - 7;
2116 size.data = value[n].data + 7;
2117
2118 ls->conf.rcvbuf = ngx_parse_size(&size);
2119 ls->conf.bind = 1;
2120
2121 if (ls->conf.rcvbuf == NGX_ERROR) {
2122 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2123 "invalid rcvbuf \"%V\"", &value[n]);
2124 return NGX_CONF_ERROR;
2125 }
2126
2127 continue;
2128 }
2129
2130 if (ngx_strncmp(value[n].data, "sndbuf=", 7) == 0) {
2131 size.len = value[n].len - 7;
2132 size.data = value[n].data + 7;
2133
2134 ls->conf.sndbuf = ngx_parse_size(&size);
2135 ls->conf.bind = 1;
2136
2137 if (ls->conf.sndbuf == NGX_ERROR) {
2138 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2139 "invalid sndbuf \"%V\"", &value[n]);
2140 return NGX_CONF_ERROR;
2141 }
2142
2143 continue;
2144 }
2145
2146 if (ngx_strncmp(value[n].data, "accept_filter=", 14) == 0) {
2117 #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) 2147 #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
2118 ls->conf.accept_filter = (char *) &value[n].data[3]; 2148 ls->conf.accept_filter = (char *) &value[n].data[14];
2119 ls->conf.bind = 1; 2149 ls->conf.bind = 1;
2120 #else 2150 #else
2121 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 2151 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2122 "accept filters \"%V\" are not supported " 2152 "accept filters \"%V\" are not supported "
2123 "on this platform, ignored", 2153 "on this platform, ignored",