Changeset 627 for trunk/zoo-project
- Timestamp:
- Apr 11, 2015, 2:40:05 AM (10 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/request_parser.c
r626 r627 275 275 } 276 276 free (tmpx2); 277 addIntToMap (tmpmaps->content, "Order", hInternet->nb); 277 278 addToMap (tmpmaps->content, "Reference", tmpv1 + 1); 278 279 } … … 540 541 if (l == 4 ) 541 542 { 542 addToMap (tmpmaps->content, "Reference", (char*) val);543 543 if ((ltmp==NULL || strncmp (ltmp->value, "POST",4) != 0)) 544 544 { … … 553 553 } 554 554 } 555 addToMap (tmpmaps->content, "Reference", (char*) val); 555 556 } 556 557 } … … 668 669 INTERNET_FLAG_NO_CACHE_WRITE, 669 670 0); 671 addIntToMap (tmpmaps->content, "Order", hInternet->nb); 670 672 } 671 673 xmlFree (btmps); … … 737 739 INTERNET_FLAG_NO_CACHE_WRITE, 738 740 0); 741 addIntToMap (tmpmaps->content, "Order", hInternet->nb); 739 742 } 740 743 free (tmp); -
trunk/zoo-project/zoo-kernel/service.h
r623 r627 637 637 638 638 /** 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 /** 639 664 * Add a key and a binary value to an existing map. 640 665 * … … 1010 1035 } 1011 1036 1012 char *tmpV[1 1]={1037 char *tmpV[12]={ 1013 1038 (char*)"size", 1014 1039 (char*)"value", 1015 1040 (char*)"uom", 1016 1041 (char*)"Reference", 1042 (char*)"Order", 1017 1043 (char*)"cache_file", 1018 1044 (char*)"fmimeType", … … 1026 1052 addToMap(_cursor->content,"length",tmpLen); 1027 1053 int i=0; 1028 for(i=0;i<1 1;i++){1054 for(i=0;i<12;i++){ 1029 1055 map* tmpVI=getMap(tmp->content,tmpV[i]); 1030 1056 if(tmpVI!=NULL){ -
trunk/zoo-project/zoo-kernel/service_internal.c
r624 r627 3594 3594 map* tmp1; 3595 3595 int index=0; 3596 char sindex[5]; 3596 3597 while(content!=NULL){ 3597 3598 … … 3613 3614 char icname[14]; 3614 3615 char xname[16]; 3616 char oname[12]; 3615 3617 if(index>0) 3616 3618 sprintf(vname1,"value_%d",index); … … 3626 3628 sprintf(icname,"isCached_%d",i); 3627 3629 sprintf(xname,"Reference_%d",i); 3630 sprintf(oname,"Order_%d",i); 3628 3631 }else{ 3629 3632 sprintf(cname,"cache_file"); … … 3633 3636 sprintf(icname,"isCached"); 3634 3637 sprintf(xname,"Reference"); 3638 sprintf(oname,"Order"); 3635 3639 } 3636 3640 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){ 3639 3644 3640 3645 if(getMap(content->content,icname)==NULL){
Note: See TracChangeset
for help on using the changeset viewer.