Klaus Demo nginx / e2ff3ea
nginx-0.0.10-2004-09-14-19:55:24 import Igor Sysoev 17 years ago
7 changed file(s) with 138 addition(s) and 26 deletion(s). Raw diff Collapse all Expand all
33 CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS "
44 EVENT_MODULES="$EVENT_MODULES"
55
6 CORE_LIBS="$CORE_LIBS -lsocket -lnsl"
6 CORE_LIBS="$CORE_LIBS -lsocket -lnsl -lrt"
77
88 # the Solaris's make support
99 MAKE_SL=YES
77
88 else
99 case $PCRE in
10 YES) echo " using system PCRE library" ;;
11 NONE) echo " PCRE library is not used" ;;
12 NO) echo " PCRE library is not found" ;;
13 *) echo " using PCRE library: $PCRE" ;;
10 YES) echo " + using system PCRE library" ;;
11 NONE) echo " + PCRE library is not used" ;;
12 NO) echo " + PCRE library is not found" ;;
13 *) echo " + using PCRE library: $PCRE" ;;
1414 esac
1515 fi
1616
1717 case $MD5 in
18 YES) echo " md5: using system $MD5_LIB library" ;;
19 NONE) echo " md5 library is not used" ;;
20 NO) echo " md5 library is not found" ;;
21 *) echo " using md5 library: $MD5" ;;
18 YES) echo " + md5: using system $MD5_LIB library" ;;
19 NONE) echo " + md5 library is not used" ;;
20 NO) echo " + md5 library is not found" ;;
21 *) echo " + using md5 library: $MD5" ;;
2222 esac
2323
2424 case $OPENSSL in
25 YES) echo " using system OpenSSL library" ;;
26 NONE) echo " OpenSSL library is not used" ;;
27 NO) echo " OpenSSL library is not found" ;;
28 *) echo " using OpenSSL library: $OPENSSL" ;;
25 YES) echo " + using system OpenSSL library" ;;
26 NONE) echo " + OpenSSL library is not used" ;;
27 NO) echo " + OpenSSL library is not found" ;;
28 *) echo " + using OpenSSL library: $OPENSSL" ;;
2929 esac
3030
3131 case $ZLIB in
32 YES) echo " using system zlib library" ;;
33 NONE) echo " zlib library is not used" ;;
34 NO) echo " zlib library is not found" ;;
35 *) echo " using zlib library: $ZLIB" ;;
32 YES) echo " + using system zlib library" ;;
33 NONE) echo " + zlib library is not used" ;;
34 NO) echo " + zlib library is not found" ;;
35 *) echo " + using zlib library: $ZLIB" ;;
3636 esac
3737
3838 echo
209209
210210 return NGX_OK;
211211 }
212
213
214 #if 0
215
216 ngx_int_t ngx_inet_addr_port(ngx_conf_t *cf, ngx_command_t *cmd,
217 ngx_str_t *addr_port)
218 {
219 u_char *host;
220 ngx_int_t port;
221 ngx_uint_t p;
222 struct hostent *h;
223
224 for (p = 0; p < addr_port->len; p++) {
225 if (addr_port->data[p] == ':') {
226 break;
227 }
228 }
229
230 in_addr->host.len = p;
231 if (!(in_addr->host.data = ngx_palloc(pool, p + 1))) {
232 return NGX_ERROR;
233 }
234
235 ngx_cpystrn(in_addr->host.data, addr_port->data, p + 1);
236
237 if (p == addr_port->len) {
238 p = 0;
239 }
240
241 port = ngx_atoi(&addr[p], args[1].len - p);
242 if (port == NGX_ERROR && p == 0) {
243
244 /* default port */
245 iap->port = 0;
246
247 } else if ((port == NGX_ERROR && p != 0) /* "listen host:NONNUMBER" */
248 || (port < 1 || port > 65536)) { /* "listen 99999" */
249
250 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
251 "invalid port \"%s\" in \"%s\" directive, "
252 "it must be a number between 1 and 65535",
253 &addr[p], cmd->name.data);
254
255 return NGX_CONF_ERROR;
256
257 } else if (p == 0) {
258 ls->addr = INADDR_ANY;
259 ls->port = (in_port_t) port;
260 return NGX_CONF_OK;
261 }
262
263 return NGX_OK;
264 }
265
266 #endif
706706
707707 static ngx_int_t ngx_kqueue_process_changes(ngx_cycle_t *cycle, ngx_uint_t try)
708708 {
709 int n;
710 ngx_int_t rc;
711 ngx_err_t err;
712 struct timespec ts;
713 struct kevent *changes;
709 int n;
710 ngx_int_t rc;
711 ngx_err_t err;
712 struct timespec ts;
713 struct kevent *changes;
714714
715715 if (ngx_mutex_lock(kevent_mutex) == NGX_ERROR) {
716716 return NGX_ERROR;
9494 err = ngx_socket_errno;
9595
9696 if (err == NGX_EAGAIN) {
97 #if 0
9798 if (!(ngx_event_flags & NGX_USE_RTSIG_EVENT))
9899 {
99100 ngx_log_error(NGX_LOG_NOTICE, log, err,
100101 "EAGAIN after %d accepted connection(s)",
101102 accepted);
102103 }
104 #endif
103105
104106 ngx_destroy_pool(pool);
105107 return;
14781478 ngx_str_t *args;
14791479 ngx_http_listen_t *ls;
14801480
1481 /* TODO: check duplicate 'listen' directives,
1482 add resolved name to server names ??? */
1483
1484 ngx_test_null(ls, ngx_push_array(&scf->listen), NGX_CONF_ERROR);
1481 /*
1482 * TODO: check duplicate 'listen' directives,
1483 * add resolved name to server names ???
1484 */
1485
1486 if (!(ls = ngx_array_push(&scf->listen))) {
1487 return NGX_CONF_ERROR;
1488 }
14851489
14861490 /* AF_INET only */
14871491
6767 }
6868
6969
70 #elif ( __sparc__ )
71
72 typedef volatile uint32_t ngx_atomic_t;
73
74
75 static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value)
76 {
77 uint32_t old, new, res;
78
79 old = *value;
80
81 for ( ;; ) {
82
83 new = old + 1;
84 res = new;
85
86 __asm__ volatile (
87
88 "casa [%1]ASI_P, %2, %0"
89
90 : "+r" (res) : "r" (value), "r" (old));
91
92 if (res == old) {
93 return new;
94 }
95
96 old = res;
97 }
98 }
99
100
101 /* STUB */
102 #define ngx_atomic_dec(x) (*(x))--;
103 /**/
104
105
106 static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
107 ngx_atomic_t old,
108 ngx_atomic_t set)
109 {
110 uint32_t res = (u_int32_t) set;
111
112 __asm__ volatile (
113
114 "casa [%1]ASI_P, %2, %0"
115
116 : "+r" (res) : "r" (lock), "r" (old));
117
118 return (res == old);
119 }
120
70121 #else
71122
72123 typedef volatile uint32_t ngx_atomic_t;