diff options
Diffstat (limited to 'src/os/win32')
33 files changed, 157 insertions, 263 deletions
diff --git a/src/os/win32/ngx_alloc.c b/src/os/win32/ngx_alloc.c index 591e61bcb..8b0cc20b1 100644 --- a/src/os/win32/ngx_alloc.c +++ b/src/os/win32/ngx_alloc.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> diff --git a/src/os/win32/ngx_alloc.h b/src/os/win32/ngx_alloc.h index d6ea00a2b..66798ceb3 100644 --- a/src/os/win32/ngx_alloc.h +++ b/src/os/win32/ngx_alloc.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_ALLOC_H_INCLUDED_ #define _NGX_ALLOC_H_INCLUDED_ diff --git a/src/os/win32/ngx_atomic.h b/src/os/win32/ngx_atomic.h index 9d75fabd5..994026139 100644 --- a/src/os/win32/ngx_atomic.h +++ b/src/os/win32/ngx_atomic.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_ATOMIC_H_INCLUDED_ #define _NGX_ATOMIC_H_INCLUDED_ diff --git a/src/os/win32/ngx_errno.c b/src/os/win32/ngx_errno.c index 865fbe37b..16bb2a5af 100644 --- a/src/os/win32/ngx_errno.c +++ b/src/os/win32/ngx_errno.c @@ -1,9 +1,14 @@ /* - TODO: - add WSA error messages for NT and 98 - test for English only messages -*/ + * Copyright (C) 2002-2004 Igor Sysoev + */ + + +/* + * TODO: + * add WSA error messages for NT and 98 + * test for English only messages + */ #include <ngx_config.h> #include <ngx_core.h> diff --git a/src/os/win32/ngx_errno.h b/src/os/win32/ngx_errno.h index d55b3956d..7ee9d560b 100644 --- a/src/os/win32/ngx_errno.h +++ b/src/os/win32/ngx_errno.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_ERRNO_H_INCLUDED_ #define _NGX_ERRNO_H_INCLUDED_ diff --git a/src/os/win32/ngx_files.c b/src/os/win32/ngx_files.c index 6ed4ff00f..c3be4fb65 100644 --- a/src/os/win32/ngx_files.c +++ b/src/os/win32/ngx_files.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> diff --git a/src/os/win32/ngx_files.h b/src/os/win32/ngx_files.h index c59e79d16..0a01ecc3d 100644 --- a/src/os/win32/ngx_files.h +++ b/src/os/win32/ngx_files.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_FILES_H_INCLUDED_ #define _NGX_FILES_H_INCLUDED_ diff --git a/src/os/win32/ngx_os.h b/src/os/win32/ngx_os.h index c04eacaa8..3072e3bdd 100644 --- a/src/os/win32/ngx_os.h +++ b/src/os/win32/ngx_os.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_OS_H_INCLUDED_ #define _NGX_OS_H_INCLUDED_ diff --git a/src/os/win32/ngx_os_thread.c b/src/os/win32/ngx_os_thread.c deleted file mode 100644 index c9d540cc1..000000000 --- a/src/os/win32/ngx_os_thread.c +++ /dev/null @@ -1,26 +0,0 @@ - - -#include <ngx_config.h> - -#include <ngx_log.h> -#include <ngx_os_thread.h> - - -int ngx_create_os_thread(ngx_os_tid_t *tid, void *stack, - ngx_thread_start_routine_t func, void *arg, - ngx_log_t log) -{ - ngx_os_tid_t id; - int dummy; /* needed in Win9X only, in NT can be NULL */ - - id = CreateThread(NULL, stack_size, func, arg, 0, &dummy); - - if (id == NULL) { - ngx_log_error(NGX_LOG_ERR, log, err, "CreateThread() failed"); - return NGX_ERROR; - } - - *tid = id; - - return NGX_OK; -} diff --git a/src/os/win32/ngx_os_thread.h b/src/os/win32/ngx_os_thread.h deleted file mode 100644 index 81eb3b968..000000000 --- a/src/os/win32/ngx_os_thread.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _NGX_OS_THREAD_H_INCLUDED_ -#define _NGX_OS_THREAD_H_INCLUDED_ - - -#include <ngx_config.h> - - -typedef HANDLE ngx_os_tid_t; -typedef int ngx_tid_t; - -typedef LPTHREAD_START_ROUTINE ngx_thread_start_routine_t - - -#endif /* _NGX_OS_THREAD_H_INCLUDED_ */ diff --git a/src/os/win32/ngx_process.c b/src/os/win32/ngx_process.c index 6d78c1c13..23b169738 100644 --- a/src/os/win32/ngx_process.c +++ b/src/os/win32/ngx_process.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> diff --git a/src/os/win32/ngx_process.h b/src/os/win32/ngx_process.h index 767a88d23..ba4603c31 100644 --- a/src/os/win32/ngx_process.h +++ b/src/os/win32/ngx_process.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_PROCESS_H_INCLUDED_ #define _NGX_PROCESS_H_INCLUDED_ diff --git a/src/os/win32/ngx_process_cycle.c b/src/os/win32/ngx_process_cycle.c index 93a2cdb3b..b6d2578ca 100644 --- a/src/os/win32/ngx_process_cycle.c +++ b/src/os/win32/ngx_process_cycle.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> #include <ngx_event.h> diff --git a/src/os/win32/ngx_process_cycle.h b/src/os/win32/ngx_process_cycle.h index 0a91e84f5..7803686ec 100644 --- a/src/os/win32/ngx_process_cycle.h +++ b/src/os/win32/ngx_process_cycle.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_PROCESS_CYCLE_H_INCLUDED_ #define _NGX_PROCESS_CYCLE_H_INCLUDED_ diff --git a/src/os/win32/ngx_recv.h b/src/os/win32/ngx_recv.h deleted file mode 100644 index e92832cc7..000000000 --- a/src/os/win32/ngx_recv.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _NGX_RECV_H_INCLUDED_ -#define _NGX_RECV_H_INCLUDED_ - - -#include <errno.h> - -#define ngx_recv(fd, buf, size, flags) recv(fd, buf, size, flags) - - -#endif /* _NGX_RECV_H_INCLUDED_ */ diff --git a/src/os/win32/ngx_sendfile.c b/src/os/win32/ngx_sendfile.c deleted file mode 100644 index 2dd779d19..000000000 --- a/src/os/win32/ngx_sendfile.c +++ /dev/null @@ -1,145 +0,0 @@ - -#include <ngx_config.h> -#include <ngx_core.h> -#include <ngx_types.h> -#include <ngx_files.h> -#include <ngx_socket.h> -#include <ngx_errno.h> -#include <ngx_log.h> -#include <ngx_connection.h> -#include <ngx_sendv.h> -#include <ngx_sendfile.h> - -/* - TODO: - various flags - TransmitPackets -*/ - -#if (HAVE_WIN32_TRANSMITFILE) - -int ngx_sendfile(ngx_connection_t *c, - ngx_iovec_t *headers, int hdr_cnt, - ngx_fd_t fd, off_t offset, size_t nbytes, - ngx_iovec_t *trailers, int trl_cnt, - off_t *sent, u_int flags) -{ - int tfrc, rc; - ngx_err_t tf_err, err; - OVERLAPPED olp; - TRANSMIT_FILE_BUFFERS tfb, *ptfb; - -#if 0 - ev = c->write; - - if (ev->timedout) { - ngx_set_socket_errno(NGX_ETIMEDOUT); - ngx_log_error(NGX_LOG_ERR, ev->log, 0, "TransmitFile() timed out"); - - return NGX_ERROR; - } - - if (ev->ready) { - ev->ready = 0; - -#if (HAVE_IOCP) /* iocp */ - - if (ngx_event_flags & NGX_HAVE_IOCP_EVENT) { - if (ev->ovlp.error) { - ngx_log_error(NGX_LOG_ERR, ev->log, 0, "TransmitFile() failed"); - return NGX_ERROR; - } - - return ev->available; - } - } - -#endif - - /* TODO: WSAGetOverlappedResult stuff */ - - } - -#endif - - - tf_err = 0; - err = 0; - - olp.Internal = 0; - olp.InternalHigh = 0; - olp.Offset = (DWORD) offset; - olp.OffsetHigh = (DWORD) (offset >> 32); - olp.hEvent = NULL; - - if (headers || trailers) { - tfb.Head = headers->ngx_iov_base; - tfb.HeadLength = headers->ngx_iov_len; - tfb.Tail = trailers->ngx_iov_base; - tfb.TailLength = trailers->ngx_iov_len; - ptfb = &tfb; - - } else { - ptfb = NULL; - } - -#if 1 - flags = TF_DISCONNECT|TF_REUSE_SOCKET; - tfrc = transmitfile(c->fd, NULL, 0, 0, &olp, NULL, flags); -#else - tfrc = TransmitFile(c->fd, fd, nbytes, 0, &olp, ptfb, flags); -#endif - -#if 0 -#if 1 - tfrc = TransmitFile(c->fd, fd, nbytes, 0, &olp, ptfb, 0); -#else - tfrc = TransmitFile(c->fd, fd, nbytes, 0, NULL, ptfb, 0); -#endif -#endif - - if (tfrc == 0) { - tf_err = ngx_socket_errno; - ngx_log_error(NGX_LOG_NOTICE, c->log, tf_err, - "ngx_sendfile: TransmitFile failed"); - if (tf_err == WSA_IO_PENDING) { - return NGX_AGAIN; - } - } - - /* set sent */ -#if 0 - rc = WSAGetOverlappedResult(c->fd, &olp, (unsigned long *) sent, 0, NULL); -#else - *sent = olp.InternalHigh; - rc = 1; -#endif - - ngx_log_debug(c->log, "TransmitFile: %d, @%I64d %I64d:%d" _ - tfrc _ offset _ *sent _ nbytes); - - if (rc == 0) { - err = ngx_socket_errno; - ngx_log_error(NGX_LOG_ERR, c->log, err, - "ngx_sendfile: WSAGetOverlappedResult failed"); - } - - if (tfrc == 0) { - if (tf_err != NGX_EAGAIN) { - ngx_log_error(NGX_LOG_ERR, c->log, tf_err, - "ngx_sendfile: TransmitFile failed"); - return NGX_ERROR; - } - - ngx_log_error(NGX_LOG_INFO, c->log, tf_err, - "ngx_sendfile: TransmitFile sent only %I64d bytes", - *sent); - } - - if (rc == 0) - return NGX_ERROR; - - return NGX_OK; -} - -#endif diff --git a/src/os/win32/ngx_sendv.c b/src/os/win32/ngx_sendv.c deleted file mode 100644 index b04362990..000000000 --- a/src/os/win32/ngx_sendv.c +++ /dev/null @@ -1,46 +0,0 @@ - -#include <ngx_config.h> - -#include <ngx_core.h> -#include <ngx_types.h> -#include <ngx_errno.h> -#include <ngx_connection.h> -#include <ngx_log.h> -#include <ngx_sendv.h> - -#include <ngx_string.h> - -ssize_t ngx_sendv(ngx_connection_t *c, ngx_iovec_t *iovec, int n) -{ - int rc; - size_t sent; - ngx_err_t err; - -#if 0 - /* STUB: WSABUF must be 4-byte aligned. Undocumented WSAEINVAL error */ - ngx_iovec_t iov[10]; - ngx_memcpy(iov, iovec, n * sizeof(ngx_iovec_t)); -#endif - - sent = 0; - - ngx_log_debug(c->log, "WSASend: %d, %d, %08x" _ c->fd _ n _ iovec); - - rc = WSASend(c->fd, iovec, n, &sent, 0, NULL, NULL); - - ngx_log_debug(c->log, "WSASend() done"); - - if (rc == SOCKET_ERROR) { - err = ngx_socket_errno; - - if (err == NGX_EAGAIN) { - ngx_log_error(NGX_LOG_INFO, c->log, err, "WSASend() eagain"); - return NGX_AGAIN; - } - - ngx_log_error(NGX_LOG_ERR, c->log, err, "WSASend() failed"); - return NGX_ERROR; - } - - return sent; -} diff --git a/src/os/win32/ngx_sendv.h b/src/os/win32/ngx_sendv.h deleted file mode 100644 index 0d20310b7..000000000 --- a/src/os/win32/ngx_sendv.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _NGX_SENDV_H_INCLUDED_ -#define _NGX_SENDV_H_INCLUDED_ - - -#include <ngx_config.h> -#include <ngx_connection.h> - -typedef WSABUF ngx_iovec_t; -#define ngx_iov_base buf -#define ngx_iov_len len - -ssize_t ngx_sendv(ngx_connection_t *c, ngx_iovec_t *iovec, int n); - - -#endif /* _NGX_SENDV_H_INCLUDED_ */ diff --git a/src/os/win32/ngx_service.c b/src/os/win32/ngx_service.c index 64a54ee63..d9c9ad587 100644 --- a/src/os/win32/ngx_service.c +++ b/src/os/win32/ngx_service.c @@ -1,4 +1,10 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + + #define NGX_SERVICE_CONTROL_SHUTDOWN 128 #define NGX_SERVICE_CONTROL_REOPEN 129 diff --git a/src/os/win32/ngx_shared.h b/src/os/win32/ngx_shared.h index ca077df42..40bf7bfa9 100644 --- a/src/os/win32/ngx_shared.h +++ b/src/os/win32/ngx_shared.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_SHARED_H_INCLUDED_ #define _NGX_SHARED_H_INCLUDED_ diff --git a/src/os/win32/ngx_socket.c b/src/os/win32/ngx_socket.c index e3f6f5c96..c397f7b22 100644 --- a/src/os/win32/ngx_socket.c +++ b/src/os/win32/ngx_socket.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> diff --git a/src/os/win32/ngx_socket.h b/src/os/win32/ngx_socket.h index 4401c3de2..f1459bc42 100644 --- a/src/os/win32/ngx_socket.h +++ b/src/os/win32/ngx_socket.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_SOCKET_H_INCLUDED_ #define _NGX_SOCKET_H_INCLUDED_ diff --git a/src/os/win32/ngx_stat.c b/src/os/win32/ngx_stat.c index 786bc7f38..ee63c0c94 100644 --- a/src/os/win32/ngx_stat.c +++ b/src/os/win32/ngx_stat.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> diff --git a/src/os/win32/ngx_thread.h b/src/os/win32/ngx_thread.h index cb282fbc0..be07db620 100644 --- a/src/os/win32/ngx_thread.h +++ b/src/os/win32/ngx_thread.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_THREAD_H_INCLUDED_ #define _NGX_THREAD_H_INCLUDED_ diff --git a/src/os/win32/ngx_time.c b/src/os/win32/ngx_time.c index 85d1a3b6d..a4412fc0b 100644 --- a/src/os/win32/ngx_time.c +++ b/src/os/win32/ngx_time.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> @@ -13,7 +18,7 @@ void ngx_gettimeofday(struct timeval *tp) /* * A file time is a 64-bit value that represents the number * of 100-nanosecond intervals that have elapsed since - * 12:00 A.M. January 1, 1601 (UTC). + * January 1, 1601 12:00 A.M. UTC. * * Between January 1, 1970 (Epoch) and January 1, 1601 there were * 134744 days, diff --git a/src/os/win32/ngx_time.h b/src/os/win32/ngx_time.h index a51c4f99e..fcd494fda 100644 --- a/src/os/win32/ngx_time.h +++ b/src/os/win32/ngx_time.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_TIME_H_INCLUDED_ #define _NGX_TIME_H_INCLUDED_ diff --git a/src/os/win32/ngx_types.h b/src/os/win32/ngx_types.h index 760342968..0e12d376b 100644 --- a/src/os/win32/ngx_types.h +++ b/src/os/win32/ngx_types.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_TYPES_H_INCLUDED_ #define _NGX_TYPES_H_INCLUDED_ diff --git a/src/os/win32/ngx_user.h b/src/os/win32/ngx_user.h index 480a25885..561041b94 100644 --- a/src/os/win32/ngx_user.h +++ b/src/os/win32/ngx_user.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_USER_H_INCLUDED_ #define _NGX_USER_H_INCLUDED_ diff --git a/src/os/win32/ngx_win32_config.h b/src/os/win32/ngx_win32_config.h index 6bbe66bcf..7c66dbc70 100644 --- a/src/os/win32/ngx_win32_config.h +++ b/src/os/win32/ngx_win32_config.h @@ -1,3 +1,9 @@ + +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #ifndef _NGX_WIN32_CONFIG_H_INCLUDED_ #define _NGX_WIN32_CONFIG_H_INCLUDED_ @@ -8,8 +14,8 @@ #define WIN32_LEAN_AND_MEAN /* - * we need to include windows.h explicity before winsock2.h because - * the warning 4201 is enabled in windows.h + * we need to include <windows.h> explicity before <winsock2.h> because + * the warning 4201 is enabled in <windows.h> */ #include <windows.h> diff --git a/src/os/win32/ngx_win32_init.c b/src/os/win32/ngx_win32_init.c index 7d9d433e5..61de9639b 100644 --- a/src/os/win32/ngx_win32_init.c +++ b/src/os/win32/ngx_win32_init.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> diff --git a/src/os/win32/ngx_wsarecv.c b/src/os/win32/ngx_wsarecv.c index 1598c6b20..2eb04ed09 100644 --- a/src/os/win32/ngx_wsarecv.c +++ b/src/os/win32/ngx_wsarecv.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> #include <ngx_event.h> diff --git a/src/os/win32/ngx_wsarecv_chain.c b/src/os/win32/ngx_wsarecv_chain.c index e417cfff6..5b0f18ba8 100644 --- a/src/os/win32/ngx_wsarecv_chain.c +++ b/src/os/win32/ngx_wsarecv_chain.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> #include <ngx_event.h> diff --git a/src/os/win32/ngx_wsasend_chain.c b/src/os/win32/ngx_wsasend_chain.c index eda422ed2..406d5950d 100644 --- a/src/os/win32/ngx_wsasend_chain.c +++ b/src/os/win32/ngx_wsasend_chain.c @@ -1,4 +1,9 @@ +/* + * Copyright (C) 2002-2004 Igor Sysoev + */ + + #include <ngx_config.h> #include <ngx_core.h> #include <ngx_event.h> |