Changeset 788 for trunk/zoo-project
- Timestamp:
- Oct 12, 2016, 3:47:26 PM (8 years ago)
- Location:
- trunk/zoo-project
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/makefile.vc
r787 r788 88 88 service_internal_php.obj: service_internal_php.c service_internal_php.h service.h 89 89 $(CPP) /c $(CFLAGS) $(PHP_CFLAGS) service_internal_php.c 90 91 service_internal_php7.obj: service_internal_php7.c service_internal_php.h service.h 92 $(CPP) /c $(CFLAGS) $(PHP_CFLAGS) service_internal_php7.c 90 93 91 94 $(LIBZOO_SERVICE): service_internal.obj service.obj sqlapi.obj -
trunk/zoo-project/zoo-kernel/nmake.opt
r757 r788 10 10 #PHP_DIR=C:\php-sdk\phpdev\vc12\x86\php-5.5.10-src 11 11 #PHP_LIB=$(PHP_DIR)\Release_TS\php5embed.lib 12 #PHP7_DIR=C:\php-sdk\phpdev\vc14\x64\php-7.0.9-src 12 13 13 14 #!IF DEFINED(MS_DIR) … … 56 57 PHP_FILE=service_internal_php.obj 57 58 PHP_CFLAGS=-I$(PHP_SRC) -I$(PHP_SRC)\Zend -I$(PHP_SRC)\TSRM /DPHP_WIN32 /DZEND_WIN32 /DWIN32 /D_USE_32BIT_TIME_T /DZTS /DUSE_PHP 59 !ELSE IFDEF PHP7_DIR 60 PHP_LIB=$(PHP7_DIR)\x64\Release_TS\php7embed.lib 61 PHP_CURL_LIB= 62 PHP_LDFLAGS=$(PHP_LIB) $(PHP_CURL_LIB) 63 PHP_FILE=service_internal_php7.obj 64 PHP_CFLAGS=-I$(PHP7_DIR) -I$(PHP7_DIR)\Zend -I$(PHP7_DIR)\TSRM /DPHP_WIN32 /DZEND_WIN32 /DWIN32 /DZTS /DUSE_PHP # /D_USE_32BIT_TIME_T 58 65 !ENDIF 59 66 -
trunk/zoo-project/zoo-kernel/response_print.c
r785 r788 2347 2347 void outputResponse(service* s,maps* request_inputs,maps* request_outputs, 2348 2348 map* request_inputs1,int cpid,maps* m,int res){ 2349 2349 2350 #ifdef DEBUG 2350 2351 dumpMaps(request_inputs); … … 2358 2359 map* version=getMapFromMaps(m,"main","rversion"); 2359 2360 int vid=getVersionId(version->value); 2360 2361 2361 maps* tmpSess=getMaps(m,"senv"); 2362 2362 if(tmpSess!=NULL){ … … 2402 2402 } 2403 2403 } 2404 2404 2405 2405 if(res==SERVICE_FAILED){ 2406 2406 map *lenv; … … 2429 2429 return; 2430 2430 } 2431 2431 2432 2432 map *tmp1=getMapFromMaps(m,"main","tmpPath"); 2433 2433 if(asRaw==0){ -
trunk/zoo-project/zoo-kernel/service.h
r781 r788 143 143 * The memory size to create a map 144 144 */ 145 #define MAP_SIZE (2*sizeof(char*))+sizeof(NULL) 145 //#define MAP_SIZE (2*sizeof(char*))+sizeof(NULL) // knut: size of NULL pointer may be different from regular pointer (platform dependent) 146 #define MAP_SIZE (2*sizeof(char*))+sizeof(map*) 146 147 /** 147 148 * The memory size to create an iotype 148 149 */ 149 #define IOTYPE_SIZE MAP_SIZE+sizeof(NULL) 150 //#define IOTYPE_SIZE MAP_SIZE+sizeof(NULL) 151 #define IOTYPE_SIZE sizeof(map*) + sizeof(iotype*) 150 152 /** 151 153 * The memory size to create a maps 152 154 */ 153 #define MAPS_SIZE (2*sizeof(char*))+sizeof(map*)+MAP_SIZE 155 //#define MAPS_SIZE (2*sizeof(char*))+sizeof(map*)+MAP_SIZE 156 #define MAPS_SIZE sizeof(char*)+sizeof(map*)+sizeof(maps*) 154 157 /** 155 158 * The memory size to create a service 156 159 */ 157 #define SERVICE_SIZE (ELEMENTS_SIZE*2)+(MAP_SIZE*2)+sizeof(char*) 160 //#define SERVICE_SIZE (ELEMENTS_SIZE*2)+(MAP_SIZE*2)+sizeof(char*) 161 #define SERVICE_SIZE sizeof(char*) + 2*sizeof(map*) + 2*sizeof(elements*) 158 162 /** 159 163 * The memory size to create a services 160 164 */ 161 #define SERVICES_SIZE SERVICE_SIZE+sizeof(services*) 165 //#define SERVICES_SIZE SERVICE_SIZE+sizeof(services*) 166 #define SERVICES_SIZE sizeof(service*)+sizeof(services*) 162 167 /** 163 168 * The memory size to create a registry 164 169 */ 165 #define REGISTRY_SIZE SERVICES_SIZE+sizeof(char*) 170 //#define REGISTRY_SIZE SERVICES_SIZE+sizeof(char*) 171 #define REGISTRY_SIZE sizeof(char*)+sizeof(services*)+sizeof(registry*) 166 172 167 173 #define SHMSZ 27 -
trunk/zoo-project/zoo-kernel/service_conf.y
r781 r788 553 553 fprintf(stderr,"processid (%s %d) %s\n",__FILE__,__LINE__,$1); 554 554 #endif 555 if(data==-1){ 556 data=1; 555 // if(data==-1){ 556 // data=1; 557 if(::data==-1){ // knut: add namespace to avoid ambiguous symbol 558 ::data=1; 557 559 if($1!=NULL){ 558 560 char *cen=zStrdup($1); … … 795 797 wait_outputs=-1; 796 798 wait_data=false; 797 data=-1; 799 //data=-1; 800 ::data=-1; // knut: add namespace to avoid ambiguous symbol 798 801 previous_data=1; 799 802 current_data=0; -
trunk/zoo-project/zoo-kernel/service_internal.c
r781 r788 147 147 } 148 148 149 FILE* f0 = fopen (fileName, "r"); 149 //FILE* f0 = fopen (fileName, "r"); 150 // knut: open file in binary mode to avoid conversion of line endings (yielding extra bytes) on Windows platforms 151 FILE* f0 = fopen(fileName, "rb"); 150 152 if(f0!=NULL){ 151 153 fseek (f0, 0, SEEK_END); … … 260 262 */ 261 263 int _updateStatus(maps *conf){ 264 262 265 map* r_inputs = getMapFromMaps (conf, "main", "tmpPath"); 263 266 map* sid = getMapFromMaps (conf, "lenv", "usid"); 267 264 268 char* fbkpid = 265 269 (char *) … … 272 276 strlen(status->value)>0 && strlen(msg->value)>1){ 273 277 semid lockid = NULL; 278 274 279 char* stat=getStatusId(conf,sid->value); 275 280 if(stat!=NULL){ … … 291 296 } 292 297 } 298 293 299 return 0; 294 300 } -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r784 r788 22 22 * THE SOFTWARE. 23 23 */ 24 24 25 25 extern "C" int yylex (); 26 26 extern "C" int crlex (); … … 104 104 extern char **environ; 105 105 #endif 106 106 107 107 108 #ifdef WIN32 … … 668 669 *eres = 669 670 zoo_php_support (&m, request_inputs, s1, &request_input_real_format, 670 &request_output_real_format); 671 &request_output_real_format); 671 672 } 672 673 else … … 890 891 runRequest (map ** inputs) 891 892 { 892 893 893 894 #ifndef USE_GDB 894 895 #ifndef WIN32 … … 940 941 #endif 941 942 #endif 943 942 944 if (conf_read (conf_file, m) == 2) 943 945 { … … 1621 1623 return 0; 1622 1624 } 1623 1624 1625 s1 = NULL; 1625 1626 s1 = (service *) malloc (SERVICE_SIZE); … … 1995 1996 dumpMap (request_inputs); 1996 1997 #endif 1997 1998 1998 int ei = 1; 1999 1999 char *s = … … 2046 2046 } 2047 2047 #endif 2048 2048 2049 char *fbkp, *fbkpid, *fbkpres, *fbkp1, *flog; 2049 2050 FILE *f0, *f1; … … 2068 2069 return -1; 2069 2070 } 2070 2071 2071 loadServiceAndRun (&m, s1, request_inputs, &request_input_real_format, 2072 2072 &request_output_real_format, &eres); … … 2124 2124 (char *) 2125 2125 malloc ((strlen (r_inputs->value) + 2126 strlen (usid->value) + 7) * sizeof (char)); 2126 strlen (usid->value) + 7) * sizeof (char)); 2127 2127 sprintf (fbkpres, "%s/%s.res", r_inputs->value, usid->value); 2128 2128 bmap = (maps *) malloc (MAPS_SIZE); … … 2258 2258 dumpMaps (request_output_real_format); 2259 2259 #endif 2260 2260 2261 if (eres != -1) 2261 2262 outputResponse (s1, request_input_real_format, … … 2263 2264 cpid, m, eres); 2264 2265 fflush (stdout); 2265 2266 2266 2267 /** 2267 2268 * Ensure that if error occurs when freeing memory, no signal will return … … 2277 2278 signal (SIGABRT, donothing); 2278 2279 #endif 2279 2280 2280 2281 if (((int) getpid ()) != cpid || cgiSid != NULL) 2281 2282 { … … 2288 2289 if(dumpBackFinalFile(m,fbkp,fbkp1)<0) 2289 2290 return -1; 2290 2291 2291 unlink (fbkpid); 2292 2292 switch(eres){ … … 2300 2300 setMapInMaps(m,"lenv","fstate",wpsStatus[0]); 2301 2301 break; 2302 } 2302 } 2303 2303 #ifndef RELY_ON_DB 2304 2304 dumpMapsToFile(bmap,fbkpres,1); … … 2313 2313 unhandleStatus (m); 2314 2314 free(fbkpid); 2315 free(fbkpres); 2316 free (flog); 2315 free(fbkpres); 2316 free (flog); 2317 2317 free (fbkp1); 2318 free (tmps1);2318 // free (tmps1); // tmps1 is stack memory and should not be freed 2319 2319 if(cgiSid!=NULL) 2320 2320 free(cgiSid); -
trunk/zoo-project/zoo-services/utils/status/service.c
r777 r788 22 22 * THE SOFTWARE. 23 23 */ 24 24 25 25 26 #include "service.h"
Note: See TracChangeset
for help on using the changeset viewer.