Changeset 26 for trunk/zoo-kernel/service_internal_js.c
- Timestamp:
- Sep 24, 2010, 5:11:43 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_internal_js.c
r9 r26 23 23 */ 24 24 25 #include "service_internal _js.h"25 #include "service_internal.h" 26 26 27 27 static char dbg[1024]; … … 74 74 if (!JS_DefineFunction(cx, global, "ZOORequest", JSRequest, 4, 0)) 75 75 return 1; 76 if (!JS_DefineFunction(cx, global, "ZOOUpdateStatus", JSUpdateStatus, 2, 0)) 77 return 1; 76 78 77 79 /* Your application code here. This may include JSAPI calls … … 82 84 map* tmpm1=getMap(request,"metapath"); 83 85 map* tmpm2=getMap(s->content,"serviceProvider"); 84 char filename[strlen(tmpm1->value)+strlen(tmpm2->value)+6];85 86 char ntmp[1024]; 86 87 getcwd(ntmp,1024); 88 char filename[strlen(tmpm1->value)+strlen(tmpm2->value)+strlen(ntmp)+2]; 87 89 sprintf(filename,"%s/%s%s",ntmp,tmpm1->value,tmpm2->value); 90 filename[strlen(tmpm1->value)+strlen(tmpm2->value)+strlen(ntmp)+1]=0; 91 fprintf(stderr,"FILENAME %s\n",filename); 88 92 struct stat file_status; 89 93 stat(filename, &file_status); … … 203 207 204 208 /* Cleanup. */ 205 // The JS_MaybeGC call imply segmentation fault206 //JS_MaybeGC(cx);207 209 JS_DestroyScript(cx, script); 210 JS_MaybeGC(cx); 208 211 // If we use the DestroyContext as requested to release memory then we get 209 212 // issue getting back the main configuration maps after coming back to the … … 387 390 #endif 388 391 if(res!=NULL){ 392 #ifdef JS_DEBUG 389 393 fprintf(stderr,"%s - %s\n",JS_GetStringBytes(jsmsg),JS_GetStringBytes(jsmsg1)); 394 #endif 390 395 addToMap(res,JS_GetStringBytes(jsmsg),JS_GetStringBytes(jsmsg1)); 391 396 } … … 394 399 res->next=NULL; 395 400 } 401 #ifdef JS_DEBUG 396 402 dumpMap(res); 403 #endif 397 404 } 398 405 }
Note: See TracChangeset
for help on using the changeset viewer.