]> git.kaiwu.me - nginx.git/commitdiff
nginx-0.0.11-2004-09-21-19:47:05 import
authorIgor Sysoev <igor@sysoev.ru>
Tue, 21 Sep 2004 15:47:05 +0000 (15:47 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 21 Sep 2004 15:47:05 +0000 (15:47 +0000)
auto/os/solaris
src/core/ngx_times.c
src/http/modules/ngx_http_gzip_filter.c
src/http/ngx_http_request.h
src/os/unix/ngx_atomic.h
src/os/unix/ngx_solaris_sendfilev_chain.c

index 65bda26e0b34598c6cd1ca3c839a54f211078694..bd6559a9f397b4e99c693d539e69f93c72cf3549 100644 (file)
@@ -25,6 +25,18 @@ case $PLATFORM in
 esac
 
 
+case $PLATFORM in
+
+    *:sun4u)
+        CFLAGS="$CFLAGS -mcpu=v9"
+    ;;
+
+    *)
+    ;;
+
+esac
+
+
 if [ $ZLIB_ASM != NO ]; then
     echo "$0: error: the --with-zlib-asm=CPU option is not supported"
     echo "on that platform"
index 2c9985f209b984944737f79e7268fa52e0216496..b6d5a3f1dbd6f68563498f3b4807a43be588a4d7 100644 (file)
@@ -79,7 +79,7 @@ void ngx_time_init()
     ngx_cached_http_time.len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1;
     ngx_cached_http_log_time.len = sizeof("28/Sep/1970:12:00:00 +0600") - 1;
 
-#if (TIME_T_SIZE > SIG_ATOMIC_T_SIZE)
+#if (NGX_THREADS && (TIME_T_SIZE > SIG_ATOMIC_T_SIZE))
     ngx_cached_time = &cached_time[0];
 #endif
 
@@ -132,7 +132,7 @@ void ngx_time_update(time_t s)
         slot++;
     }
 
-#if (TIME_T_SIZE > SIG_ATOMIC_T_SIZE)
+#if (NGX_THREADS && (TIME_T_SIZE > SIG_ATOMIC_T_SIZE))
     ngx_cached_time = &cached_time[slot];
 #endif
 
index dc101b7fc2489adb4831d14774742a438a963073..1a373784dc4f81f7ac8721a8a4db2d840e62e9a8 100644 (file)
@@ -440,8 +440,9 @@ static ngx_int_t ngx_http_gzip_body_filter(ngx_http_request_t *r,
          * Besides we free this memory as soon as the gzipping will complete
          * and do not wait while a whole response will be sent to a client.
          *
-         * 8K is for zlib deflate_state.  It takes 5816 bytes on x86
-         * and 5920 bytes on amd64.
+         * 8K is for zlib deflate_state, it takes
+         *  * 5816 bytes on x86 and sparc64 (32-bit mode)
+         *  * 5920 bytes on amd64 and sparc64
          */
 
         ctx->allocated = 8192 + (1 << (wbits + 2)) + (1 << (memlevel + 9));
@@ -803,9 +804,7 @@ static void *ngx_http_gzip_filter_alloc(void *opaque, u_int items, u_int size)
     if (alloc % 512 != 0) {
 
         /*
-         * The zlib deflate_state allocation, it takes 5816 bytes on x86
-         * and 5920 bytes on amd64.
-         * We allocate 8K.
+         * the zlib deflate_state allocation, it takes about 6K, we allocate 8K
          */
 
         alloc = (alloc + ngx_pagesize - 1) & ~(ngx_pagesize - 1);
index 4dd1e82ee2ec3458eb1a59decf738168aff91687..8ecdfd11f7f05d0db69a598c0fdfca8b188a4ace 100644 (file)
@@ -218,9 +218,15 @@ struct ngx_http_cleanup_s {
 
 
 typedef struct {
-    ngx_http_request_t  *request;
-    ngx_array_t          large_buffers;
-    ngx_uint_t           pipeline;      /* unsigned  pipeline:1; */
+    ngx_http_request_t   *request;
+
+    ngx_buf_t           **busy;
+    ngx_uint_t            nbusy;
+
+    ngx_buf_t           **free;
+    ngx_uint_t            nfree;
+
+    ngx_uint_t            pipeline;      /* unsigned  pipeline:1; */
 } ngx_http_connection_t;
 
 
index 41c67047504b0a8ba212b83c43fb1403756dc44c..7f740381bdb9bda76e91dd8eadd58d074707ee3c 100644 (file)
@@ -86,7 +86,7 @@ static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value)
 
         __asm__ volatile (
 
-        "casa [%1]ASI_P, %2, %0"
+        "casa [%1] 0x80, %2, %0"
 
         : "+r" (res) : "r" (value), "r" (old));
 
@@ -112,7 +112,7 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
 
     __asm__ volatile (
 
-    "casa [%1]ASI_P, %2, %0"
+    "casa [%1] 0x80, %2, %0"
 
     : "+r" (res) : "r" (lock), "r" (old));
 
@@ -124,8 +124,8 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
 typedef volatile uint32_t  ngx_atomic_t;
 
 /* STUB */
-#define ngx_atomic_inc(x)   (*(x))++;
-#define ngx_atomic_dec(x)   (*(x))--;
+#define ngx_atomic_inc(x)   ++(*(x));
+#define ngx_atomic_dec(x)   --(*(x));
 #define ngx_atomic_cmp_set(lock, old, set)   1
 /**/
 
index d249e8186b0cdc21fe74a0a83aeecd5d3da0933b..f6dca9c15e6d868141b4b6e80711370eac6167ff 100644 (file)
@@ -18,8 +18,7 @@ ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in,
     int             fd;
     u_char         *prev;
     off_t           fprev, sprev, send, aligned;
-    size_t          size, sent;
-    ssize_t         n;
+    ssize_t         size, sent, n;
     ngx_int_t       eintr, complete;
     ngx_err_t       err;
     sendfilevec_t  *sfv, sfvs[NGX_SENDFILEVECS];