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/event
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-02-09 17:31:07 +0300
committerIgor Sysoev <igor@sysoev.ru>2005-02-09 17:31:07 +0300
commitaa8286101a57f11f2c1f9b5bf2d7ec121e74beea (patch)
treed87e4d87bf388c7a3c630170d9ba43a8591007ed /src/event
parent9ef28fa32a4713d365aa8d4cfc1f8732d6de47f6 (diff)
nginx-0.1.18-RELEASE importrelease-0.1.18
*) Workaround: the default values of the devpoll_events and the devpoll_changes directives changed from 512 to 32 to be compatible with Solaris 10. *) Bugfix: the proxy_set_x_var and fastcgi_set_var directives were not inherited. *) Bugfix: in the redirect rewrite directive the arguments were concatenated with URI by the "&" rather than the "?". *) Bugfix: the lines without trailing ";" in the file being included by the ngx_http_geo_module were silently ignored. *) Feature: the ngx_http_stub_status_module. *) Bugfix: the unknown log format in the access_log directive caused the segmentation fault. *) Feature: the new "document_root" parameter of the fastcgi_params directive. *) Feature: the fastcgi_redirect_errors directive. *) Feature: the new "break" modifier of the "rewrite" directive allows to stop the rewrite/location cycle and sets the current configuration to the request.
Diffstat (limited to 'src/event')
-rw-r--r--src/event/modules/ngx_devpoll_module.c4
-rw-r--r--src/event/modules/ngx_select_module.c9
-rw-r--r--src/event/ngx_event_accept.c2
-rw-r--r--src/event/ngx_event_connect.c47
-rw-r--r--src/event/ngx_event_connect.h18
5 files changed, 49 insertions, 31 deletions
diff --git a/src/event/modules/ngx_devpoll_module.c b/src/event/modules/ngx_devpoll_module.c
index aa61df7de..a9c60c46e 100644
--- a/src/event/modules/ngx_devpoll_module.c
+++ b/src/event/modules/ngx_devpoll_module.c
@@ -587,8 +587,8 @@ static char *ngx_devpoll_init_conf(ngx_cycle_t *cycle, void *conf)
{
ngx_devpoll_conf_t *dpcf = conf;
- ngx_conf_init_unsigned_value(dpcf->changes, 512);
- ngx_conf_init_unsigned_value(dpcf->events, 512);
+ ngx_conf_init_unsigned_value(dpcf->changes, 32);
+ ngx_conf_init_unsigned_value(dpcf->events, 32);
return NGX_CONF_OK;
}
diff --git a/src/event/modules/ngx_select_module.c b/src/event/modules/ngx_select_module.c
index 0554ee95f..623e13c16 100644
--- a/src/event/modules/ngx_select_module.c
+++ b/src/event/modules/ngx_select_module.c
@@ -347,8 +347,15 @@ static ngx_int_t ngx_select_process_events(ngx_cycle_t *cycle)
work_read_fd_set = master_read_fd_set;
work_write_fd_set = master_write_fd_set;
+#if 1
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select read fd_set: %08Xd", *(int *) &work_read_fd_set);
+ /*
+ * (void *) disables "dereferencing type-punned
+ * pointer will break strict-aliasing rules
+ */
+ "select read fd_set: %08Xd",
+ *(int *) (void *) &work_read_fd_set);
+#endif
#if (NGX_WIN32)
ready = select(0, &work_read_fd_set, &work_write_fd_set, NULL, tp);
diff --git a/src/event/ngx_event_accept.c b/src/event/ngx_event_accept.c
index d809a77aa..c7f759553 100644
--- a/src/event/ngx_event_accept.c
+++ b/src/event/ngx_event_accept.c
@@ -142,7 +142,7 @@ void ngx_event_accept(ngx_event_t *ev)
(*ngx_stat_active)++;
#endif
- /* set a blocking mode for aio and non-blocking mode for the others */
+ /* set a blocking mode for aio and non-blocking mode for others */
if (ngx_inherited_nonblocking) {
if ((ngx_event_flags & NGX_USE_AIO_EVENT)) {
diff --git a/src/event/ngx_event_connect.c b/src/event/ngx_event_connect.c
index 1a3e8f806..81798d315 100644
--- a/src/event/ngx_event_connect.c
+++ b/src/event/ngx_event_connect.c
@@ -10,7 +10,11 @@
#include <ngx_event_connect.h>
-ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc)
+#define NGX_RESOLVER_BUFSIZE 8192
+
+
+ngx_int_t
+ngx_event_connect_peer(ngx_peer_connection_t *pc)
{
int rc;
ngx_uint_t instance;
@@ -274,12 +278,18 @@ ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc)
if (err != NGX_EINPROGRESS && err != NGX_EAGAIN) {
ngx_connection_error(c, err, "connect() failed");
- if (ngx_close_socket(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
- ngx_close_socket_n " failed");
- }
+#if 0
+#undef sun
+ {
+ struct sockaddr_un *sun;
- c->fd = (ngx_socket_t) -1;
+ sun = (struct sockaddr_un *) peer->sockaddr;
+
+ ngx_log_error(NGX_LOG_ALERT, pc->log, 0,
+ "\"%s\", f:%d, l:%uz",
+ sun->sun_path, sun->sun_family, peer->socklen);
+ }
+#endif
return NGX_CONNECT_ERROR;
}
@@ -287,7 +297,9 @@ ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc)
if (ngx_add_conn) {
if (rc == -1) {
+
/* NGX_EINPROGRESS */
+
return NGX_AGAIN;
}
@@ -308,17 +320,11 @@ ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc)
if (ngx_blocking(s) == -1) {
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
ngx_blocking_n " failed");
-
- if (ngx_close_socket(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
- ngx_close_socket_n " failed");
- }
-
return NGX_ERROR;
}
/*
- * FreeBSD aio allows to post operation on non-connected socket.
+ * FreeBSD's aio allows to post an operation on non-connected socket.
* NT does not support it.
*
* TODO: check in Win32, etc. As workaround we can use NGX_ONESHOT_EVENT
@@ -330,10 +336,16 @@ ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc)
return NGX_OK;
}
- if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { /* kqueue */
+ if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
+
+ /* kqueue */
+
event = NGX_CLEAR_EVENT;
- } else { /* select, poll, /dev/poll */
+ } else {
+
+ /* select, poll, /dev/poll */
+
event = NGX_LEVEL_EVENT;
}
@@ -360,7 +372,8 @@ ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc)
}
-void ngx_event_connect_peer_failed(ngx_peer_connection_t *pc)
+void
+ngx_event_connect_peer_failed(ngx_peer_connection_t *pc)
{
time_t now;
@@ -380,6 +393,4 @@ void ngx_event_connect_peer_failed(ngx_peer_connection_t *pc)
}
pc->tries--;
-
- return;
}
diff --git a/src/event/ngx_event_connect.h b/src/event/ngx_event_connect.h
index 4f3ee2e27..48863abe5 100644
--- a/src/event/ngx_event_connect.h
+++ b/src/event/ngx_event_connect.h
@@ -48,21 +48,21 @@ struct ngx_peers_s {
typedef struct {
- ngx_peers_t *peers;
- ngx_uint_t cur_peer;
- ngx_uint_t tries;
+ ngx_peers_t *peers;
+ ngx_uint_t cur_peer;
+ ngx_uint_t tries;
- ngx_connection_t *connection;
+ ngx_connection_t *connection;
#if (NGX_THREADS)
- ngx_atomic_t *lock;
+ ngx_atomic_t *lock;
#endif
- int rcvbuf;
+ int rcvbuf;
- ngx_log_t *log;
+ ngx_log_t *log;
- unsigned cached:1;
- unsigned log_error:2; /* ngx_connection_log_error_e */
+ unsigned cached:1;
+ unsigned log_error:2; /* ngx_connection_log_error_e */
} ngx_peer_connection_t;