summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.c10
-rw-r--r--src/core/ngx_conf_file.c10
-rw-r--r--src/core/ngx_conf_file.h8
-rw-r--r--src/core/ngx_config.h12
-rw-r--r--src/core/ngx_connection.h5
-rw-r--r--src/core/ngx_file.h2
-rw-r--r--src/core/ngx_listen.h1
-rw-r--r--src/core/ngx_sendfile.h9
8 files changed, 45 insertions, 12 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 3133f8792..895d13666 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -27,6 +27,7 @@ static void ngx_open_listening_sockets(ngx_log_t *log);
/* STUB */
int ngx_max_conn = 512;
+u_int ngx_sendfile_flags;
ngx_server_t ngx_server;
/* */
@@ -53,11 +54,16 @@ int main(int argc, char *const *argv)
/* */
#if (WIN32)
- ngx_init_sockets(&ngx_log);
+
+ if (ngx_init_sockets(&ngx_log) == NGX_ERROR) {
+ exit(1);
+ }
+
#else
+
ngx_set_signals(&ngx_log);
-#endif
+#endif
ngx_init_array(ngx_listening_sockets, ngx_pool, 10, sizeof(ngx_listen_t),
1);
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index 8497e2d02..1d78f7275 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -62,7 +62,9 @@ char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename)
/* NGX_OK, NGX_ERROR, NGX_CONF_FILE_DONE, NGX_CONF_BLOCK_DONE */
+#if 0
ngx_log_debug(cf->log, "token %d" _ rc);
+#endif
if (rc == NGX_ERROR) {
return NGX_CONF_ERROR;
@@ -101,7 +103,9 @@ ngx_log_debug(cf->log, "token %d" _ rc);
&& ngx_strcmp(name->data, cmd->name.data) == 0)
{
+#if 0
ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
+#endif
if (!(cmd->type & NGX_CONF_ANY)
&& !(cmd->type & argument_number[cf->args->nelts - 1]))
@@ -126,7 +130,9 @@ ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
rv = cmd->set(cf, cmd, conf);
+#if 0
ngx_log_debug(cf->log, "rv: %d" _ rv);
+#endif
if (rv == NGX_CONF_OK) {
found = 1;
@@ -192,7 +198,9 @@ static int ngx_conf_read_token(ngx_conf_t *cf)
h = cf->conf_file->hunk;
start = h->pos.mem;
+#if 0
ngx_log_debug(cf->log, "TOKEN START");
+#endif
for ( ;; ) {
@@ -360,7 +368,9 @@ ngx_log_debug(cf->log, "%d:%d:%d:%d:%d '%c'" _
*dst = '\0';
word->len = len;
+#if 0
ngx_log_debug(cf->log, "FOUND %d:'%s'" _ word->len _ word->data);
+#endif
if (ch == ';' || ch == '{') {
return NGX_OK;
diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h
index de85a74c8..9573ab9f2 100644
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -83,6 +83,12 @@ struct ngx_conf_s {
}
+#define ngx_conf_size_merge(conf, prev, default) \
+ if (conf == (size_t) NGX_CONF_UNSET) { \
+ conf = (prev == (size_t) NGX_CONF_UNSET) ? default : prev; \
+ }
+
+
char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename);
@@ -95,4 +101,4 @@ char *ngx_conf_set_time_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf);
extern ngx_module_t *ngx_modules[];
-#endif _NGX_HTTP_CONF_FILE_H_INCLUDED_
+#endif /* _NGX_HTTP_CONF_FILE_H_INCLUDED_ */
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index a90a1dc4b..1a97b098b 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -94,22 +94,24 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+
#ifndef HAVE_POLL
#define HAVE_POLL 1
#include <poll.h>
-/*
-#ifndef INFTIM
-#define INFTIM -1
-#endif
-*/
#endif
#if (HAVE_DEVPOLL)
+#include <sys/ioctl.h>
#include <sys/devpoll.h> /* Solaris, HP/UX */
#endif
+#if (HAVE_AIO)
+#include <aio.h>
+#endif
+
+
#define ngx_inline inline
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h
index 93f6cbdc3..640158769 100644
--- a/src/core/ngx_connection.h
+++ b/src/core/ngx_connection.h
@@ -38,6 +38,11 @@ struct ngx_connection_s {
int family;
struct sockaddr *sockaddr;
socklen_t socklen;
+#if (HAVE_IOCP)
+ struct sockaddr *local_sockaddr;
+ socklen_t local_socklen;
+ void *listening;
+#endif
int addr;
int addr_text_max_len;
ngx_str_t addr_text;
diff --git a/src/core/ngx_file.h b/src/core/ngx_file.h
index c1bb3c2f3..d0151ad5a 100644
--- a/src/core/ngx_file.h
+++ b/src/core/ngx_file.h
@@ -21,4 +21,4 @@ struct ngx_file_s {
};
-#endif _NGX_FILE_H_INCLUDED_
+#endif /* _NGX_FILE_H_INCLUDED_ */
diff --git a/src/core/ngx_listen.h b/src/core/ngx_listen.h
index 61f08fdee..ea614ef42 100644
--- a/src/core/ngx_listen.h
+++ b/src/core/ngx_listen.h
@@ -36,6 +36,7 @@ typedef struct {
unsigned bound:1; /* already bound */
unsigned inherited:1; /* inherited from previous process */
+ unsigned nonblocking_accept:1;
unsigned nonblocking:1;
#if 0
unsigned overlapped:1; /* Winsock2 overlapped */
diff --git a/src/core/ngx_sendfile.h b/src/core/ngx_sendfile.h
index a80750bef..3c211f51d 100644
--- a/src/core/ngx_sendfile.h
+++ b/src/core/ngx_sendfile.h
@@ -7,14 +7,17 @@
#include <ngx_files.h>
#include <ngx_socket.h>
#include <ngx_log.h>
+#include <ngx_connection.h>
#include <ngx_sendv.h>
-int ngx_sendfile(ngx_socket_t s,
+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,
- ngx_log_t *log);
+ off_t *sent, u_int flags);
+
+
+extern u_int ngx_sendfile_flags;
#endif /* _NGX_SENDFILE_H_INCLUDED_ */