From: Zdeněk Šustr Date: Thu, 27 Jan 2011 10:00:35 +0000 (+0000) Subject: Do not expect answers from sources that have already answered. Fix to bug #77366. X-Git-Tag: glite-lb-client-java_R_1_0_5_6~31 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=f3197a1f0f8d509d0afd7b432423e476d167746c;p=jra1mw.git Do not expect answers from sources that have already answered. Fix to bug #77366. --- diff --git a/org.glite.lb.client/src/producer.c b/org.glite.lb.client/src/producer.c index 47d2d04..9f31eb8 100644 --- a/org.glite.lb.client/src/producer.c +++ b/org.glite.lb.client/src/producer.c @@ -17,7 +17,7 @@ limitations under the License. */ -#include +#include #include #include #include @@ -154,15 +154,13 @@ int edg_wll_DoLogEventServer( edg_wll_PlainConnection con_lbproxy; edg_wll_GssConnection con_bkserver; fd_set fdset; - int count,fd,fd_n; + int count,fd,fd_n,proxy_answer=0,direct_answer=0; int answer = EAGAIN, ret = 0; edg_wll_ResetError(ctx); memset(&con_lbproxy, 0, sizeof(con_lbproxy)); memset(&con_bkserver, 0, sizeof(con_bkserver)); - FD_ZERO(&fdset); - /* CONNECT */ count=0; if (flags & EDG_WLL_LOGFLAG_PROXY) { @@ -202,12 +200,15 @@ int edg_wll_DoLogEventServer( /* READ ANSWER */ while (count > 0) { + + FD_ZERO(&fdset); + fd_n=0; - if (flags & EDG_WLL_LOGFLAG_DIRECT) { + if ((flags & EDG_WLL_LOGFLAG_DIRECT)&&(!direct_answer)) { FD_SET(con_bkserver.sock,&fdset); if (con_bkserver.sock > fd_n) fd_n = con_bkserver.sock; } - if (flags & EDG_WLL_LOGFLAG_PROXY) { + if ((flags & EDG_WLL_LOGFLAG_PROXY)&&(!proxy_answer)) { FD_SET(con_lbproxy.sock,&fdset); if (con_lbproxy.sock > fd_n) fd_n = con_lbproxy.sock; } @@ -245,6 +246,7 @@ int edg_wll_DoLogEventServer( goto edg_wll_DoLogEventServer_end; } count -= 1; + proxy_answer = 1; } if (FD_ISSET(con_bkserver.sock,&fdset)) { /* read answer from bkserver */ @@ -253,6 +255,7 @@ int edg_wll_DoLogEventServer( goto edg_wll_DoLogEventServer_end; } count -= 1; + direct_answer = 1; } }