nginx-0.0.1-2002-12-17-18:48:27 import
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index cc650c1..2582dda 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -107,6 +107,7 @@
#define HAVE_INHERITED_NONBLOCK 1
#endif
+/* FreeBSD sendfile */
#if __FreeBSD_version >= 300007
#ifndef HAVE_FREEBSD_SENDFILE
@@ -117,8 +118,9 @@
#define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 2
#endif
-#endif
+#endif /* FreeBSD sendfile */
+/* FreeBSD sendfile nbytes bug */
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 460100) \
|| __FreeBSD_version == 460001
|| __FreeBSD_version >= 500029
@@ -127,13 +129,14 @@
#define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 0
#endif
-#endif
+#endif /* FreeBSD sendfile nbytes bug */
#if (HAVE_FREEBSD_SENDFILE)
#define HAVE_SENDFILE 1
#endif
+/* FreeBSD kqueue */
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 410000) \
|| __FreeBSD_version >= 500011
@@ -142,7 +145,7 @@
#include <sys/event.h>
#endif
-#endif
+#endif /* FreeBSD kqueue */
#endif /* __FreeBSD__ */
diff --git a/src/core/ngx_sendfile.c b/src/core/ngx_sendfile.c
index bffd29c..e930fe5 100644
--- a/src/core/ngx_sendfile.c
+++ b/src/core/ngx_sendfile.c
@@ -1,5 +1,8 @@
#include <ngx_config.h>
+
+#if !(HAVE_SENDFILE)
+
#include <ngx_core.h>
#include <ngx_log.h>
#include <ngx_socket.h>
@@ -18,3 +21,5 @@
return NGX_ERROR;
}
+
+#endif
diff --git a/src/http/modules/ngx_http_index_handler.c b/src/http/modules/ngx_http_index_handler.c
index 1948795..db3e3cc 100644
--- a/src/http/modules/ngx_http_index_handler.c
+++ b/src/http/modules/ngx_http_index_handler.c
@@ -19,7 +19,7 @@
static ngx_command_t ngx_http_index_commands[] = {
- {"index", ngx_http_index_set_index, NULL,
+ {"index", ngx_http_index_set_index, 0,
NGX_HTTP_LOC_CONF, NGX_CONF_ITERATE,
"set index files"},
diff --git a/src/http/ngx_http_event.c b/src/http/ngx_http_event.c
index cbea0c6..60b3ca4 100644
--- a/src/http/ngx_http_event.c
+++ b/src/http/ngx_http_event.c
@@ -104,11 +104,11 @@
ngx_test_null(c->addr_text.data, ngx_palloc(c->pool, c->addr_text.len),
NGX_ERROR);
- ngx_test_null(c->addr_text.len,
- ngx_inet_ntop(c->family,
- (char *)c->sockaddr + c->addr,
- c->addr_text.data, c->addr_text.len),
- NGX_ERROR);
+ c->addr_text.len = ngx_inet_ntop(c->family,
+ (char *)c->sockaddr + c->addr,
+ c->addr_text.data, c->addr_text.len);
+ if (c->addr_text.len = 0)
+ return NGX_ERROR;
ngx_test_null(ctx, ngx_pcalloc(c->pool, sizeof(ngx_http_log_ctx_t)),
NGX_ERROR);
diff --git a/src/http/ngx_http_parse_time.c b/src/http/ngx_http_parse_time.c
index 199a7f9..9c606c2 100644
--- a/src/http/ngx_http_parse_time.c
+++ b/src/http/ngx_http_parse_time.c
@@ -207,7 +207,7 @@
month += 12;
year -= 1;
}
- /* Gauss's formula for days from 1 March 1 BC */
+ /* Gauss's formula for Grigorian days from 1 March 1 BC */
return (365 * year + year / 4 - year / 100 + year / 400
+ 367 * month / 12 + day - 31
/* 719527 days are between 1 March 1 BC and 1 March 1970,
diff --git a/src/os/unix/freebsd/ngx_sendfile.c b/src/os/unix/freebsd/ngx_sendfile.c
index ff577db..dcbf68a 100644
--- a/src/os/unix/freebsd/ngx_sendfile.c
+++ b/src/os/unix/freebsd/ngx_sendfile.c
@@ -1,5 +1,8 @@
#include <ngx_config.h>
+
+#if (HAVE_FREEBSD_SENDFILE)
+
#include <ngx_core.h>
#include <ngx_types.h>
#include <ngx_file.h>
@@ -10,12 +13,10 @@
#include <ngx_sendfile.h>
/*
- TODO:
- FreeBSD:
+ CHECK:
check sent if errno == EINTR then should return right sent.
*/
-#if (HAVE_FREEBSD_SENDFILE)
int ngx_sendfile(ngx_socket_t s,
ngx_iovec_t *headers, int hdr_cnt,