diff options
Diffstat (limited to 'src/os/unix')
| -rw-r--r-- | src/os/unix/ngx_aio_read.c | 1 | ||||
| -rw-r--r-- | src/os/unix/ngx_aio_write.c | 3 | ||||
| -rw-r--r-- | src/os/unix/ngx_freebsd_config.h | 19 | ||||
| -rw-r--r-- | src/os/unix/ngx_freebsd_sendfile_chain.c | 5 | ||||
| -rw-r--r-- | src/os/unix/ngx_linux_config.h | 13 | ||||
| -rw-r--r-- | src/os/unix/ngx_readv_chain.c | 1 | ||||
| -rw-r--r-- | src/os/unix/ngx_recv.c | 1 | ||||
| -rw-r--r-- | src/os/unix/ngx_socket.c | 3 | ||||
| -rw-r--r-- | src/os/unix/ngx_solaris_config.h | 3 | ||||
| -rw-r--r-- | src/os/unix/ngx_writev_chain.c | 13 |
10 files changed, 39 insertions, 23 deletions
diff --git a/src/os/unix/ngx_aio_read.c b/src/os/unix/ngx_aio_read.c index 4896af9ce..bc5055860 100644 --- a/src/os/unix/ngx_aio_read.c +++ b/src/os/unix/ngx_aio_read.c @@ -1,6 +1,7 @@ #include <ngx_config.h> #include <ngx_core.h> +#include <ngx_event.h> #include <ngx_aio.h> #if (HAVE_KQUEUE) diff --git a/src/os/unix/ngx_aio_write.c b/src/os/unix/ngx_aio_write.c index 918535aa7..3a4d8e0b4 100644 --- a/src/os/unix/ngx_aio_write.c +++ b/src/os/unix/ngx_aio_write.c @@ -1,6 +1,7 @@ #include <ngx_config.h> #include <ngx_core.h> +#include <ngx_event.h> #include <ngx_aio.h> #if (HAVE_KQUEUE) @@ -29,6 +30,7 @@ ssize_t ngx_aio_write(ngx_connection_t *c, char *buf, size_t size) ngx_log_debug(ev->log, "aio: ev->ready: %d" _ ev->ready); ngx_log_debug(ev->log, "aio: aiocb: %08x" _ &ev->aiocb); +#if 0 if (ev->timedout) { ngx_set_socket_errno(NGX_ETIMEDOUT); ngx_log_error(NGX_LOG_ERR, ev->log, 0, "aio_write() timed out"); @@ -46,6 +48,7 @@ ngx_log_debug(ev->log, "aio: aiocb: %08x" _ &ev->aiocb); ev->ready = 1; } +#endif first = 0; diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h index 0a7eedd10..6fd0a694e 100644 --- a/src/os/unix/ngx_freebsd_config.h +++ b/src/os/unix/ngx_freebsd_config.h @@ -22,9 +22,22 @@ #include <osreldate.h> -#define QD_FMT "%qd" -#define QX_FMT "%qx" -#define OFF_FMT "%qd" +/* STUB */ +#define QD_FMT "%lld" +#define QX_FMT "%llx" +/**/ + +#if (i386) +#define OFF_FMT "%lld" +#define SIZE_FMT "%d" +#define SIZEX_FMT "%x" +#else +#define OFF_FMT "%ld" +#define SIZE_FMT "%ld" +#define SIZEX_FMT "%lx" +#endif + +#define PID_FMT "%d" #ifndef HAVE_SELECT diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c index a888c3613..a3c813e38 100644 --- a/src/os/unix/ngx_freebsd_sendfile_chain.c +++ b/src/os/unix/ngx_freebsd_sendfile_chain.c @@ -15,7 +15,8 @@ Until FreeBSD 4.5 the turning TCP_NOPUSH off does not not flush the pending data that less than MSS and the data sent with 5 second delay. - So we use TCP_NOPUSH on FreeBSD 4.5+ only. + So we use TCP_NOPUSH on FreeBSD prior to 4.5 only if the connection + is not needed not keepalive. */ @@ -23,7 +24,7 @@ ngx_chain_t *ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in) { int rc, eintr, tcp_nopush; char *prev; - size_t hsize, size; + ssize_t hsize, size; off_t sent; struct iovec *iov; struct sf_hdtr hdtr; diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h index 96e1d8856..27fa317bc 100644 --- a/src/os/unix/ngx_linux_config.h +++ b/src/os/unix/ngx_linux_config.h @@ -29,14 +29,11 @@ #include <netdb.h> -typedef unsigned int u_int; -typedef unsigned short u_short; -typedef unsigned char u_char; - -#define QD_FMT "%qd" -#define QX_FMT "%qx" -#define OFF_FMT "%qd" +#define QD_FMT "%qd" +#define QX_FMT "%qx" +#define OFF_FMT "%qd" +#define PID_FMT "%d" #ifndef HAVE_SELECT @@ -63,7 +60,7 @@ typedef unsigned char u_char; #ifndef HAVE_FIONBIO -#define HAVE_FIONBIO 1 +#define HAVE_FIONBIO 1 #endif diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c index 8432f0c8d..744bf99bc 100644 --- a/src/os/unix/ngx_readv_chain.c +++ b/src/os/unix/ngx_readv_chain.c @@ -1,6 +1,7 @@ #include <ngx_config.h> #include <ngx_core.h> +#include <ngx_event.h> ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *entry) diff --git a/src/os/unix/ngx_recv.c b/src/os/unix/ngx_recv.c index 98607d0c7..154565413 100644 --- a/src/os/unix/ngx_recv.c +++ b/src/os/unix/ngx_recv.c @@ -1,6 +1,7 @@ #include <ngx_config.h> #include <ngx_core.h> +#include <ngx_event.h> static int ngx_unix_recv_error(ngx_event_t *rev, ngx_err_t err); diff --git a/src/os/unix/ngx_socket.c b/src/os/unix/ngx_socket.c index 941fc8cd1..48016cb10 100644 --- a/src/os/unix/ngx_socket.c +++ b/src/os/unix/ngx_socket.c @@ -55,8 +55,7 @@ int ngx_tcp_push(ngx_socket_t s) (const void *) &tcp_nopush, sizeof(int)); } -#else - +#else int ngx_tcp_nopush(ngx_socket_t s) { diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h index e7946449d..78eeb7213 100644 --- a/src/os/unix/ngx_solaris_config.h +++ b/src/os/unix/ngx_solaris_config.h @@ -30,6 +30,7 @@ typedef uint32_t u_int32_t; #define QD_FMT "%lld" #define QX_FMT "%llx" #define OFF_FMT "%lld" +#define PID_FMT "%ld" #ifndef HAVE_SELECT @@ -62,7 +63,7 @@ typedef uint32_t u_int32_t; #ifndef HAVE_FIONBIO -#define HAVE_FIONBIO 1 +#define HAVE_FIONBIO 1 #endif diff --git a/src/os/unix/ngx_writev_chain.c b/src/os/unix/ngx_writev_chain.c index b667bc507..32b2dd48d 100644 --- a/src/os/unix/ngx_writev_chain.c +++ b/src/os/unix/ngx_writev_chain.c @@ -6,15 +6,14 @@ ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in) { char *prev; - size_t size; - ssize_t n; + ssize_t n, size; off_t sent; struct iovec *iov; ngx_err_t err; - ngx_array_t io; + ngx_array_t iovecs; ngx_chain_t *ce; - ngx_init_array(io, c->pool, 10, sizeof(struct iovec), NGX_CHAIN_ERROR); + ngx_init_array(iovecs, c->pool, 10, sizeof(struct iovec), NGX_CHAIN_ERROR); prev = NULL; iov = NULL; @@ -27,14 +26,14 @@ ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in) prev = ce->hunk->last; } else { - ngx_test_null(iov, ngx_push_array(&io), NGX_CHAIN_ERROR); + ngx_test_null(iov, ngx_push_array(&iovecs), NGX_CHAIN_ERROR); iov->iov_base = ce->hunk->pos; iov->iov_len = ce->hunk->last - ce->hunk->pos; prev = ce->hunk->last; } } - n = writev(c->fd, (struct iovec *) io.elts, io.nelts); + n = writev(c->fd, iovecs.elts, iovecs.nelts); if (n == -1) { err = ngx_errno; @@ -93,7 +92,7 @@ ngx_log_debug(c->log, "SIZE: %d" _ size); break; } - ngx_destroy_array(&io); + ngx_destroy_array(&iovecs); return ce; } |
