Ignore:
Timestamp:
Feb 25, 2018, 3:06:51 PM (6 years ago)
Author:
djay
Message:

Fix issue #163 and add support for extra cookie through definition of ecookie array map and the corresponding ecookie_lenght. This give the capability to return more than only a single Cookie.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/request_parser.c

    r864 r867  
    905905                  }
    906906
    907 
    908907                  while (cur4 != NULL)
    909908                    {
     
    979978
    980979                      if (strcasecmp (test->value, "base64") != 0)
    981                         { 
     980                        {
    982981                          xmlChar *mv = xmlNodeListGetString (doc,
    983982                                                              cur4->xmlChildrenNode,
     
    10071006                                                             &buffersize,
    10081007                                                             "utf-8", 0);
     1008                                  xmlFreeDoc (doc1);
    10091009                                }
    10101010                              else
     
    10221022                              addIntToMap (tmpmaps->content, "size",
    10231023                                           buffersize);
    1024                               xmlFreeDoc (doc1);
    10251024                            }else{
    1026                             xmlNodePtr cur5 = cur4->children;
    1027                             while (cur5 != NULL
    1028                                    && cur5->type != XML_CDATA_SECTION_NODE)
    1029                               cur5 = cur5->next;
    1030                             if (cur5 != NULL
    1031                                 && cur5->type == XML_CDATA_SECTION_NODE){
    1032                               xmlFree(mv);
    1033                               mv=xmlStrdup(cur5->content);
     1025                            if(xmlStrcasecmp
     1026                               (cur4->name, BAD_CAST "BoundingBoxData") == 0){
     1027                              xmlDocPtr doc1 = xmlNewDoc(BAD_CAST "1.0");
     1028                              int buffersize;
     1029                              xmlDocSetRootElement(doc1,cur4);
     1030                              xmlDocDumpFormatMemoryEnc(doc1,&mv,
     1031                                                        &buffersize,
     1032                                                        "utf-8",0);
     1033                              addIntToMap (tmpmaps->content, "size",
     1034                                           buffersize);
     1035                              xmlParseBoundingBox(main_conf,&tmpmaps->content,doc1);
     1036                            }else{
     1037                              xmlNodePtr cur5 = cur4->children;
     1038                              while (cur5 != NULL
     1039                                     && cur5->type != XML_ELEMENT_NODE
     1040                                     && cur5->type != XML_CDATA_SECTION_NODE)
     1041                                cur5 = cur5->next;
     1042                              if (cur5 != NULL
     1043                                  && cur5->type != XML_CDATA_SECTION_NODE)
     1044                                {
     1045                                  xmlDocPtr doc1 = xmlNewDoc (BAD_CAST "1.0");
     1046                                  int buffersize;
     1047                                  xmlDocSetRootElement (doc1, cur5);
     1048                                  xmlDocDumpFormatMemoryEnc (doc1, &mv,
     1049                                                             &buffersize,
     1050                                                             "utf-8", 0);
     1051                                  addIntToMap (tmpmaps->content, "size",
     1052                                               buffersize);
     1053                                }
     1054                              else /*if (cur5 != NULL
     1055                                     && cur5->type == XML_CDATA_SECTION_NODE)*/{
     1056                                xmlFree(mv);
     1057                                mv=xmlStrdup(cur5->content);
     1058                              }
    10341059                            }
    10351060                          }
     
    11021127    }
    11031128  return 1;
     1129}
     1130
     1131/**
     1132 * Parse a BoundingBoxData node
     1133 *
     1134 * http://schemas.opengis.net/ows/1.1.0/owsCommon.xsd: BoundingBoxType
     1135 *
     1136 * A map to store boundingbox information will contain:
     1137 *  - LowerCorner : double double (minimum within this bounding box)
     1138 *  - UpperCorner : double double (maximum within this bounding box)
     1139 *  - crs : URI (Reference to definition of the CRS)
     1140 *  - dimensions : int
     1141 *
     1142 * @param main_conf the conf maps containing the main.cfg settings
     1143 * @param request_inputs the map storing KVP raw value
     1144 * @param doc the xmlDocPtr containing the BoudingoxData node
     1145 * @return a map containing all the bounding box keys
     1146 */
     1147int xmlParseBoundingBox(maps** main_conf,map** current_input,xmlDocPtr doc){
     1148  xmlNode *root_element = xmlDocGetRootElement(doc);
     1149  for(xmlAttrPtr attr = root_element->properties; NULL != attr; attr = attr->next){
     1150    xmlChar *val = xmlGetProp (root_element, BAD_CAST attr->name);
     1151    addToMap(*current_input,(char*)attr->name,(char*)val);
     1152    xmlFree(val);
     1153    xmlNodePtr cur = root_element->children;
     1154    while(cur!=NULL && cur->type != XML_ELEMENT_NODE)
     1155      cur=cur->next;
     1156    while(cur!=NULL && cur->type==XML_ELEMENT_NODE){
     1157      xmlChar *val =
     1158        xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
     1159      addToMap(*current_input,(char*)cur->name,(char*)val);
     1160      cur=cur->next;
     1161      xmlFree(val);
     1162      while(cur!=NULL && cur->type != XML_ELEMENT_NODE)
     1163        cur=cur->next;
     1164    }
     1165  }
    11041166}
    11051167
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