From: Zdeněk Salvet Date: Wed, 15 Nov 2006 14:03:07 +0000 (+0000) Subject: Do not wait for a long time if server breaks the connection due to X-Git-Tag: glite-lb-logger_R_1_3_4~1 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=ea80ef4f2866053a3cac8c12d1e80203a772f1e0;p=jra1mw.git Do not wait for a long time if server breaks the connection due to overload (previous fix was incomplete). --- diff --git a/org.glite.lb.logger/src/send_event.c b/org.glite.lb.logger/src/send_event.c index 24e9e22..6a98039 100644 --- a/org.glite.lb.logger/src/send_event.c +++ b/org.glite.lb.logger/src/send_event.c @@ -231,6 +231,7 @@ event_queue_close(struct event_queue *eq) int event_queue_send(struct event_queue *eq) { + int events_sent = 0; assert(eq != NULL); #ifdef LB_PERF @@ -250,7 +251,6 @@ event_queue_send(struct event_queue *eq) size_t bytes_sent; struct timeval tv; edg_wll_GssStatus gss_stat; - int events_sent = 0; clear_error(); @@ -280,7 +280,10 @@ event_queue_send(struct event_queue *eq) if((code = get_reply(eq, &rep, &code_min)) < 0) { /* could not get the reply properly, so try again later */ il_log(LOG_ERR, " error reading server %s reply:\n %s\n", eq->dest_name, error_get_msg()); - eq->timeout = TIMEOUT; + if (events_sent>0) + eq->timeout = 1; + else + eq->timeout = TIMEOUT; return(0); } #ifdef LB_PERF