Changeset 867 for branches


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.

Location:
branches/prototype-v0/zoo-project/zoo-kernel
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/configure.ac

    r839 r867  
    112112#============================================================================
    113113
    114 AC_ARG_WITH([gettext],
    115     [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])],
    116     [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"])
    117 GETTEXT_CFLAGS="-I$GETTEXT_DIR/include"
    118 GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl"
    119 CFLAGS_SAVE="$CFLAGS"
    120 CFLAGS="$GETTEXT_CFLAGS"
    121 LIBS_SAVE="$LIBS"
    122 LIBS="$GETTEXT_LDFLAGS"
    123 AM_GNU_GETTEXT([external], [], [])
    124 AC_CHECK_LIB(intl,
    125                         [dgettext], [] , [AC_MSG_ERROR([could not find $i function in gettext library])])
     114#AC_ARG_WITH([gettext],
     115#    [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])],
     116#    [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"])
     117#GETTEXT_CFLAGS="-I$GETTEXT_DIR/include"
     118#GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl"
     119#CFLAGS_SAVE="$CFLAGS"
     120#CFLAGS="$GETTEXT_CFLAGS"
     121#LIBS_SAVE="$LIBS"
     122#LIBS="$GETTEXT_LDFLAGS"
     123#AM_GNU_GETTEXT([external], [], [])
     124#AC_CHECK_LIB(intl,
     125#                       [dgettext], [] , [AC_MSG_ERROR([could not find $i function in gettext library])])
    126126AC_SUBST([GETTEXT_CFLAGS])
    127127AC_SUBST([GETTEXT_LDFLAGS])
  • 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
  • branches/prototype-v0/zoo-project/zoo-kernel/request_parser.h

    r854 r867  
    4444  int kvpParseOutputs(maps**,map *,maps**);
    4545  int xmlParseInputs(maps**,service*,maps**,xmlDocPtr,xmlNodeSet*,HINTERNET*);
     46  int xmlParseBoundingBox(maps** main_conf,map** current_input,xmlDocPtr doc);
    4647  int xmlParseOutputs(maps**,map**,maps**,xmlDocPtr,xmlNodePtr,bool);
    4748  int xmlParseRequest(maps**,const char*,map**,service*,maps**,maps**,HINTERNET*);
  • branches/prototype-v0/zoo-project/zoo-kernel/response_print.c

    r862 r867  
    26232623  if(tmpSess!=NULL){
    26242624    map *_tmp=getMapFromMaps(m,"lenv","cookie");
     2625    maps *tmps=getMaps(m,"senv");
    26252626    char* sessId=NULL;
    26262627    if(_tmp!=NULL){
    26272628      printf("Set-Cookie: %s; HttpOnly\r\n",_tmp->value);
     2629      map *_tmp1=getMapFromMaps(m,"senv","ecookie_length");
     2630      if(_tmp1!=NULL){
     2631        int len=atoi(_tmp1->value);
     2632        int cnt=0;
     2633        for(cnt=0;cnt<len;cnt++){
     2634          map* _tmp2=getMapArray(tmps->content,"ecookie",cnt);
     2635          if(_tmp2!=NULL)
     2636            printf("Set-Cookie: %s; HttpOnly\r\n",_tmp->value);
     2637        }
     2638      }
    26282639      printf("P3P: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"\r\n");
    26292640      char session_file_path[100];
  • branches/prototype-v0/zoo-project/zoo-kernel/service_internal_ms.c

    r865 r867  
    8181 */
    8282int getPublishedId(maps* elem){
    83   map* myIndex=getMap(elem->content,"published_id");
    84   if(myIndex!=NULL){
    85     return atoi(myIndex->value);
     83  if(elem!=NULL && elem->content!=NULL){
     84    map* myIndex=getMap(elem->content,"published_id");
     85    if(myIndex!=NULL){
     86      return atoi(myIndex->value);
     87    }
    8688  }
    8789  return 0;
    8890}
     91
    8992/**
    9093 * Add width and height keys to an output maps containing the maximum width
     
    243246  else
    244247    sprintf(layers,options[proto][3],layerName->value);
    245  
     248
    246249  if(format==NULL || width==NULL || height==NULL || extent==NULL){
    247250    char tmpStr[1024];
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