Changeset 514 for trunk/zoo-project
- Timestamp:
- Oct 27, 2014, 4:46:05 PM (10 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/configure.ac
r466 r514 446 446 then 447 447 JAVA_LDFLAGS="-framework JavaVM" 448 JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10. 8.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"448 JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" 449 449 else 450 450 if test -d "$JDKHOME/jre/lib/i386"; -
trunk/zoo-project/zoo-kernel/service.h
r508 r514 41 41 #define zWrite _write 42 42 #define zSleep Sleep 43 #include <sys/timeb.h> 44 struct ztimeval { 45 long tv_sec; /* seconds */ 46 long tv_usec; /* and microseconds */ 47 }; 48 void zGettimeofday(struct mstimeval* tp, void* tzp) 49 { 50 struct _timeb theTime; 51 _ftime(&theTime); 52 tp->tv_sec = theTime.time; 53 tp->tv_usec = theTime.millitm * 1000; 54 } 43 55 #else 44 56 #define zStrdup strdup … … 47 59 #define zWrite write 48 60 #define zSleep sleep 61 #define zGettimeofday gettimeofday 62 #define ztimeval timeval 49 63 #endif 50 64 -
trunk/zoo-project/zoo-kernel/service_internal.c
r510 r514 125 125 126 126 char* getKeyValue(maps* conf){ 127 if(conf==NULL) 128 return "700666"; 127 129 map *tmpMap=getMapFromMaps(conf,"lenv","lid"); 128 130 if(tmpMap==NULL) 129 tmpMap=getMapFromMaps(conf,"lenv"," sid");131 tmpMap=getMapFromMaps(conf,"lenv","usid"); 130 132 char* key="-1"; 131 133 if(tmpMap!=NULL){ … … 202 204 char *s=NULL; 203 205 map *tmpMap1; 204 map *tmpMap=getMapFromMaps(conf,"lenv"," sid");206 map *tmpMap=getMapFromMaps(conf,"lenv","usid"); 205 207 semid lockid=getShmLockId(conf,1); 206 208 if(lockid==NULL){ … … 337 339 338 340 int getKeyValue(maps* conf){ 341 if(conf==NULL) 342 return 700666; 339 343 map *tmpMap=getMapFromMaps(conf,"lenv","lid"); 340 344 if(tmpMap==NULL) 341 tmpMap=getMapFromMaps(conf,"lenv"," sid");345 tmpMap=getMapFromMaps(conf,"lenv","usid"); 342 346 int key=-1; 343 347 if(tmpMap!=NULL) … … 449 453 void *shm; 450 454 struct shmid_ds shmids; 451 map *tmpMap=getMapFromMaps(conf,"lenv"," sid");455 map *tmpMap=getMapFromMaps(conf,"lenv","usid"); 452 456 if(tmpMap!=NULL){ 453 457 key=atoi(tmpMap->value); … … 531 535 #endif 532 536 }else{ 533 return (char*)shm; 537 char *ret=strdup((char*)shm); 538 shmdt((void *)shm); 539 return ret; 534 540 } 535 541 } … … 1718 1724 map* tmpm=getMap(tmp_maps->content,"rewriteUrl"); 1719 1725 map *tmp_lenv=NULL; 1720 tmp_lenv=getMapFromMaps(m,"lenv"," sid");1726 tmp_lenv=getMapFromMaps(m,"lenv","usid"); 1721 1727 if(tmp_lenv==NULL) 1722 1728 sprintf(currentSid,"%i",pid); … … 1735 1741 } 1736 1742 }else{ 1737 map* tmpm2=getMap(tmp_maps->content,"tmpUrl"); 1743 int lpid; 1744 map* tmpm2=getMapFromMaps(m,"lenv","usid"); 1745 lpid=atoi(tmpm2->value); 1746 tmpm2=getMap(tmp_maps->content,"tmpUrl"); 1738 1747 if(tmpm1!=NULL && tmpm2!=NULL){ 1739 1748 if( strncasecmp( tmpm2->value, "http://", 7) == 0 || 1740 1749 strncasecmp( tmpm2->value, "https://", 8 ) == 0 ){ 1741 sprintf(url,"%s/%s_%i.xml",tmpm2->value,service, pid);1750 sprintf(url,"%s/%s_%i.xml",tmpm2->value,service,lpid); 1742 1751 }else 1743 sprintf(url,"%s/%s/%s_%i.xml",tmpm1->value,tmpm2->value,service, pid);1752 sprintf(url,"%s/%s/%s_%i.xml",tmpm1->value,tmpm2->value,service,lpid); 1744 1753 } 1745 1754 } 1746 1755 if(tmpm1!=NULL) 1747 1756 sprintf(tmp,"%s",tmpm1->value); 1757 int lpid; 1758 tmpm1=getMapFromMaps(m,"lenv","usid"); 1759 lpid=atoi(tmpm1->value); 1748 1760 tmpm1=getMapFromMaps(m,"main","TmpPath"); 1749 sprintf(stored_path,"%s/%s_%i.xml",tmpm1->value,service, pid);1761 sprintf(stored_path,"%s/%s_%i.xml",tmpm1->value,service,lpid); 1750 1762 } 1751 1763 -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r510 r514 2504 2504 _tmpMaps->name=zStrdup("lenv"); 2505 2505 char tmpBuff[100]; 2506 sprintf(tmpBuff,"%i",(cpid+(int)time(NULL))); 2506 int lid=getShmLockId(NULL,1); 2507 lockShm(lid); 2508 struct ztimeval tp; 2509 if(zGettimeofday(&tp,NULL)==0) 2510 sprintf(tmpBuff,"%i",(cpid+((int)tp.tv_sec+(int)tp.tv_usec))); 2511 else 2512 sprintf(tmpBuff,"%i",(cpid+(int)time(NULL))); 2513 unlockShm(lid); 2514 removeShmLock(NULL,1); 2507 2515 _tmpMaps->content=createMap("usid",tmpBuff); 2508 2516 _tmpMaps->next=NULL; … … 2575 2583 freeMaps(&_tmpMaps); 2576 2584 free(_tmpMaps); 2577 2585 2578 2586 #ifdef DEBUG 2579 2587 dumpMap(request_inputs); … … 2634 2642 zSleep(1); 2635 2643 #endif 2644 r_inputs=getMapFromMaps(m,"lenv","usid"); 2645 int cpid=atoi(r_inputs->value); 2636 2646 r_inputs=getMapFromMaps(m,"main","tmpPath"); 2637 2647 map* r_inputs1=getMap(s1->content,"ServiceProvider");
Note: See TracChangeset
for help on using the changeset viewer.