comparison src/event/ngx_event_accept.c @ 5704:524741fd50ed

Core: output client port number when logging accept event.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 22 May 2014 00:16:09 +0400
parents 957d734362ed
children 3377f9459e99
comparison
equal deleted inserted replaced
5703:7deb01451486 5704:524741fd50ed
286 } 286 }
287 287
288 #if (NGX_DEBUG) 288 #if (NGX_DEBUG)
289 { 289 {
290 290
291 ngx_str_t addr;
291 struct sockaddr_in *sin; 292 struct sockaddr_in *sin;
292 ngx_cidr_t *cidr; 293 ngx_cidr_t *cidr;
293 ngx_uint_t i; 294 ngx_uint_t i;
295 u_char text[NGX_SOCKADDR_STRLEN];
294 #if (NGX_HAVE_INET6) 296 #if (NGX_HAVE_INET6)
295 struct sockaddr_in6 *sin6; 297 struct sockaddr_in6 *sin6;
296 ngx_uint_t n; 298 ngx_uint_t n;
297 #endif 299 #endif
298 300
338 340
339 next: 341 next:
340 continue; 342 continue;
341 } 343 }
342 344
343 } 345 if (log->log_level & NGX_LOG_DEBUG_EVENT) {
344 #endif 346 addr.data = text;
345 347 addr.len = ngx_sock_ntop(c->sockaddr, c->socklen, text,
346 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0, 348 NGX_SOCKADDR_STRLEN, 1);
347 "*%uA accept: %V fd:%d", c->number, &c->addr_text, s); 349
350 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0,
351 "*%uA accept: %V fd:%d", c->number, &addr, s);
352 }
353
354 }
355 #endif
348 356
349 if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) { 357 if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) {
350 if (ngx_add_conn(c) == NGX_ERROR) { 358 if (ngx_add_conn(c) == NGX_ERROR) {
351 ngx_close_accepted_connection(c); 359 ngx_close_accepted_connection(c);
352 return; 360 return;