Changeset 32 for trunk/zoo-kernel/service_internal.c
- Timestamp:
- Sep 27, 2010, 10:09:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_internal.c
r26 r32 80 80 } 81 81 conf=mapsFromJSObject(cx,argv[0]); 82 dumpMaps(conf);83 82 if(JS_ValueToInt32(cx,argv[1],&istatus)==JS_TRUE){ 84 83 char tmpStatus[4]; … … 350 349 else{ 351 350 fprintf(stderr,"TMP4 NOT FOUND !!"); 352 //dumpMaps(tmp4);353 351 return NULL; 354 352 } … … 439 437 else{ 440 438 fprintf(stderr,"TMP4 NOT FOUND !!"); 441 //dumpMaps(tmp4);442 439 } 443 440 xmlAddChild(nc4,nc5); … … 964 961 maps* tmp_maps=getMaps(m,"main"); 965 962 if(tmp_maps!=NULL){ 966 dumpMaps(getMaps(m,"lenv"));967 963 map* tmpm1=getMap(tmp_maps->content,"serverAddress"); 968 964 /** … … 1285 1281 while(tmp!=NULL){ 1286 1282 if(strncasecmp(tmp->name,"value",strlen(tmp->name))!=0 && 1283 strncasecmp(tmp->name,"extension",strlen(tmp->name))!=0 && 1284 strncasecmp(tmp->name,"asReference",strlen(tmp->name))!=0 && 1285 strncasecmp(tmp->name,"status",strlen(tmp->name))!=0 && 1286 strncasecmp(tmp->name,"storeExecuteResponse",strlen(tmp->name))!=0 && 1287 1287 strncasecmp(tmp->name,"extension",strlen(tmp->name))!=0) 1288 1288 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); … … 1306 1306 } 1307 1307 else if(tmp!=NULL){ 1308 if(strcmp(tmp->value,"text/js")==0) 1308 if(strncmp(tmp->value,"text/js",4)==0 || 1309 strncmp(tmp->value,"application/js",14)==0) 1309 1310 xmlAddChild(nc3,xmlNewCDataBlock(doc,BAD_CAST toto->value,strlen(toto->value))); 1310 1311 else … … 1394 1395 maps* tmpMap=getMaps(m,"main"); 1395 1396 char *encoding=getEncoding(tmpMap); 1396 map *tmpSid=getMapFromMaps(m,"lenv","sid"); 1397 if(tmpSid==NULL) 1397 if(m!=NULL){ 1398 map *tmpSid=getMapFromMaps(m,"lenv","sid"); 1399 if(tmpSid!=NULL){ 1400 if( getpid()==atoi(tmpSid->value) ) 1401 printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding); 1402 } 1403 else 1404 printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding); 1405 }else 1398 1406 printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding); 1399 1407 … … 1534 1542 * We get the first output only !! 1535 1543 */ 1544 toto=getMap(request_outputs->content,"value"); 1545 if(toto==NULL){ 1546 map * errormap = createMap("text","Unable to fetch any result"); 1547 addToMap(errormap,"code", "InternalError"); 1548 fprintf(stderr,"DISPLAY ERROR MESSAGE !!!\n"); 1549 printExceptionReportResponse(m,errormap); 1550 freeMap(&errormap); 1551 free(errormap); 1552 } 1536 1553 char mime[1024]; 1537 1554 map* mi=getMap(request_outputs->content,"mimeType"); … … 1554 1571 sprintf(mime,"Content-Type: text/plain; charset=utf-8\r\nStatus: 200 OK\r\n\r\n"); 1555 1572 printf("%s",mime); 1556 toto=getMap(request_outputs->content,"value");1557 1573 if(mi!=NULL && strncmp(mi->value,"image",5)==0){ 1558 1574 map* rs=getMapFromMaps(request_outputs,request_outputs->name,"size"); … … 1575 1591 errormap = createMap("text",tmp); 1576 1592 addToMap(errormap,"code", "InternalError"); 1577 printf("Content-Type: text/xml; charset=utf-8\r\nStatus: 200 OK\r\n\r\n");1593 fprintf(stderr,"DISPLAY ERROR MSG !!!!\n"); 1578 1594 printExceptionReportResponse(m,errormap); 1579 1595 freeMap(&errormap);
Note: See TracChangeset
for help on using the changeset viewer.