Use passed timeout instead of starting arbitrary new one.
authorZdeněk Salvet <salvet@ics.muni.cz>
Fri, 17 Feb 2006 10:35:44 +0000 (10:35 +0000)
committerZdeněk Salvet <salvet@ics.muni.cz>
Fri, 17 Feb 2006 10:35:44 +0000 (10:35 +0000)
org.glite.lb.server/src/il_lbproxy.c

index 4b682e7..487c847 100644 (file)
@@ -18,7 +18,6 @@ edg_wll_EventSendProxy(
        const edg_wlc_JobId             jobid,
        const char                         *event)
 {
-       struct timeval  timeout;
        long                    filepos;
        char               *jobid_s,
                                   *event_file = NULL;
@@ -28,9 +27,6 @@ edg_wll_EventSendProxy(
 
        edg_wll_ResetError(ctx);
 
-       timeout.tv_sec = EDG_WLL_LOG_TIMEOUT_MAX;
-       timeout.tv_usec = 0;    
-
        jobid_s = edg_wlc_JobIdGetUnique(jobid);
        if ( !jobid_s ) {
                edg_wll_SetError(ctx, ENOMEM, "edg_wlc_JobIdGetUnique()");
@@ -44,13 +40,16 @@ edg_wll_EventSendProxy(
        }
 
        if ( edg_wll_log_event_write(ctx, event_file, event,
-                                               FCNTL_ATTEMPTS, FCNTL_TIMEOUT, &filepos) ) {
+                                       (ctx->p_tmp_timeout.tv_sec > FCNTL_ATTEMPTS ?
+                                               ctx->p_tmp_timeout.tv_sec : FCNTL_ATTEMPTS),
+                                       FCNTL_TIMEOUT, &filepos) ) {
+
                edg_wll_UpdateError(ctx, 0, "edg_wll_log_event_write()");
                _err(1);
        }
 
        if ( edg_wll_log_event_send(ctx, lbproxy_ilog_socket_path, filepos,
-                                               event, strlen(event), 1, &timeout) ) {
+                                               event, strlen(event), 1, &ctx->p_tmp_timeout) ) {
                edg_wll_UpdateError(ctx, 0, "edg_wll_log_event_send()");
                _err(-1);
        }