Changeset 364 for trunk/zoo-project/zoo-kernel/zoo_service_loader.c
- Timestamp:
- Sep 29, 2012, 3:59:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r362 r364 78 78 #include <windows.h> 79 79 #include <direct.h> 80 #include <sys/types.h> 81 #include <sys/stat.h> 82 #include <unistd.h> 83 #define pid_t int; 80 84 #endif 81 85 #include <fcntl.h> 82 86 #include <time.h> 83 87 #include <stdarg.h> 88 89 #ifdef WIN32 90 extern "C" { 91 __declspec(dllexport) char *strcasestr(char const *a, char const *b) { 92 char *x=_strdup(a); 93 char *y=_strdup(b); 94 95 x=_strlwr(x); 96 y=_strlwr(y); 97 char *pos = strstr(x, y); 98 char *ret = pos == NULL ? NULL : (char *)(a + (pos-x)); 99 free(x); 100 free(y); 101 return ret; 102 } 103 } 104 #endif 84 105 85 106 #define _(String) dgettext ("zoo-kernel",String) … … 218 239 fflush(stderr); 219 240 #endif 220 if(str ncasecmp(r_inputs->value,"C",1)==0){241 if(strlen(r_inputs->value)==1 && strncasecmp(r_inputs->value,"C",1)==0){ 221 242 r_inputs=getMap(request_inputs,"metapath"); 222 243 if(r_inputs!=NULL) … … 402 423 } 403 424 *myMap=m; 404 #ifndef WIN32405 425 *ioutputs=request_output_real_format; 406 #endif407 426 } 408 427 … … 521 540 bindtextdomain ("zoo-kernel","/usr/share/locale/"); 522 541 bindtextdomain ("zoo-services","/usr/share/locale/"); 523 542 543 /** 544 * Manage our own error log file (usefull to separate standard apache debug 545 * messages from the ZOO-Kernel ones but also for IIS users to avoid wrong 546 * headers messages returned by the CGI due to wrong redirection of stderr) 547 */ 548 FILE * fstde=NULL; 549 map* fstdem=getMapFromMaps(m,"main","logPath"); 550 if(fstdem!=NULL) 551 fstde = freopen(fstdem->value, "a+", stderr) ; 552 524 553 if((r_inputs=getMap(request_inputs,"language"))!=NULL){ 525 554 char *tmp=strdup(r_inputs->value); … … 1829 1858 return 1; 1830 1859 } 1831 1832 1860 maps* tmpReqI=request_input_real_format; 1833 1861 while(tmpReqI!=NULL){ … … 1842 1870 char fileNameOnServer[64]; 1843 1871 char contentType[1024]; 1844 char buffer[ BufferLen];1872 char buffer[1024]; 1845 1873 char *tmpStr=NULL; 1846 1874 int size; … … 1866 1894 fprintf(stderr,"fileNameOnServer: %s\n",fileNameOnServer); 1867 1895 mode=S_IRWXU|S_IRGRP|S_IROTH; 1868 targetFile = open (storageNameOnServer,O_RDWR|O_CREAT|O_TRUNC, mode);1896 targetFile = open (storageNameOnServer,O_RDWR|O_CREAT|O_TRUNC,S_IRWXU|S_IRGRP|S_IROTH); 1869 1897 if(targetFile<0){ 1870 1898 fprintf(stderr,"could not create the new file,%s\n",fileNameOnServer); … … 1912 1940 #ifdef DEBUG 1913 1941 fflush(stderr); 1914 fprintf(stderr,"setting variable... %s\n", 1942 fprintf(stderr,"setting variable... %s\n",( 1915 1943 #endif 1916 1944 SetEnvironmentVariable(mapcs->name,mapcs->value) 1917 1945 #ifdef DEBUG 1918 ? "OK" : "FAILED");1946 ==0)? "OK" : "FAILED"); 1919 1947 #else 1920 1948 ; 1921 1949 #endif 1950 char* toto=(char*)malloc((strlen(mapcs->name)+strlen(mapcs->value)+2)*sizeof(char)); 1951 sprintf(toto,"%s=%s",mapcs->name,mapcs->value); 1952 putenv(toto); 1922 1953 #ifdef DEBUG 1923 1954 fflush(stderr); … … 2036 2067 addToMap(request_inputs,"status","true"); 2037 2068 status=getMap(request_inputs,"status"); 2038 fprintf(stderr,"cgiSID : %s",cgiSid);2069 //fprintf(stderr,"cgiSID : %s",cgiSid); 2039 2070 } 2040 2071 #endif 2041 2072 if(status!=NULL) 2042 2073 if(strcasecmp(status->value,"false")==0) 2043 status=NULL ;2074 status=NULLMAP; 2044 2075 if(status==NULLMAP){ 2045 2076 loadServiceAndRun(&m,s1,request_inputs,&request_input_real_format,&request_output_real_format,&eres); 2046 2077 } 2047 2078 else{ 2048 pid_t pid;2079 int pid; 2049 2080 #ifdef DEBUG 2050 2081 fprintf(stderr,"\nPID : %d\n",cpid); … … 2171 2202 return 0; 2172 2203 } 2204
Note: See TracChangeset
for help on using the changeset viewer.