store sequential numbers for CREAM
authorJiří Filipovič <fila@ics.muni.cz>
Mon, 30 Apr 2012 23:55:44 +0000 (23:55 +0000)
committerJiří Filipovič <fila@ics.muni.cz>
Mon, 30 Apr 2012 23:55:44 +0000 (23:55 +0000)
org.glite.lb.common/interface/context-int.h
org.glite.lb.common/src/context.c

index caa9602..18a7423 100644 (file)
@@ -61,6 +61,7 @@ typedef struct _edg_wll_SeqCode {
                                /* 40-51 EV.CODE=%03d: */
                                /* 53-56 SRC=%c */
        char            condor[EDG_WLL_SEQ_CONDOR_SIZE];                        
+       char            cream[EDG_WLL_SEQ_SIZE];
 } edg_wll_SeqCode;
 
 /* non-gsi one-element analogy of connPool for L&B Proxy server */
index 97f5e55..16d9893 100644 (file)
@@ -418,7 +418,10 @@ char *edg_wll_GetSequenceCode(const edg_wll_Context ctx)
                        ret = strdup(ctx->p_seqcode.condor);
                        break;
                case EDG_WLL_SEQ_CREAM:
-                       ret = strdup("no_seqcodes_with_CREAM"); /* XXX: not yet */
+                       if (ctx->p_seqcode.cream && ctx->p_seqcode.cream[0])
+                               ret = strdup(ctx->p_seqcode.cream); 
+                       else
+                               ret = strdup("no_seqcodes_with_CREAM"); 
                        break;
                default:
                        edg_wll_SetError(ctx,EINVAL,"edg_wll_GetSequenceCode(): unknown sequence code type");
@@ -492,6 +495,10 @@ int edg_wll_SetSequenceCode(edg_wll_Context ctx,
                                strncpy(ctx->p_seqcode.condor, seqcode_str, sizeof(ctx->p_seqcode.condor));
                        break;
                case EDG_WLL_SEQ_CREAM:
+                       if (!seqcode_str)
+                                memset(&ctx->p_seqcode.cream, 0, sizeof ctx->p_seqcode.cream);
+                        else
+                                strncpy(ctx->p_seqcode.cream, seqcode_str, sizeof(ctx->p_seqcode.cream));
                        break; /* XXX: not yet */
                default:
                        return edg_wll_SetError(ctx, EINVAL,