Changeset 627


Ignore:
Timestamp:
Apr 11, 2015, 2:40:05 AM (9 years ago)
Author:
djay
Message:

Fix issue for downloaded inputs which support multiple values.

Location:
trunk/zoo-project/zoo-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/request_parser.c

    r626 r627  
    275275                      }
    276276                    free (tmpx2);
     277                    addIntToMap (tmpmaps->content, "Order", hInternet->nb);
    277278                    addToMap (tmpmaps->content, "Reference", tmpv1 + 1);
    278279                  }
     
    540541                          if (l == 4 )
    541542                            {
    542                               addToMap (tmpmaps->content, "Reference", (char*) val);
    543543                              if ((ltmp==NULL || strncmp (ltmp->value, "POST",4) != 0))
    544544                                {
     
    553553                                    }
    554554                                }
     555                              addToMap (tmpmaps->content, "Reference", (char*) val);
    555556                            }
    556557                        }
     
    668669                                                           INTERNET_FLAG_NO_CACHE_WRITE,
    669670                                                           0);
     671                                          addIntToMap (tmpmaps->content, "Order", hInternet->nb);
    670672                                        }
    671673                                      xmlFree (btmps);
     
    737739                                                       INTERNET_FLAG_NO_CACHE_WRITE,
    738740                                                       0);
     741                                    addIntToMap (tmpmaps->content, "Order", hInternet->nb);
    739742                                  }
    740743                                free (tmp);
  • trunk/zoo-project/zoo-kernel/service.h

    r623 r627  
    637637
    638638  /**
     639   * Add a key and an integer value to an existing map.
     640   *
     641   * @param m the map to add the KVP
     642   * @param n the key to add
     643   * @param v the corresponding value to add
     644   */
     645  static void addIntToMap(map* m,const char* n,const int v){
     646    char svalue[10];
     647    sprintf(svalue,"%d",v);
     648    if(hasKey(m,n)==false){
     649      map* _cursor=m;
     650      while(_cursor->next!=NULL){
     651        _cursor=_cursor->next;
     652      }
     653      _cursor->next=createMap(n,svalue);
     654    }
     655    else{
     656      map *tmp=getMap(m,n);
     657      if(tmp->value!=NULL)
     658        free(tmp->value);
     659      tmp->value=zStrdup(svalue);
     660    }
     661  }
     662
     663  /**
    639664   * Add a key and a binary value to an existing map.
    640665   *
     
    10101035    }
    10111036
    1012     char *tmpV[11]={
     1037    char *tmpV[12]={
    10131038      (char*)"size",
    10141039      (char*)"value",
    10151040      (char*)"uom",
    10161041      (char*)"Reference",
     1042      (char*)"Order",
    10171043      (char*)"cache_file",
    10181044      (char*)"fmimeType",
     
    10261052    addToMap(_cursor->content,"length",tmpLen);
    10271053    int i=0;
    1028     for(i=0;i<11;i++){
     1054    for(i=0;i<12;i++){
    10291055      map* tmpVI=getMap(tmp->content,tmpV[i]);
    10301056      if(tmpVI!=NULL){
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r624 r627  
    35943594    map* tmp1;
    35953595    int index=0;
     3596    char sindex[5];
    35963597    while(content!=NULL){
    35973598     
     
    36133614        char icname[14];
    36143615        char xname[16];
     3616        char oname[12];
    36153617        if(index>0)
    36163618          sprintf(vname1,"value_%d",index);
     
    36263628          sprintf(icname,"isCached_%d",i);
    36273629          sprintf(xname,"Reference_%d",i);
     3630          sprintf(oname,"Order_%d",i);
    36283631        }else{
    36293632          sprintf(cname,"cache_file");
     
    36333636          sprintf(icname,"isCached");
    36343637          sprintf(xname,"Reference");
     3638          sprintf(oname,"Order");
    36353639        }
    36363640
    3637         map* tmap=getMapFromMaps(*m,"orequests",vname1);
    3638         if((tmp1=getMap(content->content,xname))!=NULL /*&& ((tmap!=NULL && strcasecmp(tmap->value,tmp1->value)==0) )*/){
     3641        map* tmap=getMap(content->content,oname);
     3642        sprintf(sindex,"%d",index+1);
     3643        if((tmp1=getMap(content->content,xname))!=NULL && tmap!=NULL && strcasecmp(tmap->value,sindex)==0){
    36393644
    36403645          if(getMap(content->content,icname)==NULL){
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