fixed empty RSS feed and disabling RSS with no indexing also on HEAD
authorJiří Filipovič <fila@ics.muni.cz>
Wed, 25 May 2011 12:46:30 +0000 (12:46 +0000)
committerJiří Filipovič <fila@ics.muni.cz>
Wed, 25 May 2011 12:46:30 +0000 (12:46 +0000)
org.glite.lb.server/src/jobstat.c
org.glite.lb.server/src/lb_proto.c

index 1f01e6a..f8798b3 100644 (file)
@@ -637,6 +637,7 @@ edg_wll_ErrorCode edg_wll_RestoreSubjobState(
 
        /* recreate job status of subjob */
        err = intJobStat_embryonic(ctx, job, (const edg_wll_RegJobEvent *) &(events_p[0]), intstat);
+       //err = intJobStat_embryonic(ctx, job,  &(events_p[0].regJob), intstat);
 
        for (i=0; events_p[i].type != EDG_WLL_EVENT_UNDEF ; i++) 
                edg_wll_FreeEvent(&events_p[i]);
index d76edf4..7c532be 100644 (file)
@@ -381,10 +381,13 @@ static int getJobsRSS(edg_wll_Context ctx, char *feedType, edg_wll_JobStat **sta
         }
        else{
                *statesOut = NULL;
+               free(can_peername);
                return -1;
        }
 
-       edg_wll_QueryJobsServer(ctx, (const edg_wll_QueryRec **)conds, 0, &jobsOut, statesOut);
+       if (edg_wll_QueryJobsServer(ctx, (const edg_wll_QueryRec **)conds, 0, &jobsOut, statesOut)){
+               *statesOut = NULL;
+       }
 
        for (i = 0; conds[i]; i++)
                free(conds[i]);
@@ -805,7 +808,7 @@ edg_wll_ErrorCode edg_wll_Proto(edg_wll_Context ctx,
 
                        // check if owner and lastupdatetime is indexed
                        idx = 0;
-                       for (i = 0; ctx->job_index[i]; i++)
+                       if (ctx->job_index) for (i = 0; ctx->job_index[i]; i++)
                                if (ctx->job_index[i]->attr == EDG_WLL_QUERY_ATTR_OWNER)
                                        idx++;
                                else if (ctx->job_index[i]->attr == EDG_WLL_QUERY_ATTR_LASTUPDATETIME)
@@ -814,7 +817,8 @@ edg_wll_ErrorCode edg_wll_Proto(edg_wll_Context ctx,
                                ret = HTTP_NOTFOUND;
                                edg_wll_SetError(ctx, ENOENT, "current index configuration does not support RSS feeds");
                        }
-                       edg_wll_RSSFeed(ctx, states, requestPTR, &message);
+                       else 
+                               edg_wll_RSSFeed(ctx, states, requestPTR, &message);
        /*GET /?wsdl */
 #define WSDL_LB "LB.wsdl"
 #define WSDL_LBTYPES "LBTypes.wsdl"