nginx-0.0.7-2004-06-21-23:22:53 import
diff --git a/auto/cc b/auto/cc
index 29e94d0..68159b5 100644
--- a/auto/cc
+++ b/auto/cc
@@ -7,7 +7,7 @@
# gcc 2.7.2.3, 2.8.1, 2.95.4,
# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4
- # optimization
+ # optimizations
#CFLAGS="$CFLAGS -O2 -fomit-frame-pointer"
case $CPU in
@@ -92,7 +92,7 @@
*icc)
# Intel C++ compiler 7.1, 8.0
- # optimization
+ # optimizations
CFLAGS="$CFLAGS -O"
# inline functions declared with __inline
#CFLAGS="$CFLAGS -Ob1"
@@ -165,7 +165,7 @@
cl)
# MSVC 6.0 SP2
- # optimization
+ # optimizations
# maximize speed
CFLAGS="$CFLAGS -O2"
@@ -244,7 +244,7 @@
wcl386)
# Open Watcom C 1.0, 1.2
- # optimization
+ # optimizations
# maximize speed
CFLAGS="$CFLAGS -ot"
@@ -325,7 +325,7 @@
bcc32)
# Borland C++ 5.5
- # optimization
+ # optimizations
# maximize speed
CFLAGS="$CFLAGS -O2"
diff --git a/src/event/ngx_event_spinlock.c b/src/event/ngx_event_spinlock.c
new file mode 100644
index 0000000..58edb2a
--- /dev/null
+++ b/src/event/ngx_event_spinlock.c
@@ -0,0 +1,26 @@
+
+
+void _spinlock(ngx_atomic_t *lock)
+{
+ ngx_int_t tries;
+
+ tries = 0;
+
+ for ( ;; ) {
+
+ if (*lock) {
+ if (ngx_ncpu > 1 && tries++ < 1000) {
+ continue;
+ }
+
+ sched_yield();
+ tries = 0;
+
+ } else {
+ if (ngx_atomic_cmp_set(lock, 0, 1)) {
+ return;
+ }
+ }
+ }
+}
+
diff --git a/src/http/ngx_http_write_filter.c b/src/http/ngx_http_write_filter.c
index f82bdae..2d4ba23 100644
--- a/src/http/ngx_http_write_filter.c
+++ b/src/http/ngx_http_write_filter.c
@@ -162,7 +162,8 @@
if (conf->limit_rate) {
sent = r->connection->sent - sent;
r->connection->write->delayed = 1;
- ngx_add_timer(r->connection->write, sent * 1000 / conf->limit_rate);
+ ngx_add_timer(r->connection->write,
+ (ngx_msec_t) sent * 1000 / conf->limit_rate);
}
if (chain == NGX_CHAIN_ERROR) {
diff --git a/src/os/win32/ngx_os.h b/src/os/win32/ngx_os.h
index 2fae21b..aa66e70 100644
--- a/src/os/win32/ngx_os.h
+++ b/src/os/win32/ngx_os.h
@@ -26,7 +26,8 @@
ssize_t (*recv)(ngx_connection_t *c, u_char *buf, size_t size);
ssize_t (*recv_chain)(ngx_connection_t *c, ngx_chain_t *in);
ssize_t (*send)(ngx_connection_t *c, u_char *buf, size_t size);
- ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in);
+ ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in,
+ off_t limit);
int flags;
} ngx_os_io_t;
@@ -36,8 +37,10 @@
ssize_t ngx_wsarecv(ngx_connection_t *c, u_char *buf, size_t size);
ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, u_char *buf, size_t size);
ssize_t ngx_wsarecv_chain(ngx_connection_t *c, ngx_chain_t *chain);
-ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in);
-ngx_chain_t *ngx_overlapped_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in);
+ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in,
+ off_t limit);
+ngx_chain_t *ngx_overlapped_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in,
+ off_t limit);
extern ngx_os_io_t ngx_os_io;
diff --git a/src/os/win32/ngx_win32_config.h b/src/os/win32/ngx_win32_config.h
index cc3a068..72e5c5e 100644
--- a/src/os/win32/ngx_win32_config.h
+++ b/src/os/win32/ngx_win32_config.h
@@ -30,16 +30,28 @@
/* disable some "-W4" level warnings */
-#pragma warning(disable:4054)
+/* disable warnings about some 'type cast */
#pragma warning(disable:4054)
#pragma warning(disable:4055)
+
/* unreferenced formal parameter */
#pragma warning(disable:4100)
+
+/* conditional expression is constant */
#pragma warning(disable:4127)
+
+/* nonstandard extension used : bit field types other than int */
#pragma warning(disable:4214)
+
+/* unreachable code */
#pragma warning(disable:4702)
+
+/* assignment within conditional expression */
#pragma warning(disable:4706)
+/* disable "function 'ngx_handle_write_event' not inlined" */
+#pragma warning(disable:4710)
+
#endif
@@ -121,6 +133,9 @@
#endif
+#define OFF_T_MAX_VALUE 9223372036854775807
+
+
/* STUB */
#define HAVE_LITTLE_ENDIAN 1
diff --git a/src/os/win32/ngx_wsasend_chain.c b/src/os/win32/ngx_wsasend_chain.c
index 4ada9ea..eda422e 100644
--- a/src/os/win32/ngx_wsasend_chain.c
+++ b/src/os/win32/ngx_wsasend_chain.c
@@ -4,7 +4,8 @@
#include <ngx_event.h>
-ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in)
+ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in,
+ off_t limit)
{
int rc;
u_char *prev;
@@ -99,7 +100,8 @@
}
-ngx_chain_t *ngx_overlapped_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in)
+ngx_chain_t *ngx_overlapped_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in,
+ off_t limit)
{
int rc;
u_char *prev;