Changeset 380 for trunk


Ignore:
Timestamp:
Dec 27, 2012, 5:00:12 PM (12 years ago)
Author:
djay
Message:

Update to support multiple outputs provided in a XML POST request.

Location:
trunk/zoo-project
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/HISTORY.txt

    r379 r380  
    1111  * Add Python ZOO-API to access ZOO-Kernel internel functions
    1212  * Add a [headers] section in main.cfg file to add specifics to header returned
    13   * Add support for multiple outputs
     13  * Add support for multiple outputs for both GET and POST requests
    1414
    1515Version 1.2.0-rc3
  • trunk/zoo-project/zoo-kernel/zoo_loader.c

    r376 r380  
    7878  fprintf (stderr, "RequestMethod: (%s) %d %d\n", cgiRequestMethod,strncasecmp(cgiRequestMethod,"post",4),strncmp(cgiContentType,"text/xml",8)==0 || strncasecmp(cgiRequestMethod,"post",4)==0);
    7979  fprintf (stderr, "Request: %s\n", cgiQueryString);
     80  fprintf (stderr, "ContentType: %s\n", cgiContentType);
     81  fprintf (stderr, "ContentLength: %d\n", cgiContentLength);
    8082  fflush(stderr);
    8183#endif
     
    112114    }else{
    113115      char *buffer=new char[cgiContentLength+1];
    114       if(fread(buffer,sizeof(char),cgiContentLength,cgiIn)){
     116      int r=0;
     117      if((r=fread(buffer,sizeof(char),cgiContentLength,cgiIn))!=0){
    115118        buffer[cgiContentLength]=0;
    116119        tmpMap=createMap("request",buffer);
     
    209212              addToMap(tmpMap,"xrequest",(char*)xmlbuff);
    210213              char *tmp=(char*)xmlbuff;
    211               fprintf(stderr,"%s\n",tmp);
    212214              xmlFree(xmlbuff);
    213215            }
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r379 r380  
    18051805                  tmpmaps->next=NULL;
    18061806                }
    1807                 else
     1807                else{
     1808                  if(tmpmaps->name!=NULL)
     1809                    free(tmpmaps->name);
    18081810                  tmpmaps->name=strdup((char*)val);;
     1811                }
    18091812                xmlFree(val);
    18101813              }
     
    18351838                xmlFree(val);
    18361839              }
     1840              if(request_output_real_format==NULL)
     1841                request_output_real_format=dupMaps(&tmpmaps);
     1842              else
     1843                addMapsToMaps(&request_output_real_format,tmpmaps);
    18371844              cur2=cur2->next;
     1845              while(cur2!=NULL && cur2->type != XML_ELEMENT_NODE)
     1846                cur2=cur2->next;
    18381847            }
    18391848          }
    18401849          cur1=cur1->next;
     1850          while(cur1!=NULL && cur1->type != XML_ELEMENT_NODE)
     1851            cur1=cur1->next;
    18411852        }
    18421853      }
    1843       if(request_output_real_format==NULL)
    1844         request_output_real_format=dupMaps(&tmpmaps);
    1845       else
    1846         addMapsToMaps(&request_output_real_format,tmpmaps);
    1847 #ifdef DEBUG
    1848       dumpMaps(tmpmaps);
    1849 #endif
    1850       freeMaps(&tmpmaps);
    1851       free(tmpmaps);
     1854      if(tmpmaps!=NULL){
     1855        freeMaps(&tmpmaps);
     1856        free(tmpmaps);
     1857        tmpmaps=NULL;
     1858      }
    18521859    }
    18531860
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