]> git.kaiwu.me - nginx.git/commitdiff
nginx-0.0.10-2004-09-14-19:55:24 import
authorIgor Sysoev <igor@sysoev.ru>
Tue, 14 Sep 2004 15:55:24 +0000 (15:55 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 14 Sep 2004 15:55:24 +0000 (15:55 +0000)
auto/os/solaris
auto/summary
src/core/ngx_inet.c
src/event/modules/ngx_kqueue_module.c
src/event/ngx_event_accept.c
src/http/ngx_http_core_module.c
src/os/unix/ngx_atomic.h

index f1ac0f91b8e3975c70c348589d41aef9e0797e49..65bda26e0b34598c6cd1ca3c839a54f211078694 100644 (file)
@@ -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
index 0051c9710ac8777e10ba9acb4913d2084e46c07e..4d37e87256402f7c28ed8ed249bfa292d687a90f 100644 (file)
@@ -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
index 910846f0241614eafee9c0673b1826b4a160a043..94d0c72e5c1fc996c4e60866557fe69a526a41b1 100644 (file)
@@ -210,3 +210,58 @@ ngx_int_t ngx_ptocidr(ngx_str_t *text, void *cidr)
 
     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
index 6116de0adcac051181fce129eaef0c0d073af99d..a1d6f59078c8ab396583ad243ef5fa103221675a 100644 (file)
@@ -707,11 +707,11 @@ static ngx_int_t ngx_kqueue_process_events(ngx_cycle_t *cycle)
 
 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;
index 10f24a6ada4e55f1a2be3189c74c8d4b42d0bfd6..a02318d2f7e29e2634d24d48a316b215df11419b 100644 (file)
@@ -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;
index 6c4f819b962e83da5e23b0732ee59f763a0d13b6..f00ae658c7df8c6dcc777a71afdb3f37baa4b404 100644 (file)
@@ -1479,10 +1479,14 @@ static char *ngx_set_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     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 */
 
index 18d5edac5a8be2917cd55252cd57f7071a59418d..552edd5e8650e2cbb1d4f24c6c7a5257fad5b2aa 100644 (file)
@@ -68,6 +68,57 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
 }
 
 
+#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;