Mercurial > hg > nginx
diff src/core/ngx_connection.c @ 561:e48ebafc6939 release-0.3.2
nginx-0.3.2-RELEASE import
*) Feature: the Sun Studio 10 C compiler support.
*) Feature: the "proxy_upstream_max_fails",
"proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails", and
"fastcgi_upstream_fail_timeout" directives.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 12 Oct 2005 13:50:36 +0000 |
parents | 511a89da35ad |
children | 9c2f3ed7a247 |
line wrap: on
line diff
--- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -372,7 +372,9 @@ ngx_close_listening_sockets(ngx_cycle_t ngx_connection_t * ngx_get_connection(ngx_socket_t s, ngx_log_t *log) { - ngx_connection_t *c; + ngx_uint_t instance; + ngx_event_t *rev, *wev; + ngx_connection_t *c; /* disable warning: Win32 SOCKET is u_int while UNIX socket is int */ @@ -407,6 +409,32 @@ ngx_get_connection(ngx_socket_t s, ngx_l ngx_cycle->files[s] = c; } + rev = c->read; + wev = c->write; + + ngx_memzero(c, sizeof(ngx_connection_t)); + + c->read = rev; + c->write = wev; + c->fd = s; + c->log = log; + + instance = rev->instance; + + ngx_memzero(rev, sizeof(ngx_event_t)); + ngx_memzero(wev, sizeof(ngx_event_t)); + + rev->instance = !instance; + wev->instance = !instance; + + rev->index = NGX_INVALID_INDEX; + wev->index = NGX_INVALID_INDEX; + + rev->data = c; + wev->data = c; + + wev->write = 1; + return c; }