Klaus Demo nginx / 056e88e
Core: output client port number when logging accept event. Ruslan Ermilov 6 years ago
1 changed file(s) with 13 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
287287 #if (NGX_DEBUG)
288288 {
289289
290 ngx_str_t addr;
290291 struct sockaddr_in *sin;
291292 ngx_cidr_t *cidr;
292293 ngx_uint_t i;
294 u_char text[NGX_SOCKADDR_STRLEN];
293295 #if (NGX_HAVE_INET6)
294296 struct sockaddr_in6 *sin6;
295297 ngx_uint_t n;
339341 continue;
340342 }
341343
342 }
343 #endif
344
345 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0,
346 "*%uA accept: %V fd:%d", c->number, &c->addr_text, s);
344 if (log->log_level & NGX_LOG_DEBUG_EVENT) {
345 addr.data = text;
346 addr.len = ngx_sock_ntop(c->sockaddr, c->socklen, text,
347 NGX_SOCKADDR_STRLEN, 1);
348
349 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0,
350 "*%uA accept: %V fd:%d", c->number, &addr, s);
351 }
352
353 }
354 #endif
347355
348356 if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) {
349357 if (ngx_add_conn(c) == NGX_ERROR) {