src/dumpstats.c
static int stats_accept(struct session *s)
{
	/* we have a dedicated I/O handler for the stats */
	stream_int_register_handler(&s->si[1], &cli_applet);
	s->target = s->si[1].conn->target; // for logging only
	s->si[1].conn->xprt_ctx = s;
	s->si[1].applet.st1 = 0;
	s->si[1].applet.st0 = STAT_CLI_INIT;

	tv_zero(&s->logs.tv_request);
	s->logs.t_queue = 0;
	s->logs.t_connect = 0;
	s->logs.t_data = 0;
	s->logs.t_close = 0;
	s->logs.bytes_in = s->logs.bytes_out = 0;
	s->logs.prx_queue_size = 0;  /* we get the number of pending conns before us */
	s->logs.srv_queue_size = 0; /* we will get this number soon */

	s->req->flags |= CF_READ_DONTWAIT; /* we plan to read small requests */

	if (s->listener->timeout) {
		s->req->rto = *s->listener->timeout;
		s->rep->wto = *s->listener->timeout;
	}
	return 1;
}
/* This function is called from the session-level accept() in order to instanciate
 * a new stats socket. It returns a positive value upon success, 0 if the connection
 * needs to be closed and ignored, or a negative value upon critical failure.
 */
This function is called from the session-level accept() in order to instanciate
a new stats socket. It returns a positive value upon success, 0 if the connection
needs to be closed and ignored, or a negative value upon critical failure.
This function is called from the session - level accept () in order to instanciate a new stats socket . It returns a positive value upon success 0 if the connection needs to be closed and ignored or a negative value upon critical failure .
static int stats_accept(struct session *s)
{
	stream_int_register_handler(&s->si[1], &cli_applet);
	s->target = s->si[1].conn->target; 
	s->si[1].conn->xprt_ctx = s;
	s->si[1].applet.st1 = 0;
	s->si[1].applet.st0 = STAT_CLI_INIT;
	tv_zero(&s->logs.tv_request);
	s->logs.t_queue = 0;
	s->logs.t_connect = 0;
	s->logs.t_data = 0;
	s->logs.t_close = 0;
	s->logs.bytes_in = s->logs.bytes_out = 0;
	s->logs.prx_queue_size = 0;  
	s->logs.srv_queue_size = 0; 
	s->req->flags |= CF_READ_DONTWAIT; 
	if (s->listener->timeout) {
		s->req->rto = *s->listener->timeout;
		s->rep->wto = *s->listener->timeout;
	}
	return 1;
}
static int stats_accept ( struct session * s ) { stream_int_register_handler ( & s -> si [ 1 ] , & cli_applet ) ; s -> target = s -> si [ 1 ] . conn -> target ; s -> si [ 1 ] . conn -> xprt_ctx = s ; s -> si [ 1 ] . applet . st1 = 0 ; s -> si [ 1 ] . applet . st0 = STAT_CLI_INIT ; tv_zero ( & s -> logs . tv_request ) ; s -> logs . t_queue = 0 ; s -> logs . t_connect = 0 ; s -> logs . t_data = 0 ; s -> logs . t_close = 0 ; s -> logs . bytes_in = s -> logs . bytes_out = 0 ; s -> logs . prx_queue_size = 0 ; s -> logs . srv_queue_size = 0 ; s -> req -> flags |= CF_READ_DONTWAIT ; if ( s -> listener -> timeout ) { s -> req -> rto = * s -> listener -> timeout ; s -> rep -> wto = * s -> listener -> timeout ; } return 1 ; }
This function is called from the session-level accept() in order to instanciate
 a new stats socket.
This function is called from the session - level accept () in order to instanciate a new stats socket .
/* we have a dedicated I/O handler for the stats */ // for logging only /* we get the number of pending conns before us */ /* we will get this number soon */ /* we plan to read small requests */