Changeset 92 for trunk/zoo-kernel
- Timestamp:
- Jan 27, 2011, 11:47:22 PM (14 years ago)
- Location:
- trunk/zoo-kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service.h
r60 r92 103 103 } 104 104 105 static void dumpMapToFile(map* t,FILE* file){ 106 map* tmp=t; 107 while(tmp!=NULL){ 108 fprintf(file,"%s = %s\n",t->name,t->value); 109 tmp=tmp->next; 110 } 111 } 112 105 113 static void dumpMaps(maps* m){ 106 114 maps* tmp=m; … … 109 117 dumpMap(tmp->content); 110 118 tmp=tmp->next; 119 } 120 } 121 122 static void dumpMapsToFile(maps* m,FILE* file){ 123 maps* tmp=m; 124 if(tmp!=NULL){ 125 fprintf(file,"[%s]\n",tmp->name); 126 dumpMapToFile(tmp->content,file); 111 127 } 112 128 } -
trunk/zoo-kernel/service_conf.y
r76 r92 650 650 else 651 651 addToElements(&my_service->outputs,current_element); 652 #ifdef DEBUG_SERVICE_CONF 652 653 fprintf(stderr,"ADD TO OUTPUTS Elements\n"); 653 654 dupElements(current_element); 654 655 #endif 655 656 freeElements(¤t_element); 656 657 free(current_element); -
trunk/zoo-kernel/service_internal.c
r88 r92 1576 1576 asRaw=1; 1577 1577 1578 map *_tmp=getMapFromMaps(m,"lenv","cookie"); 1579 if(_tmp!=NULL){ 1580 printf("Set-Cookie: %s\r\n",_tmp->value); 1581 maps *tmpSess=getMaps(m,"senv"); 1582 if(tmpSess!=NULL){ 1583 char session_file_path[1024]; 1584 map *tmpPath=getMapFromMaps(m,"main","sessPath"); 1585 if(tmpPath==NULL) 1586 tmpPath=getMapFromMaps(m,"main","tmpPath"); 1587 char *tmp1=strtok(_tmp->value,";"); 1588 if(tmp1!=NULL) 1589 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(tmp1,"=")+1); 1590 else 1591 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(_tmp->value,"=")+1); 1592 FILE* file=fopen(session_file_path,"w"); 1593 dumpMapsToFile(tmpSess,file); 1594 fclose(file); 1595 } 1596 } 1578 1597 if(asRaw==0){ 1579 1598 #ifdef DEBUG … … 1861 1880 iotype* tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name, 1862 1881 tmpMaps->content); 1863 addToMap(tmpMaps->content,"inRequest","true");1864 1882 if(type==0) { 1865 1883 /** … … 1924 1942 } 1925 1943 } 1944 if(tmpMaps->content==NULL) 1945 tmpMaps->content=createMap("inRequest","true"); 1946 else 1947 addToMap(tmpMaps->content,"inRequest","true"); 1926 1948 } 1927 1949 tmpInputs=tmpInputs->next; -
trunk/zoo-kernel/zoo_service_loader.c
r88 r92 1622 1622 * Ensure that each requested arguments are present in the request 1623 1623 * DataInputs and ResponseDocument / RawDataOutput 1624 */ 1624 */ 1625 1625 char *dfv=addDefaultValues(&request_input_real_format,s1->inputs,m,0); 1626 1626 if(strcmp(dfv,"")!=0){ … … 1739 1739 _tmpMaps->next=NULL; 1740 1740 addToMap(_tmpMaps->content,"status","0"); 1741 if(cgiCookie!=NULL && strlen(cgiCookie)>0){ 1742 addToMap(_tmpMaps->content,"sessid",strstr(cgiCookie,"=")+1); 1743 char session_file_path[1024]; 1744 map *tmpPath=getMapFromMaps(m,"main","sessPath"); 1745 if(tmpPath==NULL) 1746 tmpPath=getMapFromMaps(m,"main","tmpPath"); 1747 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(cgiCookie,"=")+1); 1748 maps *tmpSess=(maps*)calloc(1,MAPS_SIZE); 1749 struct stat file_status; 1750 int istat = stat(session_file_path, &file_status); 1751 if(istat==0){ 1752 conf_read(session_file_path,tmpSess); 1753 dumpMaps(tmpSess); 1754 addMapsToMaps(&m,tmpSess); 1755 freeMaps(&tmpSess); 1756 } 1757 free(tmpSess); 1758 } 1741 1759 addMapsToMaps(&m,_tmpMaps); 1742 1760 freeMaps(&_tmpMaps);
Note: See TracChangeset
for help on using the changeset viewer.