diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2004-11-11 14:07:14 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2004-11-11 14:07:14 +0000 |
| commit | 1b73583ba2c0e4b72d951218827e0c621427d389 (patch) | |
| tree | 9e4d204e2cce91560d5cb8908b8a1a9f2c1d92ee /src/event/ngx_event_accept.c | |
| parent | d6f24959428caed68a509a19ca4fd866d978a69c (diff) | |
| download | nginx-release-0.1.5.tar.gz nginx-release-0.1.5.tar.bz2 | |
nginx-0.1.5-RELEASE importrelease-0.1.5
*) Bugfix: on Solaris and Linux there may be too many "recvmsg()
returned not enough data" alerts.
*) Bugfix: there were the "writev() failed (22: Invalid argument)"
errors on Solaris in proxy mode without sendfile. On other platforms
that do not support sendfile at all the process got caught in an
endless loop.
*) Bugfix: segmentation fault on Solaris in proxy mode and using
sendfile.
*) Bugfix: segmentation fault on Solaris.
*) Bugfix: on-line upgrade did not work on Linux.
*) Bugfix: the ngx_http_autoindex_module module did not escape the
spaces, the quotes, and the percent signs in the directory listing.
*) Change: the decrease of the copy operations.
*) Feature: the userid_p3p directive.
Diffstat (limited to '')
| -rw-r--r-- | src/event/ngx_event_accept.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/event/ngx_event_accept.c b/src/event/ngx_event_accept.c index 9ae5ccd11..085a65eb4 100644 --- a/src/event/ngx_event_accept.c +++ b/src/event/ngx_event_accept.c @@ -11,13 +11,13 @@ typedef struct { - int flag; - u_char *name; + int flag; + ngx_str_t *name; } ngx_accept_log_ctx_t; static void ngx_close_accepted_socket(ngx_socket_t s, ngx_log_t *log); -static size_t ngx_accept_log_error(void *data, char *buf, size_t len); +static u_char *ngx_accept_log_error(void *data, u_char *buf, size_t len); void ngx_event_accept(ngx_event_t *ev) @@ -46,8 +46,8 @@ void ngx_event_accept(ngx_event_t *ev) ls = ev->data; ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, - "accept on %s, ready: %d", - ls->listening->addr_text.data, ev->available); + "accept on %V, ready: %d", + &ls->listening->addr_text, ev->available); ev->ready = 0; accepted = 0; @@ -88,7 +88,7 @@ void ngx_event_accept(ngx_event_t *ev) /* -1 disables the connection number logging */ ctx->flag = -1; - ctx->name = ls->listening->addr_text.data; + ctx->name = &ls->listening->addr_text; log->data = ctx; log->handler = ngx_accept_log_error; @@ -114,8 +114,7 @@ void ngx_event_accept(ngx_event_t *ev) } ngx_log_error(NGX_LOG_ALERT, ev->log, err, - "accept() on %s failed", - ls->listening->addr_text.data); + "accept() on %V failed", &ls->listening->addr_text); if (err == NGX_ECONNABORTED) { if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { @@ -144,10 +143,10 @@ void ngx_event_accept(ngx_event_t *ev) if ((ngx_uint_t) s >= ecf->connections) { ngx_log_error(NGX_LOG_ALERT, ev->log, 0, - "accept() on %s returned socket #%d while " + "accept() on %V returned socket #%d while " "only %d connections was configured, " "closing the connection", - ls->listening->addr_text.data, s, ecf->connections); + &ls->listening->addr_text, s, ecf->connections); ngx_close_accepted_socket(s, log); ngx_destroy_pool(pool); @@ -185,7 +184,7 @@ void ngx_event_accept(ngx_event_t *ev) } } -#if (WIN32) +#if (NGX_WIN32) /* * Winsock assignes a socket number divisible by 4 * so to find a connection we divide a socket number by 4. @@ -193,9 +192,9 @@ void ngx_event_accept(ngx_event_t *ev) if (s % 4) { ngx_log_error(NGX_LOG_EMERG, ev->log, 0, - "accept() on %s returned socket #%d, " + "accept() on %V returned socket #%d, " "not divisible by 4", - ls->listening->addr_text.data, s); + &ls->listening->addr_text, s); exit(1); } @@ -467,9 +466,9 @@ static void ngx_close_accepted_socket(ngx_socket_t s, ngx_log_t *log) } -static size_t ngx_accept_log_error(void *data, char *buf, size_t len) +static u_char *ngx_accept_log_error(void *data, u_char *buf, size_t len) { ngx_accept_log_ctx_t *ctx = data; - return ngx_snprintf(buf, len, " while accept() on %s", ctx->name); + return ngx_snprintf(buf, len, " while accept() on %V", ctx->name); } |
