nginx-0.0.1-2003-02-06-20:21:13 import
diff --git a/src/event/ngx_event_accept.c b/src/event/ngx_event_accept.c
index 14422af..2d64c0d 100644
--- a/src/event/ngx_event_accept.c
+++ b/src/event/ngx_event_accept.c
@@ -31,7 +31,9 @@
ev->ready = 0;
+#if 0
/* DEBUG */ ev->available++;
+#endif
do {
ngx_test_null(pool, ngx_create_pool(ls->pool_size, ev->log), NGX_OK);
@@ -55,13 +57,40 @@
return NGX_OK;
}
-#if !(HAVE_INHERITED_NONBLOCK)
+
+#if (HAVE_INHERITED_NONBLOCK)
+
+#if (HAVE_AIO_EVENT)
+ if ((ngx_event_flags & NGX_HAVE_AIO_EVENT)) {
+ if (ngx_blocking(s) == -1) {
+ ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
+ ngx_blocking_n " %s failed", ls->addr_text.data);
+ return NGX_OK;
+ }
+ }
+#endif
+
+#else /* !HAVE_INHERITED_NONBLOCK */
+
+#if (HAVE_AIO_EVENT)
+ if (!(ngx_event_flags & NGX_HAVE_AIO_EVENT)) {
+ if (ngx_nonblocking(s) == -1) {
+ ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
+ ngx_nonblocking_n " %s failed", ls->addr_text.data);
+ return NGX_OK;
+ }
+ }
+#else
if (ngx_nonblocking(s) == -1) {
ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
ngx_nonblocking_n " %s failed", ls->addr_text.data);
+ return NGX_OK;
}
#endif
+#endif /* HAVE_INHERITED_NONBLOCK */
+
+
rev = &ngx_read_events[s];
wev = &ngx_write_events[s];
c = &ngx_connections[s];
@@ -88,9 +117,15 @@
c->fd = s;
c->unexpected_eof = 1;
wev->write = 1;
- wev->ready = 1;
- wev->timer = rev->timer = 10000;
+#if (HAVE_AIO_EVENT)
+ if (!(ngx_event_flags & NGX_HAVE_AIO_EVENT)) {
+ wev->ready = 1;
+ }
+#endif
+
+ /* STUB ? */ wev->timer = rev->timer = 10000;
+
wev->timer_handler = rev->timer_handler = ngx_event_close_connection;
wev->close_handler = rev->close_handler = ngx_event_close_connection;