Changeset 554 for trunk/zoo-project
- Timestamp:
- Feb 5, 2015, 7:17:31 PM (10 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service.h
r550 r554 46 46 long tv_usec; /* and microseconds */ 47 47 }; 48 void zGettimeofday(struct mstimeval* tp, void* tzp)48 static int zGettimeofday(struct ztimeval* tp, void* tzp) 49 49 { 50 if (tp == 0) { 51 return -1; 52 } 53 50 54 struct _timeb theTime; 51 55 _ftime(&theTime); 52 56 tp->tv_sec = theTime.time; 53 57 tp->tv_usec = theTime.millitm * 1000; 58 59 return 0; // The gettimeofday() function shall return 0 on success 54 60 } 55 61 #else -
trunk/zoo-project/zoo-kernel/service_internal.c
r550 r554 124 124 #define SHMEMSIZE 4096 125 125 126 char* getKeyValue(maps* conf){ 127 if(conf==NULL) 128 return "700666"; 126 size_t getKeyValue(maps* conf, char* key, size_t length){ 127 128 if(conf==NULL) { 129 strncpy(key, "700666", length); 130 return strlen(key); 131 } 132 129 133 map *tmpMap=getMapFromMaps(conf,"lenv","lid"); 130 134 if(tmpMap==NULL) 131 132 char* key="-1"; 135 tmpMap=getMapFromMaps(conf,"lenv","usid"); 136 133 137 if(tmpMap!=NULL){ 134 key=(char*)malloc((strlen(tmpMap->value)+9)*sizeof(char)); 135 sprintf(key,"zoo_sem_%s",tmpMap->value);136 }137 return key; 138 }139 140 138 snprintf(key, length, "zoo_sem_%s", tmpMap->value); 139 } 140 else { 141 strncpy(key, "-1", length); 142 } 143 return strlen(key); 144 } 141 145 semid getShmLockId(maps* conf, int nsems){ 142 146 semid sem_id; 143 char* key=getKeyValue(conf); 147 char key[MAX_PATH]; 148 getKeyValue(conf, key, MAX_PATH); 144 149 145 150 sem_id = CreateSemaphore( NULL, nsems, nsems+1, key); 146 151 if(sem_id==NULL){ 147 if(strncmp(key,"-1",2)!=0) 148 free(key); 152 149 153 #ifdef DEBUG 150 154 fprintf(stderr,"Semaphore failed to create ! %s\n",GetLastError()); … … 155 159 fprintf(stderr,"%s Accessed !\n",key); 156 160 #endif 157 if(strncmp(key,"-1",2)!=0) 158 free(key); 161 159 162 return sem_id; 160 163 } … … 3335 3338 mimeType=strdup("none"); 3336 3339 else 3337 mimeType=strdup((char*)hInternet->ihandle[index].mimeType);3340 mimeType=strdup(hInternet->ihandle[index].mimeType); 3338 3341 3339 3342 map* tmpMap=getMapOrFill(&content->content,vname,""); -
trunk/zoo-project/zoo-kernel/ulinet.h
r507 r554 80 80 size_t size; 81 81 unsigned char *pabyData; 82 unsignedchar *mimeType;82 char *mimeType; 83 83 int hasCacheFile; 84 84 int nDataLen; -
trunk/zoo-project/zoo-kernel/zoo_loader.c
r516 r554 37 37 #include <unistd.h> 38 38 #include "service_internal.h" 39 40 39 41 #ifdef WIN32 40 42 #include "windows.h" -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r550 r554 781 781 fprintf (stderr, "REQUEST IS : %s \n", tmp); 782 782 #endif 783 784 map* usid = getMapFromMaps (m, "lenv", "usid"); 785 if (usid != NULL && usid->value != NULL) { 786 SetEnvironmentVariable("USID", TEXT (usid->value)); 787 } 788 783 789 SetEnvironmentVariable ("CGISID", TEXT (sid->value)); 784 790 SetEnvironmentVariable ("QUERY_STRING", TEXT (tmpq)); … … 824 830 825 831 #ifndef USE_GDB 832 #ifndef WIN32 826 833 signal (SIGCHLD, SIG_IGN); 834 #endif 827 835 signal (SIGSEGV, sig_handler); 828 836 signal (SIGTERM, sig_handler); … … 3203 3211 _tmpMaps->name = zStrdup ("lenv"); 3204 3212 char tmpBuff[100]; 3205 intlid = getShmLockId (NULL, 1);3213 semid lid = getShmLockId (NULL, 1); 3206 3214 lockShm (lid); 3207 3215 struct ztimeval tp; … … 3307 3315 if (getenv ("CGISID") != NULL) 3308 3316 addToMap (request_inputs, "cgiSid", getenv ("CGISID")); 3317 3318 char* usidp; 3319 if ( (usidp = getenv("USID")) != NULL ) { 3320 setMapInMaps (m, "lenv", "usid", usidp); 3321 } 3322 3309 3323 map *test1 = getMap (request_inputs, "cgiSid"); 3310 3324 if (test1 != NULL)
Note: See TracChangeset
for help on using the changeset viewer.