nginx-0.0.1-2003-06-12-09:54:39 import
diff --git a/src/core/ngx_alloc.c b/src/core/ngx_alloc.c
index af59a22..050fcbf 100644
--- a/src/core/ngx_alloc.c
+++ b/src/core/ngx_alloc.c
@@ -74,17 +74,17 @@
void *ngx_palloc(ngx_pool_t *pool, size_t size)
{
- void *m;
+ char *m;
ngx_pool_t *p, *n;
ngx_pool_large_t *large, *last;
if (size <= NGX_MAX_ALLOC_FROM_POOL) {
for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
- if ((size_t) (p->end - ngx_align(p->last)) >= size) {
- m = ngx_align(p->last);
- p->last = ngx_align(p->last);
- p->last += size ;
+ m = ngx_align(p->last);
+
+ if ((size_t) (p->end - m) >= size) {
+ p->last = m + size ;
return m;
}
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index b9a0988..807ca06 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -38,10 +38,10 @@
/* TODO: auto_conf */
-#define NGX_ALIGN (4 - 1)
-#define NGX_ALIGN_TYPE (unsigned int)
+#define NGX_ALIGN (sizeof(unsigned long) - 1) /* platform word */
+#define NGX_ALIGN_CAST (unsigned long) /* size of the pointer */
-#define ngx_align(p) (char *) ((NGX_ALIGN_TYPE p + NGX_ALIGN) & ~NGX_ALIGN)
+#define ngx_align(p) (char *) ((NGX_ALIGN_CAST p + NGX_ALIGN) & ~NGX_ALIGN)
/* TODO: auto_conf: ngx_inline inline __inline __inline__ */
@@ -50,16 +50,16 @@
#endif
-#ifndef INFTIM /* Linux */
-#define INFTIM -1
+#ifndef INFTIM /* Linux */
+#define INFTIM -1
#endif
-#ifndef INADDR_NONE /* Solaris */
-#define INADDR_NONE ((unsigned long) -1)
+#ifndef INADDR_NONE /* Solaris */
+#define INADDR_NONE ((unsigned int) -1)
#endif
-#ifndef INET_ADDRSTRLEN
-#define INET_ADDRSTRLEN 16
+#ifndef INET_ADDRSTRLEN /* Win32 */
+#define INET_ADDRSTRLEN 16
#endif
diff --git a/src/core/ngx_core.h b/src/core/ngx_core.h
index 8963d08..5736756 100644
--- a/src/core/ngx_core.h
+++ b/src/core/ngx_core.h
@@ -56,8 +56,10 @@
*/
+#if 0
/* STUB */
extern ngx_log_t ngx_log;
+#endif
#endif /* _NGX_CORE_H_INCLUDED_ */
diff --git a/src/core/ngx_os_init.h b/src/core/ngx_os_init.h
index 8a14ad0..3555095 100644
--- a/src/core/ngx_os_init.h
+++ b/src/core/ngx_os_init.h
@@ -25,8 +25,8 @@
typedef struct {
ssize_t (*recv)(ngx_connection_t *c, char *buf, size_t size);
- void *dummy_recv_chain;
- void *dummy_send;
+ ssize_t (*recv_chain)(ngx_connection_t *c, ngx_chain_t *in);
+ ssize_t (*send)(ngx_connection_t *c, char *buf, size_t size);
ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in);
int flags;
} ngx_os_io_t;
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 005f230..10f0023 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -513,7 +513,8 @@
/* prepare for the next cycle */
- (char *) in_port[p].addrs.elts += in_port[p].addrs.size;
+ in_port[p].addrs.elts = (char *) in_port[p].addrs.elts
+ + in_port[p].addrs.size;
in_port[p].addrs.nelts--;
in_addr = (ngx_http_in_addr_t *) in_port[p].addrs.elts;
diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h
index 4cf966a..df9bcca 100644
--- a/src/http/ngx_http_core_module.h
+++ b/src/http/ngx_http_core_module.h
@@ -35,9 +35,9 @@
ngx_msec_t post_accept_timeout;
ssize_t connection_pool_size;
- size_t request_pool_size;
+ ssize_t request_pool_size;
ngx_msec_t client_header_timeout;
- size_t client_header_buffer_size;
+ ssize_t client_header_buffer_size;
int large_client_header;
} ngx_http_core_srv_conf_t;
@@ -99,8 +99,8 @@
int sendfile; /* sendfile */
ngx_msec_t send_timeout; /* send_timeout */
- size_t send_lowat; /* send_lowat */
- size_t discarded_buffer_size; /* discarded_buffer_size */
+ ssize_t send_lowat; /* send_lowat */
+ ssize_t discarded_buffer_size; /* discarded_buffer_size */
ngx_msec_t keepalive_timeout; /* keepalive_timeout */
ngx_msec_t lingering_time; /* lingering_time */
ngx_msec_t lingering_timeout; /* lingering_timeout */
diff --git a/src/http/ngx_http_event.c b/src/http/ngx_http_event.c
index 991b87d..06a98a3 100644
--- a/src/http/ngx_http_event.c
+++ b/src/http/ngx_http_event.c
@@ -1035,8 +1035,7 @@
static int ngx_http_read_discarded_body(ngx_http_request_t *r)
{
- size_t size;
- ssize_t n;
+ ssize_t size, n;
ngx_http_core_loc_conf_t *clcf;
ngx_log_debug(r->connection->log, "http read discarded body");
@@ -1318,7 +1317,7 @@
or the end of parsed header (otherwise)
instead of r->header_in->last */
- if ((size_t)(r->header_in->end - r->header_in->last)
+ if (r->header_in->end - r->header_in->last
>= clcf->discarded_buffer_size) {
r->discarded_buffer = r->header_in->last;
diff --git a/src/http/ngx_http_output_filter.c b/src/http/ngx_http_output_filter.c
index 7ee6a96..09b7bfa 100644
--- a/src/http/ngx_http_output_filter.c
+++ b/src/http/ngx_http_output_filter.c
@@ -69,7 +69,7 @@
int ngx_http_output_filter(ngx_http_request_t *r, ngx_hunk_t *hunk)
{
int rc;
- size_t size;
+ ssize_t size;
ngx_chain_t *ce, *le;
ngx_http_output_filter_ctx_t *ctx;
ngx_http_output_filter_conf_t *conf;
diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h
index 6fd0a69..64175fe 100644
--- a/src/os/unix/ngx_freebsd_config.h
+++ b/src/os/unix/ngx_freebsd_config.h
@@ -22,22 +22,21 @@
#include <osreldate.h>
-/* 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"
+
+#define OFF_FMT "%lld"
+#define SIZE_FMT "%d"
+#define SIZEX_FMT "%x"
+
+#else /* amd64, alpha, sparc64, ia64 */
+
+#define OFF_FMT "%ld"
+#define SIZE_FMT "%ld"
+#define SIZEX_FMT "%lx"
+
#endif
-#define PID_FMT "%d"
+#define PID_FMT "%d"
#ifndef HAVE_SELECT
diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h
index 27fa317..9056657 100644
--- a/src/os/unix/ngx_linux_config.h
+++ b/src/os/unix/ngx_linux_config.h
@@ -30,10 +30,11 @@
-#define QD_FMT "%qd"
-#define QX_FMT "%qx"
-#define OFF_FMT "%qd"
-#define PID_FMT "%d"
+#define OFF_FMT "%lld"
+#define SIZE_FMT "%d"
+#define SIZEX_FMT "%x"
+#define PID_FMT "%d"
+
#ifndef HAVE_SELECT
diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h
index 78eeb72..a5b66c4 100644
--- a/src/os/unix/ngx_solaris_config.h
+++ b/src/os/unix/ngx_solaris_config.h
@@ -27,10 +27,10 @@
typedef uint32_t u_int32_t;
-#define QD_FMT "%lld"
-#define QX_FMT "%llx"
-#define OFF_FMT "%lld"
-#define PID_FMT "%ld"
+#define OFF_FMT "%lld"
+#define SIZE_FMT "%d"
+#define SIZEX_FMT "%x"
+#define PID_FMT "%ld"
#ifndef HAVE_SELECT
diff --git a/src/os/unix/ngx_time.h b/src/os/unix/ngx_time.h
index 4b5fa59..ee5b47f 100644
--- a/src/os/unix/ngx_time.h
+++ b/src/os/unix/ngx_time.h
@@ -5,7 +5,7 @@
#include <ngx_config.h>
typedef u_int ngx_msec_t;
-#define NGX_MAX_MSEC (u_int) ~0
+#define NGX_MAX_MSEC (u_int) -1
typedef struct tm ngx_tm_t;
diff --git a/src/os/win32/ngx_socket.h b/src/os/win32/ngx_socket.h
index 55629a1..a78c40c 100644
--- a/src/os/win32/ngx_socket.h
+++ b/src/os/win32/ngx_socket.h
@@ -8,7 +8,6 @@
#define NGX_WRITE_SHUTDOWN SD_SEND
-#define INET_ADDRSTRLEN 16
typedef SOCKET ngx_socket_t;
typedef int socklen_t;
diff --git a/src/os/win32/ngx_types.h b/src/os/win32/ngx_types.h
index b858fae..c009b5a 100644
--- a/src/os/win32/ngx_types.h
+++ b/src/os/win32/ngx_types.h
@@ -16,10 +16,10 @@
typedef BY_HANDLE_FILE_INFORMATION ngx_file_info_t;
-#define QD_FMT "%I64d"
-#define QX_FMT "%I64x"
-#define OFF_FMT "%I64d"
-#define PID_FMT "%d"
+#define OFF_FMT "%I64d"
+#define SIZE_FMT "%d"
+#define SIZEX_FMT "%x"
+#define PID_FMT "%d"
#endif /* _NGX_TYPES_H_INCLUDED_ */