# 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
*icc)
# Intel C++ compiler 7.1, 8.0
- # optimization
+ # optimizations
CFLAGS="$CFLAGS -O"
# inline functions declared with __inline
#CFLAGS="$CFLAGS -Ob1"
cl)
# MSVC 6.0 SP2
- # optimization
+ # optimizations
# maximize speed
CFLAGS="$CFLAGS -O2"
wcl386)
# Open Watcom C 1.0, 1.2
- # optimization
+ # optimizations
# maximize speed
CFLAGS="$CFLAGS -ot"
bcc32)
# Borland C++ 5.5
- # optimization
+ # optimizations
# maximize speed
CFLAGS="$CFLAGS -O2"
--- /dev/null
+
+
+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;
+ }
+ }
+ }
+}
+
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) {
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;
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;
/* 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
#endif
+#define OFF_T_MAX_VALUE 9223372036854775807
+
+
/* STUB */
#define HAVE_LITTLE_ENDIAN 1
#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;
}
-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;