comparison src/core/ngx_connection.c @ 70:8ad297c88dcb NGINX_0_1_35

nginx 0.1.35 *) Feature: the "working_directory" directive. *) Feature: the "port_in_redirect" directive. *) Bugfix: the segmentation fault was occurred if the backend response header was in several packets; bug appeared in 0.1.29. *) Bugfix: if more than 10 servers were configured or some server did not use the "listen" directive, then the segmentation fault was occurred on the start. *) Bugfix: the segmentation fault might occur if the response was bigger than the temporary file. *) Bugfix: nginx returned the 400 response on requests like "GET http://www.domain.com/uri HTTP/1.0"; bug appeared in 0.1.28.
author Igor Sysoev <http://sysoev.ru>
date Tue, 07 Jun 2005 00:00:00 +0400
parents 72eb30262aac
children b31656313b59
comparison
equal deleted inserted replaced
69:cce7ea52608c 70:8ad297c88dcb
10 10
11 11
12 ngx_os_io_t ngx_io; 12 ngx_os_io_t ngx_io;
13 13
14 14
15 ngx_listening_t *ngx_listening_inet_stream_socket(ngx_conf_t *cf, 15 ngx_listening_t *
16 in_addr_t addr, 16 ngx_listening_inet_stream_socket(ngx_conf_t *cf, in_addr_t addr, in_port_t port)
17 in_port_t port)
18 { 17 {
19 size_t len; 18 size_t len;
20 ngx_listening_t *ls; 19 ngx_listening_t *ls;
21 struct sockaddr_in *sin; 20 struct sockaddr_in *sin;
22 21
58 57
59 return ls; 58 return ls;
60 } 59 }
61 60
62 61
63 ngx_int_t ngx_set_inherited_sockets(ngx_cycle_t *cycle) 62 ngx_int_t
63 ngx_set_inherited_sockets(ngx_cycle_t *cycle)
64 { 64 {
65 size_t len; 65 size_t len;
66 ngx_uint_t i; 66 ngx_uint_t i;
67 ngx_listening_t *ls; 67 ngx_listening_t *ls;
68 struct sockaddr_in *sin; 68 struct sockaddr_in *sin;
119 119
120 return NGX_OK; 120 return NGX_OK;
121 } 121 }
122 122
123 123
124 ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle) 124 ngx_int_t
125 ngx_open_listening_sockets(ngx_cycle_t *cycle)
125 { 126 {
126 ngx_uint_t tries, failed, reuseaddr, i; 127 ngx_uint_t tries, failed, reuseaddr, i;
127 ngx_err_t err; 128 ngx_err_t err;
128 ngx_log_t *log; 129 ngx_log_t *log;
129 ngx_socket_t s; 130 ngx_socket_t s;
259 260
260 return NGX_OK; 261 return NGX_OK;
261 } 262 }
262 263
263 264
264 void ngx_close_listening_sockets(ngx_cycle_t *cycle) 265 void
266 ngx_close_listening_sockets(ngx_cycle_t *cycle)
265 { 267 {
266 ngx_uint_t i; 268 ngx_uint_t i;
267 ngx_socket_t fd; 269 ngx_socket_t fd;
268 ngx_listening_t *ls; 270 ngx_listening_t *ls;
269 271
307 cycle->connections[fd].fd = (ngx_socket_t) -1; 309 cycle->connections[fd].fd = (ngx_socket_t) -1;
308 } 310 }
309 } 311 }
310 312
311 313
312 void ngx_close_connection(ngx_connection_t *c) 314 void
315 ngx_close_connection(ngx_connection_t *c)
313 { 316 {
314 ngx_socket_t fd; 317 ngx_socket_t fd;
315 318
316 if (c->fd == -1) { 319 if (c->fd == -1) {
317 ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed"); 320 ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed");
396 ngx_close_socket_n " failed"); 399 ngx_close_socket_n " failed");
397 } 400 }
398 } 401 }
399 402
400 403
401 ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text) 404 ngx_int_t
405 ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text)
402 { 406 {
403 ngx_uint_t level; 407 ngx_uint_t level;
404 408
405 if (err == NGX_ECONNRESET 409 if (err == NGX_ECONNRESET
406 && c->log_error == NGX_ERROR_IGNORE_ECONNRESET) 410 && c->log_error == NGX_ERROR_IGNORE_ECONNRESET)