diff options
Diffstat (limited to 'src/os/unix')
-rw-r--r-- | src/os/unix/ngx_freebsd_config.h | 10 | ||||
-rw-r--r-- | src/os/unix/ngx_freebsd_init.c | 4 | ||||
-rw-r--r-- | src/os/unix/ngx_freebsd_sendfile_chain.c (renamed from src/os/unix/ngx_freebsd_write_chain.c) | 2 | ||||
-rw-r--r-- | src/os/unix/ngx_linux_config.h | 22 | ||||
-rw-r--r-- | src/os/unix/ngx_solaris_config.h | 13 | ||||
-rw-r--r-- | src/os/unix/ngx_writev_chain.c | 6 |
6 files changed, 31 insertions, 26 deletions
diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h index f8066e561..73646fa0a 100644 --- a/src/os/unix/ngx_freebsd_config.h +++ b/src/os/unix/ngx_freebsd_config.h @@ -6,22 +6,16 @@ #include <stddef.h> /* offsetof */ #include <stdlib.h> #include <stdio.h> -#include <stdarg.h> #include <fcntl.h> #include <signal.h> -#include <string.h> -#include <time.h> #include <sys/types.h> -#include <sys/mman.h> -#include <sys/wait.h> -#include <sys/socket.h> +#include <sys/time.h> #include <sys/uio.h> #include <sys/ioctl.h> #include <sys/resource.h> +#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> -#include <netdb.h> - #include <osreldate.h> diff --git a/src/os/unix/ngx_freebsd_init.c b/src/os/unix/ngx_freebsd_init.c index aac8ed988..100dfc475 100644 --- a/src/os/unix/ngx_freebsd_init.c +++ b/src/os/unix/ngx_freebsd_init.c @@ -14,7 +14,7 @@ ngx_os_io_t ngx_os_io = { ngx_unix_recv, ngx_readv_chain, NULL, - ngx_freebsd_write_chain, + ngx_freebsd_sendfile_chain, NGX_HAVE_SENDFILE|NGX_HAVE_ZEROCOPY }; @@ -56,7 +56,7 @@ int ngx_os_init(ngx_log_t *log) ngx_freebsd_kern_osreldate, __FreeBSD_version); -#if HAVE_FREEBSD_SENDFILE +#if (HAVE_FREEBSD_SENDFILE) /* The determination of the sendfile() nbytes bug is complex enough. There're two sendfile() syscalls: a new 393 has no bug while diff --git a/src/os/unix/ngx_freebsd_write_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c index 0317ade2c..fc510b72f 100644 --- a/src/os/unix/ngx_freebsd_write_chain.c +++ b/src/os/unix/ngx_freebsd_sendfile_chain.c @@ -12,7 +12,7 @@ #include <ngx_freebsd_init.h> -ngx_chain_t *ngx_freebsd_write_chain(ngx_connection_t *c, ngx_chain_t *in) +ngx_chain_t *ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in) { int rc; char *prev; diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h index 69a607ed5..e4c5dd0a3 100644 --- a/src/os/unix/ngx_linux_config.h +++ b/src/os/unix/ngx_linux_config.h @@ -2,24 +2,34 @@ #define _NGX_LINUX_CONFIG_H_INCLUDED_ +#define _XOPEN_SOURCE 500 + + #include <unistd.h> #include <stddef.h> /* offsetof */ #include <stdlib.h> #include <stdio.h> -#include <stdarg.h> #include <fcntl.h> #include <signal.h> -#include <string.h> #include <time.h> + +#define __USE_BSD +#include <string.h> +#undef __USE_BSD + #include <sys/types.h> -#include <sys/mman.h> -#include <sys/wait.h> -#include <sys/socket.h> +#include <sys/time.h> +#include <sys/select.h> #include <sys/uio.h> +#include <sys/ioctl.h> #include <sys/resource.h> +#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> -#include <netdb.h> + + +typedef unsigned int u_int; +typedef unsigned char u_char; #ifndef HAVE_SELECT diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h index 1545fc914..786cf0b67 100644 --- a/src/os/unix/ngx_solaris_config.h +++ b/src/os/unix/ngx_solaris_config.h @@ -4,29 +4,24 @@ #define SOLARIS 1 +#define _REENTRANT #define _FILE_OFFSET_BITS 64 /* must be before sys/types.h */ + #include <unistd.h> #include <stddef.h> /* offsetof */ #include <stdlib.h> #include <stdio.h> -#include <stdarg.h> #include <fcntl.h> -#include <time.h> #include <signal.h> -#include <string.h> -#include <strings.h> /* bzero() */ +#include <strings.h> + #include <sys/types.h> #include <sys/filio.h> /* FIONBIO */ #include <sys/stropts.h> /* INFTIM */ -#include <sys/mman.h> -#include <sys/wait.h> #include <sys/socket.h> -#include <sys/uio.h> -#include <sys/resource.h> #include <netinet/in.h> #include <arpa/inet.h> -#include <netdb.h> typedef uint32_t u_int32_t; diff --git a/src/os/unix/ngx_writev_chain.c b/src/os/unix/ngx_writev_chain.c index fdaa52a48..b667bc507 100644 --- a/src/os/unix/ngx_writev_chain.c +++ b/src/os/unix/ngx_writev_chain.c @@ -62,6 +62,8 @@ ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in) size = ce->hunk->last - ce->hunk->pos; +ngx_log_debug(c->log, "SIZE: %d" _ size); + if (sent >= size) { sent -= size; @@ -69,9 +71,11 @@ ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in) ce->hunk->pos = ce->hunk->last; } +#if 0 if (ce->hunk->type & NGX_HUNK_FILE) { ce->hunk->file_pos = ce->hunk->file_last; } +#endif continue; } @@ -80,9 +84,11 @@ ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in) ce->hunk->pos += sent; } +#if 0 if (ce->hunk->type & NGX_HUNK_FILE) { ce->hunk->file_pos += sent; } +#endif break; } |