comparison src/core/ngx_connection.h @ 92:45945fa8b8ba NGINX_0_2_0

nginx 0.2.0 *) The pid-file names used during online upgrade was changed and now is not required a manual rename operation. The old master process adds the ".oldbin" suffix to its pid-file and executes a new binary file. The new master process creates usual pid-file without the ".newbin" suffix. If the master process exits, then old master process renames back its pid-file with the ".oldbin" suffix to the pid-file without suffix. *) Change: the "worker_connections" directive, new name of the "connections" directive; now the directive specifies maximum number of connections, but not maximum socket descriptor number. *) Feature: SSL supports the session cache inside one worker process. *) Feature: the "satisfy_any" directive. *) Change: the ngx_http_access_module and ngx_http_auth_basic_module do not run for subrequests. *) Feature: the "worker_rlimit_nofile" and "worker_rlimit_sigpending" directives. *) Bugfix: if all backend using in load-balancing failed after one error, then nginx did not try do connect to them during 60 seconds. *) Bugfix: in IMAP/POP3 command argument parsing. Thanks to Rob Mueller. *) Bugfix: errors while using SSL in IMAP/POP3 proxy. *) Bugfix: errors while using SSI and gzipping. *) Bugfix: the "Expires" and "Cache-Control" header lines were omitted from the 304 responses. Thanks to Alexandr Kukushkin.
author Igor Sysoev <http://sysoev.ru>
date Fri, 23 Sep 2005 00:00:00 +0400
parents e916a291e9aa
children ca4f70b3ccc6
comparison
equal deleted inserted replaced
91:c3eee83ea942 92:45945fa8b8ba
10 10
11 #include <ngx_config.h> 11 #include <ngx_config.h>
12 #include <ngx_core.h> 12 #include <ngx_core.h>
13 13
14 14
15 typedef struct { 15 typedef struct ngx_listening_s ngx_listening_t;
16 ngx_socket_t fd;
17 16
18 struct sockaddr *sockaddr; 17 struct ngx_listening_s {
19 socklen_t socklen; /* size of sockaddr */ 18 ngx_socket_t fd;
20 size_t addr; /* offset to address in sockaddr */
21 size_t addr_text_max_len;
22 ngx_str_t addr_text;
23 19
24 int family; 20 struct sockaddr *sockaddr;
25 int type; 21 socklen_t socklen; /* size of sockaddr */
22 size_t addr; /* offset to address in sockaddr */
23 size_t addr_text_max_len;
24 ngx_str_t addr_text;
26 25
27 void (*handler)(ngx_connection_t *c); /* handler of accepted 26 int family;
28 connection */ 27 int type;
29 void *ctx; /* ngx_http_conf_ctx_t, for example */ 28 int backlog;
30 void *servers; /* array of ngx_http_in_addr_t, for example */
31 29
32 ngx_log_t *log; 30 /* handler of accepted connection */
33 int backlog; 31 void (*handler)(ngx_connection_t *c);
34 32
35 size_t pool_size; 33 void *ctx; /* ngx_http_conf_ctx_t, for example */
36 size_t post_accept_buffer_size; /* should be here because 34 void *servers; /* array of ngx_http_in_addr_t, for example */
37 of the AcceptEx() preread */
38 time_t post_accept_timeout; /* should be here because
39 of the deferred accept */
40 35
41 unsigned open:1; 36 ngx_log_t log;
42 unsigned remain:1;
43 unsigned ignore:1;
44 37
45 unsigned bound:1; /* already bound */ 38 size_t pool_size;
46 unsigned inherited:1; /* inherited from previous process */ 39 /* should be here because of the AcceptEx() preread */
47 unsigned nonblocking_accept:1; 40 size_t post_accept_buffer_size;
48 unsigned change_backlog:1; 41 /* should be here because of the deferred accept */
49 unsigned nonblocking:1; 42 time_t post_accept_timeout;
50 unsigned shared:1; /* shared between threads or processes */ 43
51 unsigned addr_ntop:1; 44 ngx_listening_t *previous;
45 ngx_connection_t *connection;
46
47 unsigned open:1;
48 unsigned remain:1;
49 unsigned ignore:1;
50
51 unsigned bound:1; /* already bound */
52 unsigned inherited:1; /* inherited from previous process */
53 unsigned nonblocking_accept:1;
54 unsigned change_backlog:1;
55 unsigned nonblocking:1;
56 unsigned shared:1; /* shared between threads or processes */
57 unsigned addr_ntop:1;
52 58
53 #if (NGX_HAVE_DEFERRED_ACCEPT) 59 #if (NGX_HAVE_DEFERRED_ACCEPT)
54 unsigned deferred_accept:1; 60 unsigned deferred_accept:1;
55 unsigned delete_deferred:1; 61 unsigned delete_deferred:1;
56 unsigned add_deferred:1; 62 unsigned add_deferred:1;
57 #ifdef SO_ACCEPTFILTER 63 #ifdef SO_ACCEPTFILTER
58 char *accept_filter; 64 char *accept_filter;
59 #endif 65 #endif
60 #endif 66 #endif
61 67
62 } ngx_listening_t; 68 };
63 69
64 70
65 typedef enum { 71 typedef enum {
66 NGX_ERROR_CRIT = 0, 72 NGX_ERROR_CRIT = 0,
67 NGX_ERROR_ERR, 73 NGX_ERROR_ERR,
158 ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle); 164 ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle);
159 void ngx_close_listening_sockets(ngx_cycle_t *cycle); 165 void ngx_close_listening_sockets(ngx_cycle_t *cycle);
160 void ngx_close_connection(ngx_connection_t *c); 166 void ngx_close_connection(ngx_connection_t *c);
161 ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text); 167 ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text);
162 168
163 169 ngx_connection_t *ngx_get_connection(ngx_socket_t s, ngx_log_t *log);
164 extern ngx_os_io_t ngx_io; 170 void ngx_free_connection(ngx_connection_t *c);
165 171
166 172
167 #endif /* _NGX_CONNECTION_H_INCLUDED_ */ 173 #endif /* _NGX_CONNECTION_H_INCLUDED_ */