Changeset 403
- Timestamp:
- Mar 27, 2013, 9:32:42 PM (12 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal.c
r393 r403 1215 1215 nc = xmlNewNode(ns, BAD_CAST "Process"); 1216 1216 map* tmp2=getMap(serv->content,"processVersion"); 1217 1218 1217 if(tmp2!=NULL) 1219 1218 xmlNewNsProp(nc,ns,BAD_CAST "processVersion",BAD_CAST tmp2->value); 1220 1219 1221 1220 printDescription(nc,ns_ows,serv->name,serv->content); 1222 //fflush(stderr);1223 1221 1224 1222 xmlAddChild(n,nc); … … 1339 1337 scursor=getElements(serv->outputs,mcursor->name); 1340 1338 if(scursor!=NULL){ 1341 if(testResponse==NULL )1339 if(testResponse==NULL || tmp0==NULL) 1342 1340 printIOType(doc,nc,ns,ns_ows,ns_xlink,scursor,mcursor,"Output"); 1343 1341 else 1344 if( strncmp(tmp0->value,"true",4)==0)1342 if(tmp0!=NULL && strncmp(tmp0->value,"true",4)==0) 1345 1343 printIOType(doc,nc,ns,ns_ows,ns_xlink,scursor,mcursor,"Output"); 1346 1344 } -
trunk/zoo-project/zoo-kernel/service_internal_js.c
r384 r403 112 112 113 113 /* Create the global object. */ 114 //#ifdef JS_NewCompartmentAndGlobalObject115 114 global = JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL); 116 //#else117 //global = JS_NewObject(cx, &global_class, 0,0);118 //#endif119 115 120 116 /* Populate the global object with the standard globals, … … 124 120 } 125 121 122 /* Define specific function and global variable to share with JS runtime 123 */ 126 124 jsval tmp=INT_TO_JSVAL(3); 127 125 if (!JS_SetProperty(cx, global, "SERVICE_SUCCEEDED", &tmp)) … … 385 383 fprintf(stderr,"Array Object is NULL!\n"); 386 384 maps* tmp=t; 387 388 385 while(tmp!=NULL){ 389 386 jsuint len; … … 392 389 jsval pvalj=OBJECT_TO_JSVAL(pval); 393 390 JS_SetProperty(cx, res, tmp->name, &pvalj); 394 395 391 #ifdef JS_DEBUG 396 392 fprintf(stderr,"Length of the Array %d, element : %s added \n",len,tmp->name); … … 408 404 map* isBinary=getMap(t,"size"); 409 405 map* tmap=getMapType(t); 410 #ifdef DEBUG406 #ifdef JS_DEBUG 411 407 if(tmap==NULL) 412 408 fprintf(stderr,"tmap is null !\n"); … … 414 410 fprintf(stderr,"tmap is not null ! (%s = %s)\n",tmap->name,tmap->value); 415 411 #endif 416 /* Avoid gesture of binary content which failed due to strlen function use */ 417 if(isBinary!=NULL){ 418 return res; 419 } 420 while(tmpm!=NULL){ 421 if(isArray==NULL || strncasecmp(tmpm->name,"value",5)!=0 || 422 (tmap!=NULL && strncasecmp(tmpm->name,tmap->name,strlen(tmap->name))!=0)){ 423 jsval jsstr = STRING_TO_JSVAL(JS_NewStringCopyN(cx,tmpm->value,strlen(tmpm->value))); 412 if(isArray==NULL){ 413 while(tmpm!=NULL){ 414 jsval jsstr; 415 if(isBinary!=NULL && strncasecmp(tmpm->name,"value",5)==0) 416 jsstr = STRING_TO_JSVAL(JS_NewStringCopyN(cx,tmpm->value,atoi(isBinary->value))); 417 else 418 jsstr = STRING_TO_JSVAL(JS_NewStringCopyN(cx,tmpm->value,strlen(tmpm->value))); 424 419 JS_SetProperty(cx, res, tmpm->name,&jsstr); 425 420 #ifdef JS_DEBUG 426 fprintf(stderr," %s => %s\n",tmpm->name,tmpm->value);427 #endif 428 }429 tmpm=tmpm->next;430 } 431 if(isArray!=NULL){421 fprintf(stderr,"[JS] %s => %s\n",tmpm->name,tmpm->value); 422 #endif 423 tmpm=tmpm->next; 424 } 425 } 426 else{ 432 427 map* len=getMap(t,"length"); 433 428 int cnt=atoi(len->value); … … 515 510 free(tres); 516 511 tres=NULL; 517 518 512 519 513 } 520 514 } … … 604 598 fprintf(stderr,"JSVAL NVP1J IS NOT OBJECT !!\n"); 605 599 #endif 606 607 600 } 608 601 #ifdef JS_DEBUG -
trunk/zoo-project/zoo-kernel/zoo_loader.c
r381 r403 198 198 xmlInitParser(); 199 199 xmlDocPtr doc = xmlParseMemory(t1->value,cgiContentLength); 200 201 200 { 202 201 xmlXPathObjectPtr reqptr=extractFromDoc(doc,"/*[local-name()='Envelope']/*[local-name()='Body']/*");
Note: See TracChangeset
for help on using the changeset viewer.