Changeset 490 for trunk/zoo-project/zoo-kernel/zoo_service_loader.c
- Timestamp:
- Jun 27, 2014, 1:14:39 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r488 r490 221 221 sprintf(prefix,"%s.",dp->d_name); 222 222 223 map* tmpMap=getMapFromMaps(m,"lenv",tmp1);223 //map* tmpMap=getMapFromMaps(m,"lenv",tmp1); 224 224 225 225 int res; … … 467 467 fprintf(stderr,"Function %s error %s\n",r_inputs->value,errstr); 468 468 #endif 469 *eres=-1; 469 470 return; 470 471 } … … 661 662 #endif 662 663 663 int runRequest(map* request_inputs)664 int runRequest(map** inputs) 664 665 { 665 666 666 667 #ifndef USE_GDB 667 668 (void) signal(SIGSEGV,sig_handler); … … 674 675 675 676 map* r_inputs=NULL; 677 map* request_inputs=*inputs; 676 678 maps* m=NULL; 677 678 679 char* REQUEST=NULL; 679 680 /** … … 788 789 if(request_inputs==NULL || r_inputs==NULL){ 789 790 errorException(m, _("Parameter <request> was not specified"),"MissingParameterValue","request"); 790 freeMap(&request_inputs); 791 free(request_inputs); 791 if(count(request_inputs)==1){ 792 freeMap(&request_inputs); 793 free(request_inputs); 794 } 792 795 freeMaps(&m); 793 796 free(m); … … 871 874 872 875 if(strncasecmp(REQUEST,"GetCapabilities",15)==0){ 873 struct dirent *dp;874 876 #ifdef DEBUG 875 877 dumpMap(r_inputs); … … 1622 1624 #endif 1623 1625 if(hai==0){ 1624 key=(char*)malloc((1+strlen((char*)val))*sizeof(char)); 1625 snprintf(key,1+strlen((char*)val),"%s",(char*)val); 1626 key=zStrdup((char*)val); 1626 1627 }else{ 1627 has=(char*)malloc(( 3+strlen((char*)val)+strlen(key))*sizeof(char));1628 has=(char*)malloc((4+xmlStrlen(val)+strlen(key))*sizeof(char)); 1628 1629 if(has == NULL){ 1629 1630 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1630 1631 } 1631 snprintf(has,(3+strlen((char*)val)+strlen(key)),"%s: %s",key,(char*)val); 1632 snprintf(has,(3+xmlStrlen(val)+strlen(key)),"%s: %s",key,(char*)val); 1633 free(key); 1632 1634 #ifdef POST_DEBUG 1633 1635 fprintf(stderr,"%s\n",has); 1634 1636 #endif 1635 1637 } 1638 xmlFree(val); 1636 1639 } 1637 1640 hInternetP.header=curl_slist_append(hInternetP.header, has); … … 1647 1650 fprintf(stderr,"Body part found !!!\n",(char*)cur3->content); 1648 1651 #endif 1649 char *tmp= new char[cgiContentLength];1652 char *tmp=(char*)malloc(cgiContentLength+1*sizeof(char)); 1650 1653 memset(tmp,0,cgiContentLength); 1651 1654 xmlNodePtr cur4=cur3->children; … … 1664 1667 if(btmps!=NULL) 1665 1668 sprintf(tmp,"%s",(char*)btmps); 1669 xmlFree(btmps); 1670 cur4=cur4->next; 1666 1671 xmlFreeDoc(bdoc); 1667 cur4=cur4->next;1668 1672 } 1669 1673 map *btmp=getMap(tmpmaps->content,"href"); … … 1686 1690 curl_slist_free_all(hInternetP.header); 1687 1691 addToMap(tmpmaps->content,"value",tmpContent); 1692 free(tmpContent); 1688 1693 #ifdef POST_DEBUG 1689 1694 fprintf(stderr,"DL CONTENT : (%s)\n",tmpContent); 1690 #endif 1695 #endif 1691 1696 } 1697 free(tmp); 1692 1698 } 1693 1699 else … … 1842 1848 sprintf(size,"%d",buffersize); 1843 1849 addToMap(tmpmaps->content,"size",size); 1850 xmlFreeDoc(doc1); 1844 1851 } 1845 1852 addToMap(tmpmaps->content,"value",(char*)mv); … … 2137 2144 } 2138 2145 xmlXPathFreeObject(tmpsptr); 2146 xmlFreeDoc(doc); 2139 2147 xmlCleanupParser(); 2140 2148 } … … 2168 2176 char tmps[1024]; 2169 2177 map* tmpe=createMap("code","FileSizeExceeded"); 2170 snprintf(tmps,1024,_("The <%s> parameter has a limited size (%sMB) defined in ZOO ServicesProvider configuration file but the reference you provided exceed this limitation (% dMB), please correct your query or the ZOO Configuration file."),ptr->name,tmp1->value,i);2178 snprintf(tmps,1024,_("The <%s> parameter has a limited size (%sMB) defined in ZOO ServicesProvider configuration file but the reference you provided exceed this limitation (%fMB), please correct your query or the ZOO Configuration file."),ptr->name,tmp1->value,i); 2171 2179 addToMap(tmpe,"locator",ptr->name); 2172 2180 addToMap(tmpe,"text",tmps); … … 2230 2238 cgiFilePtr file; 2231 2239 int targetFile; 2232 mode_t mode;2233 2240 char storageNameOnServer[2048]; 2234 2241 char fileNameOnServer[64]; … … 2259 2266 fprintf(stderr,"fileNameOnServer: %s\n",fileNameOnServer); 2260 2267 #endif 2261 mode=S_IRWXU|S_IRGRP|S_IROTH;2262 2268 targetFile = open (storageNameOnServer,O_RDWR|O_CREAT|O_TRUNC,S_IRWXU|S_IRGRP|S_IROTH); 2263 2269 if(targetFile<0){ … … 2408 2414 char *tcook=zStrdup(cgiCookie); 2409 2415 char *tmp=NULL; 2410 int hasVal=-1;2411 2416 map* testing=getMapFromMaps(m,"main","cookiePrefix"); 2412 2417 if(testing==NULL){ … … 2415 2420 tmp=(char*)malloc((strlen(testing->value)+2)*sizeof(char)); 2416 2421 sprintf(tmp,"%s=",testing->value); 2417 hasVal=1;2418 2422 } 2419 2423 if(strstr(cgiCookie,";")!=NULL){ … … 2585 2589 (void) signal(SIGABRT,donothing); 2586 2590 #endif 2587 2588 2591 if(((int)getpid())!=cpid || cgiSid!=NULL){ 2589 2592 fclose(stdout); … … 2608 2611 unlink(fbkp1); 2609 2612 free(fbkp1); 2613 free(tmps1); 2610 2614 } 2611 2615
Note: See TracChangeset
for help on using the changeset viewer.