Changeset 772 for trunk/zoo-project


Ignore:
Timestamp:
Jun 11, 2016, 11:48:27 AM (3 years ago)
Author:
djay
Message:

Dynamically add a [renv] section to store all environment variables available at runtime. Update the documentation to provide informations about thie new section.

File:
1 edited

Legend:

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

    r767 r772  
    102102#include <time.h>
    103103#include <stdarg.h>
     104
     105#ifndef WIN32
     106extern char **environ;
     107#endif
    104108
    105109#ifdef WIN32
     
    19741978  dumpMap (request_inputs);
    19751979#endif
     1980
     1981  int ei = 1;
     1982  char *s =
     1983#ifdef WIN32
     1984    GetEnvironmentStrings();
     1985#else
     1986    *environ;
     1987#endif
     1988  _tmpMaps = (maps *) malloc (MAPS_SIZE);
     1989  _tmpMaps->name = zStrdup ("renv");
     1990  _tmpMaps->content = NULL;
     1991  _tmpMaps->next = NULL;
     1992  for (; s; ei++) {
     1993    char* tmpName=zStrdup(s);
     1994    char* tmpValue=strstr(s,"=")+1;
     1995    tmpName[strlen(tmpName)-strlen(tmpValue)-1]=0;
     1996    if(_tmpMaps->content == NULL)
     1997      _tmpMaps->content = createMap (tmpName,tmpValue);
     1998    else
     1999      addToMap (_tmpMaps->content,tmpName,tmpValue);
     2000    free(tmpName);
     2001    s = *(environ+ei);
     2002  }
     2003  addMapsToMaps (&m, _tmpMaps);
     2004  freeMaps (&_tmpMaps);
     2005  free (_tmpMaps);
     2006
    19762007#ifdef WIN32
    19772008  char *cgiSidL = NULL;
     
    20912122                     strlen (usid->value) + 7) * sizeof (char));
    20922123          sprintf (fbkpid, "%s/%s.pid", r_inputs->value, usid->value);
     2124          setMapInMaps (m, "lenv", "file.pid", fbkpid);
    20932125
    20942126          f0 = freopen (fbkpid, "w+",stdout);
     
    21022134                     strlen (usid->value) + 7) * sizeof (char));
    21032135          sprintf (fbkp, "%s/%s.sid", r_inputs->value, usid->value);
     2136          setMapInMaps (m, "lenv", "file.sid", fbkp);
    21042137          FILE* f2 = freopen (fbkp, "w+",stdout);
    21052138          printf("%s",tmpm->value);
     
    21132146          sprintf (fbkp, "%s/%s_%s.xml", r_inputs->value, r_inputs1->value,
    21142147                   usid->value);
     2148          setMapInMaps (m, "lenv", "file.responseInit", fbkp);
    21152149          flog =
    21162150            (char *)
     
    21192153          sprintf (flog, "%s/%s_%s_error.log", r_inputs->value,
    21202154                   r_inputs1->value, usid->value);
     2155          setMapInMaps (m, "lenv", "file.log", flog);
    21212156#ifdef DEBUG
    21222157          fprintf (stderr, "RUN IN BACKGROUND MODE \n");
     
    21602195          sprintf (fbkp1, "%s/%s_final_%s.xml", r_inputs->value,
    21612196                   r_inputs1->value, usid->value);
     2197          setMapInMaps (m, "lenv", "file.responseFinal", fbkp1);
    21622198
    21632199          f1 = freopen (fbkp1, "w+", stdout);
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