Ignore:
Timestamp:
Jan 5, 2011, 3:20:01 PM (13 years ago)
Author:
djay
Message:

Adding contains and getIoTypeFromElement functions in service.h. Remove memory leaks from the Service Configuration Parser, add the support for multiple supported formats as before. Small modification of the ZOO-Kernel Java Support, adding the capability to access the modified main_conf HashMap? from the Kernel to let lenv message map pass when an error occurs and it is handled in the Service code. Adding same capability for the ZOO-Kernel Python Support. Use strcasecmp in service.h rather than strlen+strncasecmp. Ensure that only OWS compliant informations are available for Contact.Phone and Contact.Adress. Remove memory leak in createExceptionReportNode. Correction of the addDefaultValues function to add the default format using the informations from DataInputs? if present, this should correct the behavior of the ZOO-Kernel when choosing the extension value which should now point to the corresponding zcfg value if present. Don't set the NULL value for inputs not provided in the DataInputs?, still set NULL as default value for outputs. Avoid segfault in freeElements when some zcfg values was not set correctly. Link against the client libjvm.so file rather than the server one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-kernel/service_conf.y

    r20 r57  
    133133 : STag contentetoile ETag     
    134134{
    135   free($3);
    136135}
    137136
     
    210209          my_service->inputs->next=NULL;
    211210        }
    212         else
     211        else if(current_element!=NULL && current_element->name!=NULL){
    213212          addToElements(&my_service->inputs,current_element);
     213        }
    214214#ifdef DEBUG_SERVICE_CONF
    215215        fprintf(stderr,"CURRENT_ELEMENT\n");
     
    267267              addMapToMap(&current_element->metadata,current_content);
    268268              current_element->next=NULL;
    269               current_element->format=$2;
     269              current_element->format=strdup($2);
    270270              current_element->defaults=NULL;
    271271              current_element->supported=NULL;
     
    280280            current_element->metadata=NULL;
    281281            current_element->next=NULL;
    282             current_element->format=$2;
     282            current_element->format=strdup($2);
    283283            current_element->defaults=NULL;
    284284            current_element->supported=NULL;
     
    297297              if(wait_defaults==true){
    298298                defaultsc++;
    299                 freeMap(&current_content);
    300                 current_content=NULL;
     299                /*freeMap(&current_content);
     300                  current_content=NULL;*/
    301301              }
    302302              current_data=5;
     
    305305  printf("* Identifiant : %s\n",$2);
    306306#endif
    307   /* et on renvoie l'identifiant de balise afin de pouvoir le comparer */
    308   /* avec la balise jumelle fermante ! */
    309   $$ = $2 ;
    310307}
    311308 ;
     
    338335  printf ("attribute : %s\n",$1) ;
    339336#endif
    340   free($1);
    341337}
    342338 ;
     
    391387    current_content=NULL;
    392388    current_element->supported=NULL;
     389    current_element->next=NULL;
    393390  }
    394391  if(strcmp($3,"Supported")==0){
    395392    current_data=previous_data;
    396393    if(current_element->supported==NULL){
    397       //addMapToIoType(&current_element->supported,current_content);
    398       current_element->supported=(iotype*)malloc(IOTYPE_SIZE);
    399       current_element->supported->content=NULL;
    400       addMapToMap(&current_element->supported->content,current_content);
    401       freeMap(&current_content);
    402       free(current_content);
    403       current_element->supported->next=NULL;
    404       current_content=NULL;
     394      if(current_content!=NULL){
     395        current_element->supported=(iotype*)malloc(IOTYPE_SIZE);
     396        current_element->supported->content=NULL;
     397        addMapToMap(&current_element->supported->content,current_content);
     398        freeMap(&current_content);
     399        free(current_content);
     400        current_element->supported->next=NULL;
     401        current_content=NULL;
     402      }else{
     403        current_element->supported=NULL;
     404        current_element->next=NULL;
     405      }
    405406    }
    406407    else{
    407 #ifdef DEBUG
    408       // Currently we support only one supported format
     408#ifdef DEBUG_SERVICE_CONF
    409409      fprintf(stderr,"SECOND SUPPORTED FORMAT !!!!\n");
    410410#endif
    411       //addMapToIoType(&current_element->supported,current_content);
    412       /*iotype* iotmp=*(&current_element->supported);
    413       while(iotmp!=NULL){
    414         dumpMap(iotmp->content);
    415         iotmp=iotmp->next;
    416       }
    417       iotmp=(iotype*)malloc(IOTYPE_SIZE);
    418       iotmp->content=NULL;
    419       addMapToMap(&iotmp->content,current_content);
    420       iotmp->next=NULL;
    421       dumpElements(current_element);
    422       fprintf(stderr,"SECOND SUPPORTED FORMAT MAP START !!!!\n");
    423       dumpMap(current_content);
    424       fprintf(stderr,"SECOND SUPPORTED FORMAT MAP END !!!!\n");*/
     411      addMapToIoType(&current_element->supported,current_content);
    425412      freeMap(&current_content);
    426413      free(current_content);
    427414      current_content=NULL;
    428       /*freeMap(&iotmp->content);
    429       free(&iotmp->content);
    430       free(iotype);*/
    431 #ifdef DEBUG
    432       // Currently we support only one supported format
     415#ifdef DEBUG_SERVICE_CONF
     416      dumpElements(current_element);
    433417      fprintf(stderr,"SECOND SUPPORTED FORMAT !!!!\n");
    434418#endif
     
    436420    current_content=NULL;
    437421  }
    438   /* on renvoie l'identifiant de la balise pour pouvoir comparer les 2 */
    439   /* /!\ une balise fermante n'a pas d'attributs (c.f. : W3C) */
    440   $$ = $3;
    441422}
    442423 ;
     
    610591      if(current_data==2){
    611592        if(wait_inputs==true){
    612           fprintf(stderr,"dup INPUTS\n");
    613           if(current_element->name!=NULL){
     593          if(current_element!=NULL && current_element->name!=NULL){
    614594            if(my_service->inputs==NULL){
    615595              my_service->inputs=dupElements(current_element);
     
    661641          }
    662642          wait_inputs=false;
    663           dumpMap(current_content);
    664643          current_content=NULL;
    665644        }
     
    755734  int resultatYYParse = srparse() ;
    756735 
    757   if(wait_outputs==true && current_element->name!=NULL){
     736  if(wait_outputs==true && current_element!=NULL && current_element->name!=NULL){
    758737    if(my_service->outputs==NULL){     
    759738#ifdef DEBUG_SERVICE_CONF
     
    762741      my_service->outputs=dupElements(current_element);
    763742      my_service->outputs->next=NULL;
    764       freeElements(&current_element);
    765       free(current_element);
    766       current_element=NULL;
    767743    }
    768744    else{
     
    778754    free(current_element);
    779755    current_element=NULL;
     756#ifdef DEBUG_SERVICE_CONF
     757    fprintf(stderr,"(DATAOUTPUTS - 631) FREE current_element\n");
     758#endif
    780759  }
    781760  if(current_element!=NULL){
    782761    freeElements(&current_element);
    783     fprintf(stderr,"LINE 709");
    784762    free(current_element);
    785763    current_element=NULL;
     
    787765  if(current_content!=NULL){
    788766    freeMap(&current_content);
    789     fprintf(stderr,"LINE 715");
    790767    free(current_content);
    791768    current_content=NULL;
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png