From 1baf475f568f53f500069600b2be2bc5da1cf892 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Fri, 8 Dec 2006 12:24:37 +0000 Subject: [PATCH] terminate slave also when new connection handler returns <0 --- org.glite.lb.server-bones/src/srvbones.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/org.glite.lb.server-bones/src/srvbones.c b/org.glite.lb.server-bones/src/srvbones.c index 7412e56..50d450f 100644 --- a/org.glite.lb.server-bones/src/srvbones.c +++ b/org.glite.lb.server-bones/src/srvbones.c @@ -465,6 +465,8 @@ static int slave(slave_data_init_hnd data_init_hnd, int sock) if ( newconn >= 0 ) { + int ret; + conn = newconn; srv = newsrv; gettimeofday(&client_start, NULL); @@ -499,12 +501,13 @@ static int slave(slave_data_init_hnd data_init_hnd, int sock) to = set_connect_to; if ( services[srv].on_new_conn_hnd - && services[srv].on_new_conn_hnd(conn, to.tv_sec >= 0 ? &to : NULL, clnt_data) ) + && (ret = services[srv].on_new_conn_hnd(conn, to.tv_sec >= 0 ? &to : NULL, clnt_data)) ) { - dprintf(("[%d] Connection not estabilished.\n", getpid())); - if ( !debug ) syslog(LOG_ERR, "Connection not estabilished.\n"); + dprintf(("[%d] Connection not estabilished, err = %d.\n", getpid(),ret)); + if ( !debug ) syslog(LOG_ERR, "Connection not estabilished, err = %d.\n",ret); close(conn); conn = srv = -1; + if (ret < 0) exit(1); continue; } gettimeofday(&client_done, NULL); -- 1.8.2.3