# HG changeset patch # User Igor Sysoev # Date 1095177324 0 # Node ID bd39260a1383b80289483fef93e3222377b0908f # Parent 84c52790823717ba2a52c7959cc1f2a78b905d25 nginx-0.0.10-2004-09-14-19:55:24 import diff --git a/auto/os/solaris b/auto/os/solaris --- a/auto/os/solaris +++ b/auto/os/solaris @@ -4,7 +4,7 @@ CORE_DEPS="$UNIX_DEPS $SOLARIS_DEPS" CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS " EVENT_MODULES="$EVENT_MODULES" -CORE_LIBS="$CORE_LIBS -lsocket -lnsl" +CORE_LIBS="$CORE_LIBS -lsocket -lnsl -lrt" # the Solaris's make support MAKE_SL=YES diff --git a/auto/summary b/auto/summary --- a/auto/summary +++ b/auto/summary @@ -8,32 +8,32 @@ if [ $USE_PCRE = DISABLED ]; then else case $PCRE in - YES) echo " using system PCRE library" ;; - NONE) echo " PCRE library is not used" ;; - NO) echo " PCRE library is not found" ;; - *) echo " using PCRE library: $PCRE" ;; + YES) echo " + using system PCRE library" ;; + NONE) echo " + PCRE library is not used" ;; + NO) echo " + PCRE library is not found" ;; + *) echo " + using PCRE library: $PCRE" ;; esac fi case $MD5 in - YES) echo " md5: using system $MD5_LIB library" ;; - NONE) echo " md5 library is not used" ;; - NO) echo " md5 library is not found" ;; - *) echo " using md5 library: $MD5" ;; + YES) echo " + md5: using system $MD5_LIB library" ;; + NONE) echo " + md5 library is not used" ;; + NO) echo " + md5 library is not found" ;; + *) echo " + using md5 library: $MD5" ;; esac case $OPENSSL in - YES) echo " using system OpenSSL library" ;; - NONE) echo " OpenSSL library is not used" ;; - NO) echo " OpenSSL library is not found" ;; - *) echo " using OpenSSL library: $OPENSSL" ;; + YES) echo " + using system OpenSSL library" ;; + NONE) echo " + OpenSSL library is not used" ;; + NO) echo " + OpenSSL library is not found" ;; + *) echo " + using OpenSSL library: $OPENSSL" ;; esac case $ZLIB in - YES) echo " using system zlib library" ;; - NONE) echo " zlib library is not used" ;; - NO) echo " zlib library is not found" ;; - *) echo " using zlib library: $ZLIB" ;; + YES) echo " + using system zlib library" ;; + NONE) echo " + zlib library is not used" ;; + NO) echo " + zlib library is not found" ;; + *) echo " + using zlib library: $ZLIB" ;; esac echo diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -210,3 +210,58 @@ ngx_int_t ngx_ptocidr(ngx_str_t *text, v return NGX_OK; } + + +#if 0 + +ngx_int_t ngx_inet_addr_port(ngx_conf_t *cf, ngx_command_t *cmd, + ngx_str_t *addr_port) +{ + u_char *host; + ngx_int_t port; + ngx_uint_t p; + struct hostent *h; + + for (p = 0; p < addr_port->len; p++) { + if (addr_port->data[p] == ':') { + break; + } + } + + in_addr->host.len = p; + if (!(in_addr->host.data = ngx_palloc(pool, p + 1))) { + return NGX_ERROR; + } + + ngx_cpystrn(in_addr->host.data, addr_port->data, p + 1); + + if (p == addr_port->len) { + p = 0; + } + + port = ngx_atoi(&addr[p], args[1].len - p); + if (port == NGX_ERROR && p == 0) { + + /* default port */ + iap->port = 0; + + } else if ((port == NGX_ERROR && p != 0) /* "listen host:NONNUMBER" */ + || (port < 1 || port > 65536)) { /* "listen 99999" */ + + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "invalid port \"%s\" in \"%s\" directive, " + "it must be a number between 1 and 65535", + &addr[p], cmd->name.data); + + return NGX_CONF_ERROR; + + } else if (p == 0) { + ls->addr = INADDR_ANY; + ls->port = (in_port_t) port; + return NGX_CONF_OK; + } + + return NGX_OK; +} + +#endif diff --git a/src/event/modules/ngx_kqueue_module.c b/src/event/modules/ngx_kqueue_module.c --- a/src/event/modules/ngx_kqueue_module.c +++ b/src/event/modules/ngx_kqueue_module.c @@ -707,11 +707,11 @@ static ngx_int_t ngx_kqueue_process_even static ngx_int_t ngx_kqueue_process_changes(ngx_cycle_t *cycle, ngx_uint_t try) { - int n; - ngx_int_t rc; - ngx_err_t err; - struct timespec ts; - struct kevent *changes; + int n; + ngx_int_t rc; + ngx_err_t err; + struct timespec ts; + struct kevent *changes; if (ngx_mutex_lock(kevent_mutex) == NGX_ERROR) { return NGX_ERROR; diff --git a/src/event/ngx_event_accept.c b/src/event/ngx_event_accept.c --- a/src/event/ngx_event_accept.c +++ b/src/event/ngx_event_accept.c @@ -95,12 +95,14 @@ void ngx_event_accept(ngx_event_t *ev) err = ngx_socket_errno; if (err == NGX_EAGAIN) { +#if 0 if (!(ngx_event_flags & NGX_USE_RTSIG_EVENT)) { ngx_log_error(NGX_LOG_NOTICE, log, err, "EAGAIN after %d accepted connection(s)", accepted); } +#endif ngx_destroy_pool(pool); return; diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1479,10 +1479,14 @@ static char *ngx_set_listen(ngx_conf_t * ngx_str_t *args; ngx_http_listen_t *ls; - /* TODO: check duplicate 'listen' directives, - add resolved name to server names ??? */ + /* + * TODO: check duplicate 'listen' directives, + * add resolved name to server names ??? + */ - ngx_test_null(ls, ngx_push_array(&scf->listen), NGX_CONF_ERROR); + if (!(ls = ngx_array_push(&scf->listen))) { + return NGX_CONF_ERROR; + } /* AF_INET only */ diff --git a/src/os/unix/ngx_atomic.h b/src/os/unix/ngx_atomic.h --- a/src/os/unix/ngx_atomic.h +++ b/src/os/unix/ngx_atomic.h @@ -68,6 +68,57 @@ static ngx_inline uint32_t ngx_atomic_cm } +#elif ( __sparc__ ) + +typedef volatile uint32_t ngx_atomic_t; + + +static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value) +{ + uint32_t old, new, res; + + old = *value; + + for ( ;; ) { + + new = old + 1; + res = new; + + __asm__ volatile ( + + "casa [%1]ASI_P, %2, %0" + + : "+r" (res) : "r" (value), "r" (old)); + + if (res == old) { + return new; + } + + old = res; + } +} + + +/* STUB */ +#define ngx_atomic_dec(x) (*(x))--; +/**/ + + +static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, + ngx_atomic_t old, + ngx_atomic_t set) +{ + uint32_t res = (u_int32_t) set; + + __asm__ volatile ( + + "casa [%1]ASI_P, %2, %0" + + : "+r" (res) : "r" (lock), "r" (old)); + + return (res == old); +} + #else typedef volatile uint32_t ngx_atomic_t;