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_loader.c

    r680 r682  
    2929 * Specific includes
    3030 */
    31 #ifndef WIN32
    3231#include "fcgio.h"
    3332#include "fcgi_config.h"
    3433#include "fcgi_stdio.h"
    35 #endif
    3634#include <sys/types.h>
    3735#include <unistd.h>
    3836#include "service_internal.h"
    3937#include "response_print.h"
    40 
    41 
    42 #ifdef WIN32
    43 #include "windows.h"
    44 #define strtok_r strtok_s
    45 #endif
    4638
    4739extern "C" {
     
    5446}
    5547
     48#ifdef WIN32
     49#include "windows.h"
     50#define strtok_r strtok_s
     51#endif
     52
    5653#include "service_internal.h"
    5754#include "request_parser.h"
    58 
    59 #ifdef WIN32
    60 #include "server_internal.h"
    61 #endif
    6255
    6356int runRequest(map**);
     
    178171      fprintf(stderr,"(( \n %s \n %s \n ))",*arrayStep,value);
    179172#endif
    180 #ifdef WIN32
    181       char* tmp = url_decode(value);
    182       if(tmpMap!=NULL)         
    183         addToMap(tmpMap,*arrayStep,tmp);
    184       else             
    185         tmpMap=createMap(*arrayStep,tmp);
    186       free(tmp);
    187 #else
    188173      if(tmpMap!=NULL)
    189174        addToMap(tmpMap,*arrayStep,value);
    190175      else
    191176        tmpMap=createMap(*arrayStep,value);
    192 #endif 
    193177      arrayStep++;
    194178      delete[]value;
     
    206190    char *buffer=(char*)malloc((flen+1)*sizeof(char));
    207191    fread(buffer,flen,1,lf);
     192    char *pchr=strrchr(buffer,'>');
     193    cgiContentLength=strlen(buffer)-strlen(pchr)+1;
     194    buffer[cgiContentLength]=0;
    208195    fclose(lf);
    209196    addToMap(tmpMap,"request",buffer);
    210197    free(buffer);
    211     cgiContentLength=flen+9;
    212198  }
    213199#endif
     
    387373      }   
    388374      //addToMap(tmpMap,name,value);
    389           /* knut: strtok(_r) ignores delimiter bytes at start and end of string;
    390            * it will return non-empty string or NULL, e.g. "metapath=" yields value=NULL.
    391            * This modification sets value="" instead of NULL.
    392            */
    393           addToMap(tmpMap,name, value != NULL ? value : "");
    394 
     375      /* knut: strtok(_r) ignores delimiter bytes at start and end of string;
     376       * it will return non-empty string or NULL, e.g. "metapath=" yields value=NULL.
     377       * This modification sets value="" instead of NULL.
     378       */
     379      addToMap(tmpMap,name, value != NULL ? value : "");
    395380      free(name);
    396381      free(value);
     
    412397    free(strQuery);
    413398
    414  
    415399  runRequest(&tmpMap);
    416400
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