Changeset 772


Ignore:
Timestamp:
Jun 11, 2016, 11:48:27 AM (9 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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/kernel/configuration.rst

    r752 r772  
    158158...............................
    159159
    160 The ``lenv`` can be used to store runtime informations automatically
    161 set by ZOO-Kernel before and during the execution of a WPS service,
    162 with the following parameters:
     160The ``lenv`` section is used by the ZOO-Kernel to store runtime informations
     161before the execution of a WPS service, it contains the following
     162parameters:
    163163
    164164 * ``sid`` (r): The WPS Service unique identifier,
     
    169169 * ``cookie`` (rw): The cookie to be returned to the client (for
    170170   example for authentication purpose).
     171 * ``file.pid`` (r): The file used by the ZOO-Kernel to store process identifier.
     172 * ``file.sid`` (r): The file used by the ZOO-Kernel to store service identifier.
     173 * ``file.responseInit`` (r): The file used by the ZOO-Kernel to store
     174   the initial (then final) WPS response.
     175 * ``file.responseFinal`` (r): The file used by the ZOO-Kernel to
     176   temporary store the final WPS response.
     177
     178renv section
     179...............................
     180
     181The ``renv`` section is automatically created by the ZOO-Kernel before
     182the execution of a WPS service, it contains all the environment
     183variables available at runtime (so including the header fields in case
     184it is used through http, refer to [https://tools.ietf.org/html/rfc3875
     185rfc3875] for more details).
     186
    171187
    172188senv section
  • 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