Ignore:
Timestamp:
Aug 31, 2017, 4:14:46 PM (7 years ago)
Author:
djay
Message:

Invoke callback asynchronously. Still the ZOO-Kernel has still to wait for every requests to finish before stoping its execution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c

    r850 r851  
    22692269  _tmpMaps = createMaps("renv");
    22702270  for (; s; ei++) {
    2271     int len=strlen(s);
    2272     char* tmpName=zStrdup(s);
    2273     char* tmpValue=strstr(s,"=")+1;
    2274     char* tmpName1=(char*)malloc((1+(len-strlen(tmpValue)))*sizeof(char));
    2275     snprintf(tmpName1,(len-strlen(tmpValue))+1,"%s",tmpName);
    2276     if(_tmpMaps->content == NULL)
    2277       _tmpMaps->content = createMap (tmpName1,tmpValue);
    2278     else
    2279       addToMap (_tmpMaps->content,tmpName1,tmpValue);
    2280     free(tmpName);
    2281     free(tmpName1);
     2271    if(strstr(s,"=")!=NULL && strlen(strstr(s,"="))>1){
     2272      int len=strlen(s);
     2273      char* tmpName=zStrdup(s);
     2274      char* tmpValue=strstr(s,"=")+1;
     2275      char* tmpName1=(char*)malloc((1+(len-strlen(tmpValue)))*sizeof(char));
     2276      snprintf(tmpName1,(len-strlen(tmpValue))+1,"%s",tmpName);
     2277      if(_tmpMaps->content == NULL)
     2278        _tmpMaps->content = createMap (tmpName1,tmpValue);
     2279      else
     2280        addToMap (_tmpMaps->content,tmpName1,tmpValue);
     2281      free(tmpName1);
     2282      free(tmpName);
     2283    }
    22822284    s = *(orig+ei);
    22832285  }
     
    23532355      loadServiceAndRun (&m, s1, request_inputs, &request_input_real_format,
    23542356                         &request_output_real_format, &eres);
     2357#ifdef RELY_ON_DB
     2358#ifdef META_DB
     2359      close_sql(m,1);
     2360      //end_sql();
     2361#endif
     2362      close_sql(m,0);
     2363#endif     
    23552364    }
    23562365  else
     
    25862595  if (((int) getpid ()) != cpid || cgiSid != NULL)
    25872596    {
     2597      fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
     2598      fflush(stderr);
     2599      invokeCallback(m,NULL,request_output_real_format,5,1);
     2600      fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
     2601      fflush(stderr);
     2602
    25882603      fclose (stdout);
    25892604
     
    26112626      recordResponse(m,fbkp1);
    26122627      fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
    2613       invokeCallback(m,NULL,request_output_real_format,5,1);
     2628      invokeCallback(m,NULL,request_output_real_format,6,0);
    26142629      fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
    26152630#endif
     
    26172632      free(bmap);
    26182633      unlink (fbkp1);
     2634      unhandleStatus (m);
     2635#ifdef RELY_ON_DB
     2636#ifdef META_DB
     2637      cleanupCallbackThreads();
     2638      close_sql(m,1);
     2639      //end_sql();
     2640#endif
     2641      close_sql(m,0);
     2642#endif
    26192643      unlink (flog);
    2620       unhandleStatus (m);
    2621 #ifdef META_DB
    2622       close_sql(m,0);
    2623       //end_sql();
    2624 #endif
    26252644      free(fbkpid);
    26262645      free(fbkpres);
     
    26302649      if(cgiSid!=NULL)
    26312650        free(cgiSid);
    2632       //InternetCloseHandle (&hInternet); 
     2651      //InternetCloseHandle (&hInternet);
    26332652      fprintf (stderr, "RUN IN BACKGROUND MODE %s %d \n",__FILE__,__LINE__);
    26342653      fflush(stderr);
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