Ignore:
Timestamp:
Jun 26, 2015, 2:07:46 PM (9 years ago)
Author:
djay
Message:

Fix GetResult? and POST asynchronous requests on Windows. Prevent CONTENT_TYPE=text/xml before creating the process using CreateProcess?. Revert modifications made r587 for using url_decode directly inside zoo_loader.c, the url_decode call should be in kvpParseInputs (from request_parser.c), indeed, there should not be any decoding required in other cases than Execute requests. Fix issue in mapsFromPyDict, small changes in mapFromPyDict to fix parsing result value (only) for Python 3.

File:
1 edited

Legend:

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

    r680 r682  
    734734    strncpy(kvp, key, strlen(key));
    735735    addToCache(m, tmpReq->value, tmpReq->value, "text/xml", strlen(tmpReq->value),
    736                filepath, FILENAME_MAX);                           
     736               filepath, FILENAME_MAX);
    737737    if (filepath == NULL) {
    738738      errorException( m, _("Unable to cache HTTP POST Execute request."), "InternalError", NULL); 
     
    787787  SetEnvironmentVariable ("CGISID", TEXT (sid->value));
    788788  SetEnvironmentVariable ("QUERY_STRING", TEXT (tmpq));
    789   // knut: Prevent REQUEST_METHOD=POST in background process call to cgic:main (process hangs when reading cgiIn):
     789  // knut: Prevent REQUEST_METHOD=POST in background process call to cgic:main
     790  // (process hangs when reading cgiIn):
    790791  SetEnvironmentVariable("REQUEST_METHOD", "GET");
     792  SetEnvironmentVariable("CONTENT_TYPE", "text/plain");
    791793 
    792794  char clen[1000];
     
    794796  SetEnvironmentVariable ("CONTENT_LENGTH", TEXT (clen));
    795797
     798  // ref. https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863%28v=vs.85%29.aspx
    796799  if (!CreateProcess (NULL,     // No module name (use command line)
    797800                      TEXT (tmp),       // Command line
     
    17981801   * Initialize the specific [lenv] section which contains runtime variables:
    17991802   *
    1800    *  - usid : it is an unique identification number
     1803   *  - usid : it is an universally unique identifier 
     1804   *  - osid : it is an idenfitication number
    18011805   *  - sid : it is the process idenfitication number (OS)
    1802    *  - uusid : it is an universally unique identification number
     1806   *  - uusid : it is an universally unique identifier
    18031807   *  - status : value between 0 and 100 to express the  completude of
    18041808   * the operations of the running service
     
    19311935  map *test1 = getMap (request_inputs, "cgiSid");
    19321936  if (test1 != NULL){
    1933       cgiSid = test1->value;
    1934       addToMap (request_inputs, "storeExecuteResponse", "true");
    1935       addToMap (request_inputs, "status", "true");
    1936       setMapInMaps (m, "lenv", "sid", test1->value);
    1937       status = getMap (request_inputs, "status");
    1938     }
     1937    cgiSid = zStrdup(test1->value);
     1938    addToMap (request_inputs, "storeExecuteResponse", "true");
     1939    addToMap (request_inputs, "status", "true");
     1940    setMapInMaps (m, "lenv", "osid", test1->value);
     1941    status = getMap (request_inputs, "status");
     1942  }
    19391943  test1 = getMap (request_inputs, "usid");
    19401944  if (test1 != NULL){
     
    21292133                             &request_input_real_format,
    21302134                             &request_output_real_format, &eres);
    2131 
    21322135        }
    21332136      else
     
    21822185      lockShm (lid);
    21832186#endif
    2184       fclose(f0);
    21852187      FILE *f3 = fopen (fbkp, "wb+");
    21862188      free (fbkp);
     
    22062208      }
    22072209#ifndef RELY_ON_DB
    2208       dumpMapsToFile(bmap,fbkpres);
     2210      dumpMapsToFile(bmap,fbkpres,1);
    22092211      removeShmLock (m, 1);
    22102212#else
     
    22212223      free (fbkp1);
    22222224      free (tmps1);
     2225      if(cgiSid!=NULL)
     2226        free(cgiSid);
    22232227    }
    22242228
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