handle the seq.code type properly
authorMiloš Mulač <mulac@civ.zcu.cz>
Tue, 27 Feb 2007 12:46:26 +0000 (12:46 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Tue, 27 Feb 2007 12:46:26 +0000 (12:46 +0000)
org.glite.lb.client/src/producer.c
org.glite.lb.common/src/context.c

index 15493b2..f17d1de 100644 (file)
@@ -760,9 +760,6 @@ static int edg_wll_RegisterJobMaster(
        edg_wll_ResetError(ctx);
        memcpy(&sync_to, &ctx->p_sync_timeout, sizeof sync_to);
 
-       intseed = seed ? strdup(seed) : 
-               str2md5base64(seq = edg_wll_GetSequenceCode(ctx));
-
        type_s = edg_wll_RegJobJobtypeToString(type);
        if (!type_s) {
                edg_wll_SetError(ctx,EINVAL,"edg_wll_RegisterJobMaster(): no jobtype specified");
@@ -786,6 +783,8 @@ static int edg_wll_RegisterJobMaster(
        if (flags & LOGFLAG_DIRECT) {
                /* SetLoggingJob and log directly the message */
                if (edg_wll_SetLoggingJob(ctx,job,NULL,EDG_WLL_SEQ_NORMAL) == 0) {
+                       intseed = seed ? strdup(seed) : 
+                               str2md5base64(seq = edg_wll_GetSequenceCode(ctx));
                        edg_wll_LogEventMaster(ctx,LOGFLAG_DIRECT | LOGFLAG_SYNC,
                                EDG_WLL_EVENT_REGJOB,EDG_WLL_FORMAT_REGJOB,
                                (char *)jdl,ns,parent_s,type_s,num_subjobs,intseed);
@@ -796,6 +795,8 @@ static int edg_wll_RegisterJobMaster(
                if (seq) free(seq);
                seq = edg_wll_GetSequenceCode(ctx);
                if (edg_wll_SetLoggingJobProxy(ctx,job,seq,NULL,EDG_WLL_SEQ_NORMAL) == 0) {
+                       intseed = seed ? strdup(seed) : 
+                               str2md5base64(seq = edg_wll_GetSequenceCode(ctx));
                        edg_wll_LogEventMaster(ctx,LOGFLAG_PROXY | LOGFLAG_SYNC,
                                EDG_WLL_EVENT_REGJOB,EDG_WLL_FORMAT_REGJOB,
                                (char *)jdl,ns,parent_s,type_s,num_subjobs,intseed);
@@ -803,6 +804,8 @@ static int edg_wll_RegisterJobMaster(
        } else if (flags & LOGFLAG_NORMAL) {
                /* SetLoggingJob and log normally the message through the local-logger */
                if (edg_wll_SetLoggingJob(ctx,job,NULL,EDG_WLL_SEQ_NORMAL) == 0) {
+                       intseed = seed ? strdup(seed) : 
+                               str2md5base64(seq = edg_wll_GetSequenceCode(ctx));
                        edg_wll_LogEventMaster(ctx, LOGFLAG_NORMAL,
                                EDG_WLL_EVENT_REGJOB,EDG_WLL_FORMAT_REGJOB,
                                (char *)jdl,ns,parent_s,type_s,num_subjobs,intseed);
index 6012e5d..21ba713 100644 (file)
@@ -356,6 +356,7 @@ int edg_wll_SetSequenceCode(edg_wll_Context ctx,
                case EDG_WLL_SEQ_NORMAL:
                        if (!seqcode_str) {
                                memset(&ctx->p_seqcode,0,sizeof ctx->p_seqcode);
+                               ctx->p_seqcode.type = seq_type;
                                return 0;
                        }