Fixed bug in QueryEvents operation.
#include "glite/lb/consumer.h"
#include "bk_ws_H.h"
+#include "ws_fault.h"
+
+#include "soap_version.h"
+#if GSOAP_VERSION <= 20602
+#define soap_call___lb__GetVersion soap_call___ns1__GetVersion
+#endif
#include "LoggingAndBookkeeping.nsmap"
while ((opt = getopt_long(argc, argv, "hm:", opts, NULL)) != EOF) switch (opt)
{
case 'h': usage(name); return 0;
- case 'm': server = strdup(optarg); break;
+ case 'm': server = optarg; break;
case '?': usage(name); return 1;
}
return 1;
}
-/* memset(&in, 0, sizeof(in));*/
+ memset(&in, 0, sizeof(in));
memset(&out, 0, sizeof(out));
switch (err = soap_call___lb__GetVersion(&soap, server, "", &in, &out))
{
soap_print_fault(&soap, stderr);
}
+ soap_end(&soap);
soap_done(&soap);
+ glite_gsplugin_free_context(gsplugin_ctx);
+ edg_wll_FreeContext(ctx);
return 0;
}
while ((opt = getopt_long(argc, argv, "hm:j:", opts, NULL)) != EOF) switch (opt)
{
case 'h': usage(name); return 0;
- case 'm': server = strdup(optarg); break;
- case 'j': jobid = strdup(optarg); break;
+ case 'm': server = optarg; break;
+ case 'j': jobid = optarg; break;
case '?': usage(name); return 1;
}
glite_gsplugin_set_udata(mydlo, ctx);
- /* prepare job log quary */
+ /* prepare job log query */
memset(j,0,sizeof j);
memset(e,0,sizeof e);
jconds = (edg_wll_QueryRec **) calloc(2, sizeof(edg_wll_QueryRec *));
- for ( i = 0; i < 2; i++ )
+ for ( i = 0; i < 1; i++ )
{
jconds[i] = (edg_wll_QueryRec *) calloc(2, sizeof(edg_wll_QueryRec));
jconds[i][0] = j[i];
}
- econds = (edg_wll_QueryRec **) calloc(1, sizeof(edg_wll_QueryRec *));
+/* econds = (edg_wll_QueryRec **) calloc(1, sizeof(edg_wll_QueryRec *));
for ( i = 0; i < 1; i++ )
{
econds[i] = (edg_wll_QueryRec *) calloc(1, sizeof(edg_wll_QueryRec));
econds[i][0] = e[i];
- }
+ }*/
+ memset(&in, 0, sizeof in);
+ memset(&out, 0, sizeof out);
if (edg_wll_QueryCondsExtToSoap(mydlo, (const edg_wll_QueryRec **)jconds,
&in.__sizejobConditions, &in.jobConditions) != SOAP_OK) {
return(1);
}
+ for (i = 0; jconds[i]; i++) {
+ if (jconds[i]) edg_wlc_JobIdFree(jconds[i][0].value.j);
+ free(jconds[i]);
+ }
+ free(jconds);
+
//edg_wll_QueryCondsExtToSoap(mydlo, (const edg_wll_QueryRec **)econds,
// &in.__sizeeventConditions, &in.eventConditions);
edg_wll_FaultToErr(mydlo,ctx);
edg_wll_Error(ctx,&et,&ed);
fprintf(stderr,"%s: %s (%s)\n",argv[0],et,ed);
+ soap_done(mydlo);
exit(1);
}
default:
soap_print_fault(mydlo,stderr);
}
- soap_dealloc(mydlo, out.events);
+ soap_end(mydlo/*, out.events*/);
+ soap_done(mydlo);
+ free(mydlo);
+ glite_gsplugin_free_context(gsplugin_ctx);
+ edg_wll_FreeContext(ctx);
return 0;
}
#include "bk_ws_H.h"
#include "ws_typeref.h"
+#include "ws_fault.h"
#include "soap_version.h"
while ((opt = getopt_long(argc, argv, "hm:j:", opts, NULL)) != EOF) switch (opt)
{
case 'h': usage(name); return 0;
- case 'm': server = strdup(optarg); break;
- case 'j': jobid = strdup(optarg); break;
+ case 'm': server = optarg; break;
+ case 'j': jobid = optarg; break;
case '?': usage(name); return 1;
}
edg_wll_SoapToStatus(mydlo,out.stat,&s);
printstat(s, 0);
+ edg_wll_FreeStatus(&s);
}
break;
case SOAP_FAULT:
soap_print_fault(mydlo,stderr);
}
+ soap_end(mydlo);
+ soap_done(mydlo);
+ free(mydlo);
+ glite_gsplugin_free_context(gsplugin_ctx);
+ edg_wll_FreeContext(ctx);
+
return 0;
}
static void printstat(edg_wll_JobStat stat, int level)
{
- char *s, *j, ind[10];
+ char *s, *j1, *j2, ind[10];
int i;
time_t t;
s = edg_wll_StatToString(stat.state);
/* print whole flat structure */
printf("%sstate : %s\n", ind, s);
- printf("%sjobId : %s\n", ind, j = edg_wlc_JobIdUnparse(stat.jobId));
+ printf("%sjobId : %s\n", ind, j1 = edg_wlc_JobIdUnparse(stat.jobId));
printf("%sowner : %s\n", ind, stat.owner);
printf("%sjobtype : %s\n", ind, (stat.jobtype ? "DAG" : "SIMPLE") );
printf("%sparent_job : %s\n", ind,
- j = edg_wlc_JobIdUnparse(stat.parent_job));
+ j2 = edg_wlc_JobIdUnparse(stat.parent_job));
if (stat.jobtype) {;
printf("%sseed : %s\n", ind, stat.seed);
printf("%schildren_num : %d\n", ind, stat.children_num);
printf("%sstateEnterTime : %ld.%06ld\n", ind, stat.stateEnterTime.tv_sec,stat.stateEnterTime.tv_usec);
printf("%sstateEnterTimes : \n",ind);
if (stat.stateEnterTimes) for (i=1; i<=stat.stateEnterTimes[0]; i++) {
- time_t t = stat.stateEnterTimes[i];
- printf("%s%14s %s", ind, edg_wll_StatToString(i-1), (stat.stateEnterTimes[i] == 0) ?
+ char *s;
+
+ s = edg_wll_StatToString(i-1);
+ t = stat.stateEnterTimes[i];
+ printf("%s%14s %s", ind, s, (stat.stateEnterTimes[i] == 0) ?
" - not available -\n" : ctime(&t));
+ free(s);
}
printf("%slastUpdateTime : %ld.%06ld\n", ind, stat.lastUpdateTime.tv_sec,stat.lastUpdateTime.tv_usec);
printf("%sexpectUpdate : %d\n", ind, stat.expectUpdate);
printf("%sacl : %s\n", ind, stat.acl);
printf("\n");
- free(j);
+ free(j1);
+ free(j2);
free(s);
}
#include "ws_fault.h"
#include "ws_typeref.h"
+#include "soap_version.h"
+
+#if GSOAP_VERSION <= 20602
+#define soap_call___lb__QueryJobs soap_call___ns1__QueryJobs
+#endif
+
#include "LoggingAndBookkeeping.nsmap"
int opt, err;
char *server = "http://localhost:9003/",
*name = NULL;
+ int i, j;
name = strrchr(argv[0],'/');
if (name) name++; else name = argv[0];
while ((opt = getopt_long(argc, argv, "hm:", opts, NULL)) != EOF) switch (opt)
{
case 'h': usage(name); return 0;
- case 'm': server = strdup(optarg); break;
+ case 'm': server = optarg; break;
case '?': usage(name); return 1;
}
exit(1);
}
+ for (i = 0; conditions[i]; i++) free(conditions[i]);
+ free(conditions);
+
err = soap_call___lb__QueryJobs(soap, server, "", qjobs, &out);
switch ( err ) {
case SOAP_OK: {
soap_print_fault(soap,stderr);
}
+ soap_end(soap);
+ soap_done(soap);
+ free(soap);
+ glite_gsplugin_free_context(gsplugin_ctx);
+ edg_wll_FreeContext(ctx);
+
return 0;
}
}
if (!ctx->use_transactions && transactions != 0) {
- fprintf(stderr, "[%d]: transaction aren't supported!\n", getpid());
+ fprintf(stderr, "[%d]: transactions aren't supported!\n", getpid());
}
if (transactions >= 0) {
ctx->use_transactions = transactions;
}
qc->__sizerecord = 0;
- while ( in[qc->__sizerecord++].attr );
+ while ( in[qc->__sizerecord].attr ) qc->__sizerecord++;
if ( !qc->__sizerecord )
goto ret;
edg_wll_QueryRec **qr;
assert(out);
- if ( !(qr = calloc(__sizecondition, sizeof(*qr))) ) return -1;
+ if ( !(qr = calloc(__sizecondition + 1, sizeof(*qr))) ) return -1;
for ( i = 0; i < __sizecondition; i++ )
if ( edg_wll_SoapToQueryConds(in[i], qr+i) ) goto err;