Ignore:
Timestamp:
Jul 17, 2016, 12:41:09 PM (8 years ago)
Author:
djay
Message:

Fix issue when executing a service in asyncrhonous mode wiht db backend activated. Set 'Running' in fstate when the service start.

Location:
trunk/zoo-project/zoo-kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/response_print.c

    r784 r785  
    757757      char* ckey=level->value;
    758758      if(strncasecmp(level->value,"profile",7)==0)
    759         ckey="generic";
     759        ckey=(char*)"generic";
    760760      if(strncasecmp(level->value,"generic",7)==0)
    761         ckey="concept";
     761        ckey=(char*)"concept";
    762762      service* inherited=getServiceFromRegistry(reg,ckey,tmp1->value);
    763763      if(inherited!=NULL){
     
    15371537    memset(url,0,1024);
    15381538    maps* tmp_maps=getMaps(m,"main");
    1539     if(tmp_maps!=NULL){
     1539    if(tmp_maps!=NULL && tmp_maps->content!=NULL){
    15401540      map* tmpm1=getMap(tmp_maps->content,"serverAddress");
    15411541      /**
     
    15611561        sprintf(file_path,"%s/GetStatus.zcfg",ntmp);
    15621562      }
    1563       fprintf(stderr,"%s \n",file_path);
    15641563      statRes=stat(file_path,&myFileInfo);
    15651564      if(statRes==0){
     
    17611760      xmlAddChild(n,nc);
    17621761  }
    1763  
     1762
    17641763  if(vid==0 &&
    17651764     hasStoredExecuteResponse==true
     
    19651964  if(tmpMap==NULL){
    19661965    nc2=xmlNewNode(ns_wps, BAD_CAST "Data");
    1967     if(e!=NULL){
     1966    if(e!=NULL && e->format!=NULL){
    19681967      if(strncasecmp(e->format,"LiteralOutput",strlen(e->format))==0)
    19691968        nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData");
     
    24252424    map *usid=getMapFromMaps(m,"lenv","usid");
    24262425    addToMap(statusInfo,"JobID",usid->value);
    2427     printStatusInfo(m,statusInfo,"Execute");
     2426    printStatusInfo(m,statusInfo,(char*)"Execute");
    24282427    freeMap(&statusInfo);
    24292428    free(statusInfo);
     
    24512450          gfile=getMap(tmpI->content,"generated_file");
    24522451        }
    2453         readGeneratedFile(m,tmpI->content,gfile->value);           
    2454         file_name=(char*)malloc((strlen(gfile->value)+strlen(tmp1->value)+1)*sizeof(char));
    2455         for(int i=0;i<strlen(gfile->value);i++)
    2456           file_name[i]=gfile->value[i+strlen(tmp1->value)];
     2452        readGeneratedFile(m,tmpI->content,gfile->value);
     2453        file_name=zStrdup((gfile->value)+strlen(tmp1->value));
    24572454      }
    24582455
     
    24672464          char *format=NULL;
    24682465          if(in!=NULL && in->format!=NULL){
    2469             format=zStrdup(in->format);
     2466            format=in->format;
    24702467          }else
    2471             format=zStrdup("LiteralData");
    2472           if(strcasecmp(format,"BoundingBoxData")==0){
     2468            format=(char*)"LiteralData";
     2469          if(format!=NULL && strcasecmp(format,"BoundingBoxData")==0){
    24732470            addToMap(tmpI->content,"extension","xml");
    24742471            addToMap(tmpI->content,"mimeType","text/xml");
     
    25352532            sprintf(file_url,"%s/%s/%s",tmp3->value,tmp2->value,file_name);
    25362533          }
    2537 
    25382534          addToMap(tmpI->content,"Reference",file_url);
    2539           free(format);
    25402535          free(file_name);
    25412536          free(file_url);
  • trunk/zoo-project/zoo-kernel/response_print.h

    r767 r785  
    136136   * Definitions of acceptable final status
    137137   */
    138   static char wpsStatus[2][11]={
     138  static char wpsStatus[3][11]={
    139139    "Succeeded",
    140     "Failed"
     140    "Failed",
     141    "Running"
    141142  };
    142143  /**
  • trunk/zoo-project/zoo-kernel/server_internal.c

    r781 r785  
    251251  }else{
    252252    if(tmp!=NULL){
    253       tmp1==zStrdup(tmp);
     253      tmp1=zStrdup(tmp);
    254254      free(tmp);
    255255    }else{
    256256      if(tmp0!=NULL){
    257         tmp1==zStrdup(tmp0);
     257        tmp1=zStrdup(tmp0);
    258258        free(tmp0);
    259259      }
  • trunk/zoo-project/zoo-kernel/sqlapi.c

    r784 r785  
    2727#include "ogrsf_frmts.h"
    2828#include "ogr_p.h"
     29#include "response_print.h"
    2930#if GDAL_VERSION_MAJOR >= 2
    3031#include <gdal_priv.h>
     
    219220                                strlen(uusid->value)+
    220221                                strlen(osid->value)+
    221                                 strlen(sid->value)+56+1)*sizeof(char));
     222                                strlen(sid->value)+
     223                                strlen(wpsStatus[2])+66+1)*sizeof(char));
    222224  sprintf(sqlQuery,
    223           "INSERT INTO %s.services (uuid,sid,osid)"
    224           "VALUES ('%s','%s','%s');",
     225          "INSERT INTO %s.services (uuid,sid,osid,fstate)"
     226          "VALUES ('%s','%s','%s','%s');",
    225227          schema->value,
    226           uusid->value,sid->value,osid->value);
     228          uusid->value,
     229          sid->value,
     230          osid->value,
     231          wpsStatus[2]);
    227232  execSql(conf,sqlQuery);
    228233  free(sqlQuery);
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