fixes & cleanup in QueryConds conversions
authorMiloš Mulač <mulac@civ.zcu.cz>
Fri, 2 Sep 2005 13:37:32 +0000 (13:37 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Fri, 2 Sep 2005 13:37:32 +0000 (13:37 +0000)
org.glite.jp.index/src/soap_ps_calls.c
org.glite.jp.index/src/ws_typeref.c

index be58808..ed0755b 100644 (file)
@@ -88,22 +88,8 @@ printf("MyFeedIndex for %s called\n", dest);
        in.__sizeattributes = i;
        in.attributes = conf->attrs;
 
-/*
-       // XXX: we need C -> WSDL conversion function !
-       query.attr = conf->query[0][0].attr;
-       query.op = conf->query[0][0].op;        // XXX: nasty, needs conversion
-       query.origin = malloc(sizeof(*query.origin));
-       *query.origin = jptype__attrOrig__USER;
-       value.string = conf->query[0][0].value; // XXX: hope string
-//     memset(&blob, 0, sizeof(blob));
-//     value.blob = &blob;
-       value.blob = NULL;
-       query.value = &value;
-       query.value2 = NULL;
-*/
-       for (i=0; conf->query[i]; i++);
-       in.__sizeconditions = i;
-       in.conditions = malloc(i * sizeof(*in.conditions));
+       for (in.__sizeconditions=0; conf->query[in.__sizeconditions]; in.__sizeconditions++);
+       in.conditions = malloc(in.__sizeconditions * sizeof(*in.conditions));
 
        for (i=0; conf->query[i]; i++) {
                if (glite_jpis_QueryCondToSoap(soap, conf->query[i], &(in.conditions[i])) != SOAP_OK) {
@@ -112,9 +98,6 @@ printf("MyFeedIndex for %s called\n", dest);
                }
        }
 
-       in.conditions[0] = &query;      // XXX: supp. only one dimensional queries ! (no ORs)
-                                       // for 2D queries one more _sizeconditions needed IMO
-
        in.history = conf->history;
        in.continuous = conf->continuous;
 
index ae10272..58a5ce5 100644 (file)
@@ -53,6 +53,7 @@ static int QueryValToSoap(
        
         assert(in); assert(out);
        if ( !(val = soap_malloc(soap, sizeof(*val))) ) return SOAP_FAULT;
+       memset(val, 0, sizeof(*val) );
 
         if (binary) {
                val->string = NULL;
@@ -67,6 +68,8 @@ static int QueryValToSoap(
                if ( !(val->string = soap_strdup(soap, in)) )  return SOAP_FAULT;
        }
 
+       *out = val;
+
        return SOAP_OK;
 }