From: Zdeněk Šustr Date: Fri, 10 Aug 2012 13:20:09 +0000 (+0000) Subject: With filtered output, avoid listing subjobs under foreign parents X-Git-Tag: glite-lbjp-common-gss_R_3_2_4_1~11 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=9cdc7738f146baf3c05138cff3129a8890e6ff7d;p=jra1mw.git With filtered output, avoid listing subjobs under foreign parents --- diff --git a/org.glite.lb.server/src/bkserverd.c b/org.glite.lb.server/src/bkserverd.c index 28b0690..77beb69 100644 --- a/org.glite.lb.server/src/bkserverd.c +++ b/org.glite.lb.server/src/bkserverd.c @@ -591,7 +591,6 @@ int main(int argc, char *argv[]) asprintf(&html_header, "%s/html_header.html", html_header_prefix); } if (html_header) { - char *et, *ed; FILE *fp = fopen(html_header, "r"); if( fp ) { fclose(fp); diff --git a/org.glite.lb.server/src/lb_html.c b/org.glite.lb.server/src/lb_html.c index a025696..cb0af11 100644 --- a/org.glite.lb.server/src/lb_html.c +++ b/org.glite.lb.server/src/lb_html.c @@ -77,8 +77,8 @@ int jobstat_cmp (const void *a, const void *b) { /* construct Message-Body of Response-Line for edg_wll_UserJobs */ int edg_wll_UserInfoToHTML(edg_wll_Context ctx UNUSED_VAR, edg_wlc_JobId *jobsOut, edg_wll_JobStat *statsOut, char **message, int text) { - char *pomA = NULL, *pomB, *pomC, *header = NULL; - int i, total = 0, bufsize, written = 0, linlen, wassub = 0, lineoverhead; + char *pomA = NULL, *pomB, *pomC, *header = NULL, *recent_parent = NULL; + int i, total = 0, bufsize, written = 0, linlen, wassub = 0, issub = 0, lineoverhead; JobIdSorter *order; while (jobsOut && jobsOut[total]) total++; @@ -125,11 +125,12 @@ int edg_wll_UserInfoToHTML(edg_wll_Context ctx UNUSED_VAR, edg_wlc_JobId *jobsOu for (i = 0; i < total; i++) { if (text) linlen = asprintf(&pomA,"%s%s", order[i].id_unparsed, i + 1 == total ? "\n" : ","); else { + issub = order[i].parent_unparsed && recent_parent && !strcmp(recent_parent, order[i].parent_unparsed) ? 1 : 0; linlen = asprintf(&pomA, "%s
  • %s
  • \n", - order[i].parent_unparsed ? (wassub++ ? "" : "" : ""), + issub ? (wassub++ ? "" : "" : ""), order[i].id_unparsed, order[i].id_unparsed ); - if (!order[i].parent_unparsed) wassub = 0; + if (!issub || !order[i].parent_unparsed) { wassub = 0; recent_parent = order[i].id_unparsed; } } while (written+linlen >= bufsize) {