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/service_internal_python.c

    r624 r682  
    523523maps* mapsFromPyDict(PyDictObject* t){
    524524  maps* res=NULL;
    525   maps* cursor=res;
     525  maps* cursor=NULL;
    526526  PyObject* list=PyDict_Keys((PyObject*)t);
    527527  int nb=PyList_Size(list);
    528528  int i;
     529  PyObject* key;
     530  PyObject* value;
    529531  for(i=0;i<nb;i++){
    530532#ifdef DEBUG
    531533    fprintf(stderr,">> parsing maps %d\n",i);
    532534#endif
    533     PyObject* key=PyList_GetItem(list,i);
    534     PyObject* value=PyDict_GetItem((PyObject*)t,key);
     535    key=PyList_GetItem(list,i);
     536    value=PyDict_GetItem((PyObject*)t,key);
    535537#ifdef DEBUG
    536538    fprintf(stderr,">> DEBUG VALUES : %s => %s\n",
     
    538540#endif
    539541    cursor=(maps*)malloc(MAPS_SIZE);
    540     cursor->name=PyString_AsString(key);
     542    cursor->name=zStrdup(PyString_AsString(key));
    541543    cursor->content=mapFromPyDict((PyDictObject*)value);
    542544#ifdef DEBUG
     
    572574  int nb=PyList_Size(list);
    573575  int i;
     576  PyObject* key;
     577  PyObject* value;
    574578  for(i=0;i<nb;i++){
    575     PyObject* key=PyList_GetItem(list,i);
    576     PyObject* value=PyDict_GetItem((PyObject*)t,key);
     579    key=PyList_GetItem(list,i);
     580    value=PyDict_GetItem((PyObject*)t,key);
    577581#ifdef DEBUG
    578582    fprintf(stderr,">> DEBUG VALUES : %s => %s\n",
     
    584588      Py_ssize_t size;
    585589#if PY_MAJOR_VERSION >= 3
    586       buffer=_PyUnicode_AsStringAndSize(value,&size);
     590      if(PyBytes_Check(value)){
     591        size=PyBytes_Size(value);
     592        buffer=PyBytes_AsString(value);
     593      }
     594      else
     595        if(PyUnicode_Check(value) && PyUnicode_READY(value) == 0){
     596          buffer=PyUnicode_AsUTF8AndSize(value,&size);
     597        }
     598        else{
     599          fprintf(stderr,"Unsupported return value.");
     600          return NULL;
     601        }
    587602#else
    588603      PyString_AsStringAndSize(value,&buffer,&size);
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