From 8206b30e8813183c135f3c52c4239bb166459f98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sun, 18 Mar 2007 10:37:57 +0000 Subject: [PATCH] Remaining fixes due to gSoap 2.7.6b. --- org.glite.jp.primary/examples/dag-deps.c | 6 +++--- org.glite.jp.primary/examples/jpps-test.c | 10 +++++----- org.glite.jp.primary/src/soap_ops.c | 4 ++-- org.glite.jp.primary/src/soap_util.c | 12 +++++------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/org.glite.jp.primary/examples/dag-deps.c b/org.glite.jp.primary/examples/dag-deps.c index f4acdc0..f8f0f3a 100644 --- a/org.glite.jp.primary/examples/dag-deps.c +++ b/org.glite.jp.primary/examples/dag-deps.c @@ -158,14 +158,14 @@ int main(int argc,char *argv[]) in.tag = &tagval; tagval.name = GLITE_JP_ATTR_WF_SUCCESSOR; tagval.value = &val; - GSOAP_STRING(&val) = js; - GSOAP_BLOB(&val) = NULL; + memset(&val, 0, sizeof(val)); + GSOAP_SETSTRING(&val, js); printf("Register successor ...\n"); ret = check_fault(soap,soap_call___jpsrv__RecordTag(soap, server, "",&in, &empty)); in.jobid = js; tagval.name = GLITE_JP_ATTR_WF_ANCESTOR; - GSOAP_STRING(&val) = ja; + GSOAP_SETSTRING(&val, ja); printf("Register ancestor ...\n"); ret = check_fault(soap,soap_call___jpsrv__RecordTag(soap, server, "",&in, &empty)); diff --git a/org.glite.jp.primary/examples/jpps-test.c b/org.glite.jp.primary/examples/jpps-test.c index 8468aac..fc54c3e 100644 --- a/org.glite.jp.primary/examples/jpps-test.c +++ b/org.glite.jp.primary/examples/jpps-test.c @@ -142,8 +142,8 @@ int main(int argc,char *argv[]) in.tag = &tagval; tagval.name = argv[3]; tagval.value = &val; - GSOAP_STRING(&val) = argv[4]; - GSOAP_BLOB(&val)= NULL; + memset(&val, 0, sizeof(val)); + GSOAP_SETSTRING(&val, argv[4]); if (!(ret = check_fault(soap, soap_call___jpsrv__RecordTag(soap, server, "",&in, &empty)))) { @@ -158,8 +158,8 @@ int main(int argc,char *argv[]) struct jptype__stringOrBlob vals[2]; memset(vals, 0, sizeof vals); - GSOAP_STRING(vals) = "/O=CESNET/O=Masaryk University/CN=Ales Krenek"; - GSOAP_STRING(vals + 1) = "Done"; + GSOAP_SETSTRING(vals, "/O=CESNET/O=Masaryk University/CN=Ales Krenek"); + GSOAP_SETSTRING(vals + 1, "Done"); struct jptype__primaryQuery q[] = { { @@ -241,7 +241,7 @@ int main(int argc,char *argv[]) puts("Attribute values:"); for (i=0; ivalue) ? + GSOAP_ISSTRING(out.attrValues[i]->value) ? GSOAP_STRING(out.attrValues[i]->value) : "binary", orig2str(out.attrValues[i]->origin), diff --git a/org.glite.jp.primary/src/soap_ops.c b/org.glite.jp.primary/src/soap_ops.c index 0c6a3f2..187af84 100644 --- a/org.glite.jp.primary/src/soap_ops.c +++ b/org.glite.jp.primary/src/soap_ops.c @@ -177,7 +177,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RecordTag( } attr[0].name = in->tag->name; - if (GSOAP_STRING(in->tag->value)) { + if (GSOAP_ISSTRING(in->tag->value)) { attr[0].value = GSOAP_STRING(in->tag->value); attr[0].binary = 0; } @@ -236,7 +236,7 @@ err: static void s2jp_qval(const struct jptype__stringOrBlob *in, char **value, int *binary, size_t *size) { - if (GSOAP_STRING(in)) { + if (GSOAP_ISSTRING(in)) { *value = GSOAP_STRING(in); *binary = 0; *size = 0; diff --git a/org.glite.jp.primary/src/soap_util.c b/org.glite.jp.primary/src/soap_util.c index 4f5e108..1ece4d0 100644 --- a/org.glite.jp.primary/src/soap_util.c +++ b/org.glite.jp.primary/src/soap_util.c @@ -27,18 +27,16 @@ static int jp2s_attrValues( a->name = soap_strdup(soap,in[i].name); if (freeit) free(in[i].name); a->value = soap_malloc(soap,sizeof *a->value); + memset(a->value, 0, sizeof *a->value); if (in[i].binary) { - GSOAP_BLOB(a->value) = soap_malloc(soap,sizeof *GSOAP_BLOB(a->value)); + GSOAP_SETBLOB(a->value, soap_malloc(soap,sizeof *GSOAP_BLOB(a->value))); memset(GSOAP_BLOB(a->value),0,sizeof *GSOAP_BLOB(a->value)); GSOAP_BLOB(a->value)->__ptr = soap_malloc(soap,in[i].size); GSOAP_BLOB(a->value)->__size = in[i].size; memcpy(GSOAP_BLOB(a->value)->__ptr,in[i].value,in[i].size); - - GSOAP_STRING(a->value) = NULL; } else { - GSOAP_STRING(a->value) = soap_strdup(soap,in[i].value); - GSOAP_BLOB(a->value) = NULL; + GSOAP_SETSTRING(a->value, soap_strdup(soap,in[i].value)); } if (freeit) free(in[i].value); a->origin = jp2s_origin(in[i].origin); @@ -61,8 +59,8 @@ static void attrValues_free( for (i=0; iname); - if (GSOAP_STRING(a[i]->value)) soap_dealloc(soap,GSOAP_STRING(a[i]->value)); - if (GSOAP_BLOB(a[i]->value)) { + if (GSOAP_ISSTRING(a[i]->value) && GSOAP_STRING(a[i]->value)) soap_dealloc(soap,GSOAP_STRING(a[i]->value)); + if (GSOAP_ISBLOB(a[i]->value) && GSOAP_BLOB(a[i]->value)) { soap_dealloc(soap,GSOAP_BLOB(a[i]->value)->__ptr); soap_dealloc(soap,GSOAP_BLOB(a[i]->value)); } -- 1.8.2.3