nginx-0.0.3-2004-04-02-19:13:20 import
diff --git a/src/os/unix/ngx_errno.c b/src/os/unix/ngx_errno.c index 410cfde..3b12528 100644 --- a/src/os/unix/ngx_errno.c +++ b/src/os/unix/ngx_errno.c
@@ -43,7 +43,7 @@ str = strerror_r(err, errstr, size); if (str != errstr) { - return ngx_cpystrn(errstr, str, size) - errstr; + return ngx_cpystrn(errstr, str, size) - (u_char *) errstr; } for (len = 0; len < size; len++) {
diff --git a/src/os/unix/ngx_freebsd_rfork_thread.c b/src/os/unix/ngx_freebsd_rfork_thread.c index e100b93..1cdfee4 100644 --- a/src/os/unix/ngx_freebsd_rfork_thread.c +++ b/src/os/unix/ngx_freebsd_rfork_thread.c
@@ -26,7 +26,6 @@ */ -ngx_int_t ngx_threaded; char *ngx_freebsd_kern_usrstack; size_t ngx_thread_stack_size;
diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h index 23745df..d36d665 100644 --- a/src/os/unix/ngx_linux_config.h +++ b/src/os/unix/ngx_linux_config.h
@@ -27,6 +27,7 @@ #include <sys/resource.h> #include <sys/sysctl.h> #include <sys/wait.h> +#include <sys/mman.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> /* TCP_CORK */
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index 1ae4dee..2410671 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c
@@ -15,6 +15,7 @@ ngx_pid_t ngx_pid; ngx_pid_t ngx_new_binary; ngx_int_t ngx_inherited; +ngx_int_t ngx_threaded; sig_atomic_t ngx_reap; sig_atomic_t ngx_timer;
diff --git a/src/os/unix/ngx_process_cycle.h b/src/os/unix/ngx_process_cycle.h index 0c55afa..364094a 100644 --- a/src/os/unix/ngx_process_cycle.h +++ b/src/os/unix/ngx_process_cycle.h
@@ -26,6 +26,7 @@ extern ngx_pid_t ngx_pid; extern ngx_pid_t ngx_new_binary; extern ngx_int_t ngx_inherited; +extern ngx_int_t ngx_threaded; extern sig_atomic_t ngx_reap; extern sig_atomic_t ngx_timer;
diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c index 3ec3b27..49bb3ef 100644 --- a/src/os/unix/ngx_readv_chain.c +++ b/src/os/unix/ngx_readv_chain.c
@@ -135,7 +135,7 @@ ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain) { - char *prev; + u_char *prev; ssize_t n, size; struct iovec *iov; ngx_err_t err;
diff --git a/src/os/unix/ngx_recv.c b/src/os/unix/ngx_recv.c index 37e70c6..6345350 100644 --- a/src/os/unix/ngx_recv.c +++ b/src/os/unix/ngx_recv.c
@@ -112,7 +112,7 @@ #else /* ! NAVE_KQUEUE */ -ssize_t ngx_unix_recv(ngx_connection_t *c, char *buf, size_t size) +ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size) { ssize_t n; ngx_err_t err;
diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h index db74aeb..7c02c44 100644 --- a/src/os/unix/ngx_solaris_config.h +++ b/src/os/unix/ngx_solaris_config.h
@@ -22,10 +22,11 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> -#include <sys/filio.h> /* FIONBIO */ -#include <sys/stropts.h> /* INFTIM */ +#include <sys/mman.h> #include <sys/socket.h> #include <sys/sendfile.h> +#include <sys/filio.h> /* FIONBIO */ +#include <sys/stropts.h> /* INFTIM */ #include <sys/systeminfo.h> #include <netinet/in.h> #include <arpa/inet.h>
diff --git a/src/os/unix/ngx_thread.h b/src/os/unix/ngx_thread.h index 841636a..5225274 100644 --- a/src/os/unix/ngx_thread.h +++ b/src/os/unix/ngx_thread.h
@@ -102,9 +102,6 @@ ngx_int_t ngx_mutex_unlock(ngx_mutex_t *m); -extern ngx_int_t ngx_threaded; - - #else /* !NGX_THREADS */ #define ngx_thread_volatile
diff --git a/src/os/unix/ngx_time.c b/src/os/unix/ngx_time.c index 3703991..221b64c 100644 --- a/src/os/unix/ngx_time.c +++ b/src/os/unix/ngx_time.c
@@ -20,72 +20,3 @@ tm->ngx_tm_mon++; tm->ngx_tm_year += 1900; } - - - -#if 0 - -typedef struct { - int busy; - u_int_64 msec; - time_t sec; - tm; - http_time_len; - http_time[n]; -}; - -volatile *ngx_time_p; - -ngx_time() -{ - p = ngx_time_p; -} - -ngx_update_time() -{ - u_int64 msec; - struct timeval tv; - - gettimeofday(&tv, NULL); - - msec = (unsigned long) tv.tv_sec * 1000 + tv.tv_usec / 1000; - p = ngx_time_p; - - /* minimum can be for example 0, 10, 50 or 100 ms */ - if (tv_sec > p->sec || msec - p->msec >= minimum) { - old_p = p; - /* max_tries < max_slots - 10, - max_slots should be more than max of threads */ - for (/* void */; i < max_tries; i++) { - if (++p >= last_slot) - p = first_slot; - - if (!test_and_set(p->busy) - break; - } - - if (i == max_tries) { - ngx_log_error(); - return; - } - - if (tv_sec > p->sec) { - p->sec = tv.tv.sec; - p->msec = msec; - localtime_r(&tv.tv_sec, tm); - make http stirng; - - } else { - ngx_memcpy(p->sec, old_p->sec, sizeof() - offset_of(, sec)); - p->msec = msec; - } - - /* here can be too seldom and non-critical race condition */ - if (ngx_time_p == old_p) - ngx_time_p = p; - - unlock(p->busy); - } -} - -#endif
diff --git a/src/os/win32/ngx_process_cycle.h b/src/os/win32/ngx_process_cycle.h index 0c55afa..364094a 100644 --- a/src/os/win32/ngx_process_cycle.h +++ b/src/os/win32/ngx_process_cycle.h
@@ -26,6 +26,7 @@ extern ngx_pid_t ngx_pid; extern ngx_pid_t ngx_new_binary; extern ngx_int_t ngx_inherited; +extern ngx_int_t ngx_threaded; extern sig_atomic_t ngx_reap; extern sig_atomic_t ngx_timer;