From 6042de8be9314545108be84888360db5bc4611ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20Salvet?= Date: Tue, 9 May 2006 06:53:17 +0000 Subject: [PATCH] Bug #15450 fixes: - properly account connection setup time (newly established connection could be handled as idle before) - don't close newly established connection on regular slave recycle --- org.glite.lb.server-bones/src/srvbones.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/org.glite.lb.server-bones/src/srvbones.c b/org.glite.lb.server-bones/src/srvbones.c index b4b8b3f..7412e56 100644 --- a/org.glite.lb.server-bones/src/srvbones.c +++ b/org.glite.lb.server-bones/src/srvbones.c @@ -326,7 +326,7 @@ static int slave(slave_data_init_hnd data_init_hnd, int sock) */ exit(1); - while ( !die && req_cnt < set_slave_reqs_max) + while ( !die && (req_cnt < set_slave_reqs_max || (conn >= 0 && first_request))) { fd_set fds; int max = sock, @@ -451,7 +451,7 @@ static int slave(slave_data_init_hnd data_init_hnd, int sock) kick_client = KICK_LOAD; } - if (req_cnt >= set_slave_reqs_max) kick_client = KICK_COUNT; + if (req_cnt >= set_slave_reqs_max && !first_request) kick_client = KICK_COUNT; if ( kick_client && conn >= 0 ) { @@ -468,8 +468,6 @@ static int slave(slave_data_init_hnd data_init_hnd, int sock) conn = newconn; srv = newsrv; gettimeofday(&client_start, NULL); - client_done.tv_sec = client_start.tv_sec; - client_done.tv_usec = client_start.tv_usec; switch ( send(sock, &seq, sizeof(seq), 0) ) { @@ -509,6 +507,7 @@ static int slave(slave_data_init_hnd data_init_hnd, int sock) conn = srv = -1; continue; } + gettimeofday(&client_done, NULL); first_request = 1; } } -- 1.8.2.3