Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-20 10:05:50 +0300
committerIgor Sysoev <igor@sysoev.ru>2003-11-20 10:05:50 +0300
commitbb6ec8c9fd4d23848ac3dddb1296d8fac5c99da8 (patch)
tree686cdfcc4199f807495a150e410f43940c4451cc /src
parent160d774afcf3cdd4f999489211eb9d78bf82439a (diff)
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Diffstat (limited to 'src')
-rw-r--r--src/core/ngx_auto_config.h7
-rw-r--r--src/core/ngx_connection.h71
-rw-r--r--src/event/ngx_event_accept.c6
-rw-r--r--src/http/ngx_http_request.c23
-rw-r--r--src/os/unix/ngx_freebsd_config.h14
5 files changed, 18 insertions, 103 deletions
diff --git a/src/core/ngx_auto_config.h b/src/core/ngx_auto_config.h
deleted file mode 100644
index fe5fbd030..000000000
--- a/src/core/ngx_auto_config.h
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#ifndef OFF_EQUAL_PTR
-#define OFF_EQUAL_PTR 0
-#endif
-
-
-#define NGX_PAGE_SIZE 4096
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h
index e82ae583e..da6f37a01 100644
--- a/src/core/ngx_connection.h
+++ b/src/core/ngx_connection.h
@@ -62,9 +62,6 @@ struct ngx_connection_s {
off_t sent;
-#if 0
- void (*handler)(ngx_connection_t *c);
-#endif
void *ctx;
void *servers;
@@ -72,11 +69,6 @@ struct ngx_connection_s {
ngx_log_t *log;
ngx_pool_t *pool;
-#if 0
- int pool_size;
-
- int family;
-#endif
struct sockaddr *sockaddr;
socklen_t socklen;
@@ -87,15 +79,7 @@ struct ngx_connection_s {
socklen_t local_socklen;
#endif
-#if 0
- int addr;
- int addr_text_max_len;
-#endif
-
ngx_hunk_t *buffer;
-#if 0
- unsigned int post_accept_timeout;
-#endif
int number;
@@ -108,62 +92,7 @@ struct ngx_connection_s {
};
-
-
-
-#if 0
-cached file
- int fd; -2 unused, -1 closed (but read or mmaped), >=0 open
- char *name;
-
- void *buf; addr if read or mmaped
- aiocb* if aio_read
- OVERLAPPED if TransmitFile or TransmitPackets
- NULL if sendfile
-
- size_t buf_size; for plain read
- off_t offset; for plain read
-
- size_t size;
- time_t mod;
- char *last_mod; "Sun, 17 Mar 2002 19:39:50 GMT"
- char *etag; ""a6d08-1302-3c94f106""
- char *len; "4866"
-
-EV_VNODE should notify by some signal if diretory tree is changed
- or stat if aged >= N seconds (big enough)
-#endif
-
-
-#if 0
-typedef struct {
- ssize_t (*recv)(ngx_connection_t *c, char *buf, size_t size);
- void *dummy_recv_chain;
- void *dummy_send;
- ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in);
-} ngx_os_io_t;
-#endif
-
-
-
-extern ngx_array_t ngx_listening_sockets;
extern ngx_os_io_t ngx_io;
-extern ngx_chain_t *(*ngx_write_chain_proc)
- (ngx_connection_t *c, ngx_chain_t *in);
-
-
-ssize_t ngx_recv_chain(ngx_connection_t *c, ngx_chain_t *ce);
-#if 0
-ngx_chain_t *ngx_write_chain(ngx_connection_t *c, ngx_chain_t *in, off_t flush);
-#endif
-
-
-/* TODO: move it to OS specific file */
-#if (__FreeBSD__)
-ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in);
-#endif
-
-
#endif /* _NGX_CONNECTION_H_INCLUDED_ */
diff --git a/src/event/ngx_event_accept.c b/src/event/ngx_event_accept.c
index 17f8899a5..ea63724e9 100644
--- a/src/event/ngx_event_accept.c
+++ b/src/event/ngx_event_accept.c
@@ -85,7 +85,7 @@ void ngx_event_accept(ngx_event_t *ev)
ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
"accept() on %s returned socket #%d while "
"only %d connections was configured, "
- "sleeping for 1 second",
+ "closing the connection",
ls->listening->addr_text.data, s, ecf->connections);
if (ngx_close_socket(s) == -1) {
@@ -93,7 +93,7 @@ void ngx_event_accept(ngx_event_t *ev)
ngx_close_socket_n "failed");
}
- ngx_msleep(1000);
+ /* TODO: disable temporary accept() event */
ngx_destroy_pool(pool);
return;
@@ -225,11 +225,9 @@ void ngx_event_accept(ngx_event_t *ev)
ls->listening->handler(c);
-#if 0
if (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT) {
ev->available--;
}
-#endif
accepted++;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 62c9a666a..ccaa73f7d 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -157,7 +157,7 @@ ngx_log_debug(rev->log, "IN: %08x" _ in_port);
if (in_port->addrs.nelts > 1) {
/*
- * there're the several addresses on this port and one of them
+ * There're the several addresses on this port and one of them
* is "*:port" so getsockname() is needed to determine
* the server address.
* AcceptEx() already gave this address.
@@ -346,11 +346,13 @@ static void ngx_http_process_request_line(ngx_event_t *rev)
r->request_line.len = r->request_end - r->request_start;
- /* if the large client headers are enabled then
- we need to copy a request line */
-
if (cscf->large_client_header) {
+ /*
+ * if the large client headers are enabled then
+ * we need to copy a request line
+ */
+
r->request_line.data = ngx_palloc(r->pool, r->request_line.len + 1);
if (r->request_line.data == NULL) {
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
@@ -366,9 +368,11 @@ static void ngx_http_process_request_line(ngx_event_t *rev)
r->request_line.data[r->request_line.len] = '\0';
}
- /* copy URI extention if it exists */
if (r->uri_ext) {
+
+ /* copy URI extention */
+
if (r->args_start) {
r->exten.len = r->args_start - 1 - r->uri_ext;
} else {
@@ -384,9 +388,10 @@ static void ngx_http_process_request_line(ngx_event_t *rev)
ngx_cpystrn(r->exten.data, r->uri_ext, r->exten.len + 1);
}
- /* copy URI arguments if they exist */
-
if (r->args_start && r->uri_end > r->args_start) {
+
+ /* copy URI arguments */
+
r->args.len = r->uri_end - r->args_start;
if (!(r->args.data = ngx_palloc(r->pool, r->args.len + 1))) {
@@ -446,8 +451,8 @@ static void ngx_http_process_request_line(ngx_event_t *rev)
/*
* If it's a pipelined request and a request line is not complete
- * then we need to copy it to the start of the r->header_in hunk.
- * We need to copy it here only if the large client headers
+ * then we have to copy it to the start of the r->header_in hunk.
+ * We have to copy it here only if the large client headers
* are enabled otherwise a request line had been already copied
* to the start of the r->header_in hunk in ngx_http_set_keepalive().
*/
diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h
index a045a1d07..8a2f55e2f 100644
--- a/src/os/unix/ngx_freebsd_config.h
+++ b/src/os/unix/ngx_freebsd_config.h
@@ -27,18 +27,6 @@
#include <osreldate.h>
-/* TODO: autoconf */
-#if __FreeBSD_version < 300007
-typedef u_int64_t uint64_t;
-typedef u_int32_t uintptr_t;
-#endif
-
-
-/* TODO: autoconf ??? */
-#if __FreeBSD_version < 330002 /* exactly */
-typedef uint32_t socklen_t;
-#endif
-
/* TODO: autoconf */
#if (i386)
@@ -55,7 +43,9 @@ typedef uint32_t socklen_t;
#endif
+#if 0
#define TIME_FMT "%ld"
+#endif
#define PID_FMT "%d"
#define RLIM_FMT "%lld"