Mercurial > hg > nginx-vendor-current
annotate src/core/ngx_unix_domain.c @ 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 | 818201e5a553 |
children | 146eff53ab60 |
rev | line source |
---|---|
28 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 #include <ngx_event.h> | |
10 #include <ngx_event_connect.h> | |
11 | |
12 | |
13 /* Solaris has predefined "#define sun 1" */ | |
14 #undef sun | |
15 | |
16 | |
58 | 17 ngx_peers_t * |
18 ngx_unix_upstream_parse(ngx_conf_t *cf, ngx_unix_domain_upstream_t *u) | |
28 | 19 { |
20 size_t len; | |
21 ngx_uint_t i; | |
22 ngx_peers_t *peers; | |
23 struct sockaddr_un *sun; | |
24 | |
25 len = u->url.len - 5; | |
26 | |
27 if (u->uri_part) { | |
28 for (i = 5; i < u->url.len; i++) { | |
29 if (u->url.data[i] == ':') { | |
30 len = i - 5; | |
31 u->uri.len = u->url.len - 5 - len - 1; | |
32 u->uri.data = u->url.data + 5 + len + 1; | |
33 | |
34 break; | |
35 } | |
36 } | |
37 | |
38 if (u->uri.len == 0) { | |
39 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
40 "the unix domain upstream \"%V\" has no URI", | |
41 &u->name); | |
42 return NULL; | |
43 } | |
44 } | |
45 | |
46 if (len == 0) { | |
47 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
48 "the unix domain socket \"%V\" has no path", | |
49 &u->name); | |
50 return NULL; | |
51 } | |
52 | |
53 if (len + 1 > sizeof(sun->sun_path)) { | |
54 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
55 "the unix domain socket path \"%V\" is too long", | |
56 &u->name); | |
57 return NULL; | |
58 } | |
59 | |
60 /* MP: ngx_shared_palloc() */ | |
61 | |
50 | 62 peers = ngx_pcalloc(cf->pool, sizeof(ngx_peers_t)); |
63 if (peers == NULL) { | |
28 | 64 return NULL; |
65 } | |
66 | |
50 | 67 sun = ngx_pcalloc(cf->pool, sizeof(struct sockaddr_un)); |
68 if (sun == NULL) { | |
28 | 69 return NULL; |
70 } | |
71 | |
72 peers->number = 1; | |
73 | |
74 sun->sun_family = AF_UNIX; | |
66 | 75 (void) ngx_cpystrn((u_char *) sun->sun_path, u->url.data + 5, len + 1); |
28 | 76 |
77 peers->peer[0].sockaddr = (struct sockaddr *) sun; | |
78 peers->peer[0].socklen = sizeof(struct sockaddr_un); | |
79 | |
80 peers->peer[0].name.len = 5 + len; | |
81 peers->peer[0].name.data = u->url.data; | |
82 | |
83 peers->peer[0].uri_separator = ":"; | |
84 | |
85 return peers; | |
86 } |