From: Aleš Křenek Date: Thu, 11 Aug 2005 14:41:43 +0000 (+0000) Subject: fix building tags plugin X-Git-Tag: gridsite-core_R_1_1_11~76 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=8adf33bb21755d07752a526af764c9c192c15584;p=jra1mw.git fix building tags plugin --- diff --git a/org.glite.jp.primary/src/soap_ops.c b/org.glite.jp.primary/src/soap_ops.c index d49d112..8095810 100644 --- a/org.glite.jp.primary/src/soap_ops.c +++ b/org.glite.jp.primary/src/soap_ops.c @@ -179,6 +179,13 @@ SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RecordTag( file_be = file_p = NULL; + attr[0].name = in->tag->name; + attr[0].value = in->tag->value; + attr[0].origin = GLITE_JP_ATTR_ORIG_USER; + attr[0].timestamp = time(NULL); + attr[0].origin_detail = NULL; /* XXX */ + attr[1].name = NULL; + /* XXX: we assume just one plugin and also that TAGS plugin handles * just one uri/class */ @@ -194,7 +201,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RecordTag( /* XXX: assuming tag plugin handles just one type */ if (pd[0]->ops.open(pd[0]->fpctx,file_be,GLITE_JP_FILETYPE_TAGS,&file_p) - || pd[0]->ops.generic(pd[0]->fpctx,file_p,GLITE_JP_FPLUG_TAGS_APPEND,in->tag->name,in->tag->value)) + || pd[0]->ops.generic(pd[0]->fpctx,file_p,GLITE_JP_FPLUG_TAGS_APPEND,attr)) { err2fault(ctx,soap); if (file_p) pd[0]->ops.close(pd[0]->fpctx,file_p); @@ -211,12 +218,6 @@ SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RecordTag( return SOAP_FAULT; } - attr[0].name = in->tag->name; - attr[0].value = in->tag->value; - attr[0].origin = GLITE_JP_ATTR_ORIG_USER; - attr[0].timestamp = time(NULL); - attr[0].origin_detail = NULL; /* XXX */ - /* XXX: ignore errors but don't fail silenty */ glite_jpps_match_attr(ctx,in->jobid,attr); diff --git a/org.glite.jp.primary/src/tags_plugin.c b/org.glite.jp.primary/src/tags_plugin.c index 877201d..4fa112d 100644 --- a/org.glite.jp.primary/src/tags_plugin.c +++ b/org.glite.jp.primary/src/tags_plugin.c @@ -26,7 +26,7 @@ static int tagdummy() struct tags_handle { void *bhandle; int n; - glite_jp_tagval_t *tags; + glite_jp_attrval_t *tags; }; int init(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data) @@ -76,7 +76,7 @@ static int tagclose(void *fpctx,void *handle) static int tagappend(void *fpctx,void *handle,int oper,...) { - glite_jp_tagval_t *tag; + glite_jp_attrval_t *tag; va_list ap; char *hdr,*rec; glite_jp_context_t ctx = fpctx; @@ -90,10 +90,10 @@ static int tagappend(void *fpctx,void *handle,int oper,...) glite_jp_clear_error(ctx); va_start(ap,oper); - tag = va_arg(ap,glite_jp_tagval_t *); + tag = va_arg(ap,glite_jp_attrval_t *); va_end(ap); - printf("tagappend: %s,%d,%s\n",tag->name,tag->sequence,tag->value); + printf("tagappend: %s,%s\n",tag->name,tag->value); assert(oper == GLITE_JP_FPLUG_TAGS_APPEND); @@ -122,7 +122,8 @@ static int tagappend(void *fpctx,void *handle,int oper,...) return glite_jp_stack_error(ctx,&err); } - trio_asprintf(&hdr,"%d %ld %c",tag->sequence, +/* XXX: origin is always USER, not recorded */ + trio_asprintf(&hdr,"%ld %c", tag->timestamp,tag->binary ? 'B' : 'S'); rlen = strlen(tag->name) + strlen(hdr) + 2 /* \0 after name and after hdr */ +