Changeset 850
- Timestamp:
- Aug 29, 2017, 10:52:39 AM (7 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-kernel
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/main_conf_read.y
r839 r850 87 87 ; 88 88 89 pair: PAIR { curr_key=zStrdup($1);}89 pair: PAIR {if(curr_key!=NULL) free(curr_key);curr_key=zStrdup($1);} 90 90 | EPAIR { 91 91 if(current_content==NULL) … … 101 101 curr_key=NULL; 102 102 } 103 | SPAIR { curr_key=zStrdup($1);if(debug) printf("SPAIR FOUND !!\n"); }103 | SPAIR {if(curr_key!=NULL) free(curr_key);curr_key=zStrdup($1);if(debug) printf("SPAIR FOUND !!\n"); } 104 104 ; 105 105 -
branches/prototype-v0/zoo-project/zoo-kernel/meta_sql.c
r845 r850 144 144 if(strlen(tmp)>0) 145 145 if(*ap==NULL){ 146 *ap=createMap(fields[i],tmp);146 (*ap)=createMap(fields[i],tmp); 147 147 addToMap(*ap,"fromDb","true"); 148 148 } … … 306 306 // Extract metadata 307 307 fillMetadata(conf,&res->metadata,input->GetFieldAsString( 0 )); 308 res->additional_parameters=NULL; 308 309 fillAdditionalParameters(conf,&res->additional_parameters,input->GetFieldAsString( 0 )); 309 310 res->defaults=NULL; … … 401 402 if(minimal==1){ 402 403 OGRFeature::DestroyFeature( poFeature ); 404 cleanFetchSql(conf,0,res); 403 405 return s; 404 406 } … … 410 412 while( (input = inputs->GetNextFeature()) != NULL ){ 411 413 elements* in=extractInput(conf,input); 412 addToElements(&s->inputs,in); 413 freeElements(&in); 414 free(in); 414 if(in!=NULL){ 415 if(s->inputs==NULL) 416 s->inputs=dupElements(in); 417 else 418 addToElements(&s->inputs,in); 419 freeElements(&in); 420 free(in); 421 } 415 422 OGRFeature::DestroyFeature( input ); 416 423 } … … 424 431 while( (output = outputs->GetNextFeature()) != NULL ){ 425 432 elements* in=extractOutput(conf,output); 426 addToElements(&s->outputs,in); 433 if(s->outputs==NULL) 434 s->outputs=dupElements(in); 435 else 436 addToElements(&s->outputs,in); 427 437 freeElements(&in); 428 438 free(in); … … 463 473 poFeature = res->GetNextFeature(); 464 474 while( poFeature != NULL ){ 465 fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);466 fflush(stderr);467 475 service* s=extractServiceFromDb(conf,poFeature->GetFieldAsString( 1 ),minimal); 468 476 #ifdef USE_HPC 469 477 addNestedOutputs(&s); 470 478 #endif 471 fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);472 fflush(stderr);473 dumpMap(s->content);474 fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);475 fflush(stderr);476 479 func(reg,conf,doc,n,s); 477 fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);478 fflush(stderr);479 480 freeService(&s); 480 fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);481 fflush(stderr);482 481 free(s); 483 482 OGRFeature::DestroyFeature( poFeature ); 484 483 poFeature = res->GetNextFeature(); 485 484 result++; 486 fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__); 487 fflush(stderr); 488 } 489 } 490 fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__); 491 fflush(stderr); 485 } 486 cleanFetchSql(conf,0,res); 487 } 492 488 return result; 493 489 } -
branches/prototype-v0/zoo-project/zoo-kernel/response_print.c
r839 r850 339 339 } 340 340 else{ 341 nc4 = xmlNewNode(ns_ows, BAD_CAST "Language");342 xmlAddChild(nc4,xmlNewText(BAD_CAST buff));343 341 if(dcount==0){ 344 342 if(vid==0){ 343 nc4 = xmlNewNode(ns_ows, BAD_CAST "Language"); 344 xmlAddChild(nc4,xmlNewText(BAD_CAST buff)); 345 345 xmlAddChild(nc2,nc4); 346 346 xmlAddChild(nc1,nc2); … … 867 867 } 868 868 }else{ 869 xmlNodePtr nc2 = xmlNewNode(ns_ows, BAD_CAST "AdditionalParameter"); 870 xmlNodePtr nc3 = xmlNewNode(ns_ows, BAD_CAST "Name"); 871 xmlAddChild(nc3,xmlNewText(BAD_CAST meta->name)); 872 xmlAddChild(nc2,nc3); 873 if(fromDb<0){ 874 char *mptr; 875 char* meta_values=strtok_r(meta->value,",",&mptr); 876 while(meta_values!=NULL){ 869 if(strncasecmp(meta->name,"length",6)!=0 && strncasecmp(meta->name,"fromDb",6)!=0){ 870 xmlNodePtr nc2 = xmlNewNode(ns_ows, BAD_CAST "AdditionalParameter"); 871 xmlNodePtr nc3 = xmlNewNode(ns_ows, BAD_CAST "Name"); 872 xmlAddChild(nc3,xmlNewText(BAD_CAST meta->name)); 873 xmlAddChild(nc2,nc3); 874 if(fromDb<0){ 875 char *mptr; 876 char* meta_values=strtok_r(meta->value,",",&mptr); 877 while(meta_values!=NULL){ 878 xmlNodePtr nc4 = xmlNewNode(ns_ows, BAD_CAST "Value"); 879 xmlAddChild(nc4,xmlNewText(BAD_CAST meta_values)); 880 xmlAddChild(nc2,nc4); 881 meta_values=strtok_r(NULL,",",&mptr); 882 } 883 }else{ 877 884 xmlNodePtr nc4 = xmlNewNode(ns_ows, BAD_CAST "Value"); 878 xmlAddChild(nc4,xmlNew Text(BAD_CAST meta_values));885 xmlAddChild(nc4,xmlNewCDataBlock(doc,BAD_CAST meta->value,strlen(meta->value))); 879 886 xmlAddChild(nc2,nc4); 880 meta_values=strtok_r(NULL,",",&mptr); 881 } 882 }else{ 883 xmlNodePtr nc4 = xmlNewNode(ns_ows, BAD_CAST "Value"); 884 xmlAddChild(nc4,xmlNewCDataBlock(doc,BAD_CAST meta->value,strlen(meta->value))); 885 xmlAddChild(nc2,nc4); 886 } 887 xmlAddChild(nc1,nc2); 887 } 888 xmlAddChild(nc1,nc2); 889 } 888 890 hasTitle=-1; 889 891 } … … 892 894 xmlAddChild(nc,nc1); 893 895 hasValue=1; 894 } 896 }else 897 free(ctitle); 895 898 } 896 899 if(oMeta!=NULL && hasValue<0 && nc1!=NULL){ … … 1404 1407 } 1405 1408 else 1406 xmlFree (nc9);1409 xmlFreeNode(nc9); 1407 1410 if(strcasecmp(tmp1->name,"uom")==0) 1408 1411 hasUOM1=true; … … 1601 1604 xmlAddChild(nc5,nc6); 1602 1605 else 1603 xmlFree (nc6);1606 xmlFreeNode(nc6); 1604 1607 } 1605 1608 else 1606 xmlFree (nc6);1609 xmlFreeNode(nc6); 1607 1610 } 1608 1611 tmp1=tmp1->next; … … 1631 1634 } 1632 1635 else{ 1636 xmlFreeNode(nc4); 1633 1637 xmlAddChild(nc3,nc5); 1634 1638 } 1635 1639 } 1636 1640 else 1637 if(datatype!=1) 1641 if(datatype!=1){ 1642 xmlFreeNode(nc4); 1638 1643 xmlAddChild(nc3,nc5); 1644 } 1639 1645 1640 1646 _tmp=_tmp->next; … … 1654 1660 } 1655 1661 else{ 1662 xmlFreeNode(nc4); 1656 1663 xmlAddChild(nc3,nc5); 1657 1664 } … … 1673 1680 } 1674 1681 if(e->child!=NULL && vid==0){ 1682 xmlFreeNode(nc3); 1675 1683 elements* children=dupElements(e->child); 1676 1684 elements* cursor=children; … … 1678 1686 char* tmp=strdup(cursor->name); 1679 1687 free(cursor->name); 1680 cursor->name=(char*)malloc((strlen( cursor->name)+strlen(e->name)+2)*sizeof(char));1688 cursor->name=(char*)malloc((strlen(tmp)+strlen(e->name)+2)*sizeof(char)); 1681 1689 sprintf(cursor->name,"%s.%s",e->name,tmp); 1682 1690 cursor=cursor->next; -
branches/prototype-v0/zoo-project/zoo-kernel/server_internal.c
r839 r850 460 460 if(cSize!=NULL){ 461 461 length=atoi(cSize->value); 462 } 462 }else 463 length=strlen(cValue->value); 463 464 writeFile(val,cValue->value,length); 464 465 addToMap(cMap,"cache_file",val); -
branches/prototype-v0/zoo-project/zoo-kernel/service.c
r839 r850 417 417 if(tmp->format!=NULL) 418 418 free(tmp->format); 419 freeElements(&tmp->child); 419 420 if(tmp->child!=NULL){ 420 freeElements(&tmp->child);421 421 free(tmp->child); 422 422 } … … 453 453 if(tmp->metadata!=NULL) 454 454 free(tmp->metadata); 455 freeMap(&tmp->additional_parameters); 456 if(tmp->additional_parameters!=NULL) 457 free(tmp->additional_parameters); 455 458 freeElements(&tmp->inputs); 456 459 if(tmp->inputs!=NULL) … … 1160 1163 elements* cursor=e; 1161 1164 elements* tmp=NULL; 1162 if(cursor!=NULL && e->name!=NULL){1165 if(cursor!=NULL && cursor->name!=NULL){ 1163 1166 #ifdef DEBUG 1164 1167 fprintf(stderr,">> %s %i\n",__FILE__,__LINE__); … … 1167 1170 #endif 1168 1171 tmp=(elements*)malloc(ELEMENTS_SIZE); 1169 tmp->name=zStrdup( e->name);1172 tmp->name=zStrdup(cursor->name); 1170 1173 tmp->content=NULL; 1171 1174 addMapToMap(&tmp->content,e->content); … … 1228 1231 elements* tmp=e; 1229 1232 if(*m==NULL){ 1230 *m=dupElements(tmp);1233 (*m)=dupElements(tmp); 1231 1234 }else{ 1232 1235 addToElements(&(*m)->next,tmp); -
branches/prototype-v0/zoo-project/zoo-kernel/service.h
r839 r850 139 139 * The memory size to create an elements 140 140 */ 141 #define ELEMENTS_SIZE (sizeof(char*)+(((2*sizeof(char*))+sizeof(maps*))*3)+sizeof(char*)+(( (2*sizeof(char*))+sizeof(iotype*))*2)+(2*sizeof(elements*)))141 #define ELEMENTS_SIZE (sizeof(char*)+(((2*sizeof(char*))+sizeof(maps*))*3)+sizeof(char*)+((sizeof(map*) + sizeof(iotype*))*2)+(2*sizeof(elements*))) 142 142 /** 143 143 * The memory size to create a map -
branches/prototype-v0/zoo-project/zoo-kernel/service_callback.c
r846 r850 35 35 #endif 36 36 37 /** 38 * Check if a service name is prohibited, meaning that we don't have to invoke 39 * the callback for this specific service. 40 * 41 */ 42 bool isProhibited(maps* conf,const char* serviceName){ 43 map* plist=getMapFromMaps(conf,"callback","prohibited"); 44 if(plist!=NULL){ 45 char *tmp=plist->value; 46 char *tmpS=strtok(tmp,","); 47 while(tmpS!=NULL){ 48 if(strcmp(serviceName,tmpS)==0) 49 return true; 50 tmpS=strtok(NULL,","); 51 } 52 } 53 return false; 54 } 55 37 56 /** 38 57 * Invoke the callback in case there is a [callback] section containing a url parameter … … 57 76 if(url==NULL) 58 77 return false; 59 78 60 79 maps* lenv=getMaps(m,"lenv"); 61 80 map* sname=getMap(lenv->content,"identifier"); 81 if(sname!=NULL && isProhibited(m,sname->value)) 82 return false; 83 62 84 json_object *res=json_object_new_object(); 63 85 … … 87 109 maps* curs=inputs; 88 110 89 char *keys[ 4][2]={111 char *keys[8][2]={ 90 112 { 91 113 "href", … … 103 125 "size", 104 126 "size" 105 } 127 }, 128 { 129 "ref_wms_link", 130 "ref_wms_link" 131 }, 132 { 133 "ref_wcs_link", 134 "ref_wcs_link" 135 }, 136 { 137 "ref_wfs_link", 138 "ref_wfs_link" 139 }, 140 { 141 "datatype", 142 "datatype" 143 } 106 144 }; 107 145 json_object *res1=json_object_new_object(); 108 146 while(curs!=NULL){ 109 147 map* tmpMap=getMap(curs->content,"cache_file"); 110 if(tmpMap!=NULL){ 148 sid=getMap(curs->content,"ref_wms_link"); 149 if(tmpMap!=NULL && sid==NULL){ 111 150 addToMap(curs->content,"generated_file",tmpMap->value); 112 151 tmpMap=getMap(curs->content,"fmimeType"); … … 121 160 int i=0; 122 161 int hasRef=-1; 123 for(;i< 4;i++){162 for(;i<8;i++){ 124 163 sid=getMap(curs->content,keys[i][0]); 125 164 if(sid!=NULL){ -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_hpc.c
r846 r850 80 80 } 81 81 free(tmp[i]->name); 82 if(tmp[i]->format!=NULL) 83 free(tmp[i]->format); 82 84 tmp[i]->format=zStrdup("ComplexData"); 83 85 freeMap(&tmp[i]->content); … … 160 162 cur=cur->next; 161 163 } 164 //dumpElements((*s)->outputs); 162 165 } 163 166 … … 351 354 } 352 355 353 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);354 fflush(stderr);355 invokeCallback(m,inputs,NULL,3,0);356 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);357 fflush(stderr);358 359 356 // Produce the SBATCH File locally 360 357 char *scriptPath=(char*)malloc((strlen(s->name)+strlen(tmpPath->value)+strlen(uuid->value)+10)*sizeof(char)); … … 489 486 setMapInMaps(*main_conf,"lenv","message",_("Unable to fetch the remote error log file")); 490 487 tmpPath=getMapFromMaps(*main_conf,"lenv","message"); 488 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 489 fflush(stderr); 491 490 invokeCallback(m,NULL,NULL,7,1); 491 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 492 fflush(stderr); 492 493 sprintf(tmpS, "Cannot execute the HPC ZOO-Service %s: %s", s->name, tmpPath->value); 493 494 errorException(m,tmpS,"NoApplicableCode",NULL); … … 533 534 sleep(1); 534 535 setMapInMaps(*main_conf,"lenv","message",_("Read closed")); 536 invokeCallback(m,NULL,NULL,7,1); 535 537 return -1; 536 538 }else{ 537 539 if(rc<0){ 538 540 setMapInMaps(*main_conf,"lenv","message",_("Read error")); 541 invokeCallback(m,NULL,NULL,7,1); 539 542 return -1; 540 543 } … … 543 546 res=atoi(buf); 544 547 unlink(sname); 545 //free(sname); 548 //free(sname); 546 549 547 550 if(res==3){ … … 597 600 input=input->next; 598 601 } 602 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 603 fflush(stderr); 604 invokeCallback(m,NULL,outputs,5,1); 605 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 606 fflush(stderr); 599 607 } 600 608 //free(buf); … … 607 615 } 608 616 } 617 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 618 fflush(stderr); 609 619 ssh_close(*main_conf); 620 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 621 fflush(stderr); 610 622 return res; 611 623 } -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_ms.c
r839 r850 194 194 195 195 char* webService_url=(char*)malloc((strlen(msUrl->value)+strlen(format->value)+strlen(tmpI->name)+strlen(width->value)+strlen(height->value)+strlen(extent->value)+256)*sizeof(char)); 196 196 map* datatype=getMap(tmpI->content,"datatype"); 197 198 sprintf(webService_url, 199 "%s?map=%s/%s_%s.map&request=%s&service=%s&version=%s&%s&format=%s&bbox=%s&crs=%s", 200 msUrl->value, 201 dataPath->value, 202 tmpI->name, 203 sid->value, 204 options[proto][2], 205 options[proto][0], 206 protoVersion, 207 layers, 208 rformat->value, 209 extent->value, 210 crs->value 211 ); 197 212 if(proto>0){ 198 sprintf(webService_url, 199 "%s?map=%s/%s_%s.map&request=%s&service=%s&version=%s&%s&format=%s&bbox=%s&crs=%s", 200 msUrl->value, 201 dataPath->value, 202 tmpI->name, 203 sid->value, 204 options[proto][2], 205 options[proto][0], 206 protoVersion, 207 layers, 208 rformat->value, 209 extent->value, 210 crs->value 211 ); 213 addToMap(tmpI->content,"Reference",webService_url); 214 proto=0; 215 rformat=createMap("mimeType","image/png"); 212 216 } 213 217 else{ 214 sprintf(webService_url, 215 "%s?map=%s/%s_%s.map&request=%s&service=%s&version=%s&%s&width=%s&height=%s&format=%s&bbox=%s&crs=%s", 216 msUrl->value, 217 dataPath->value, 218 tmpI->name, 219 sid->value, 220 options[proto][2], 221 options[proto][0], 222 protoVersion, 223 layers, 224 width->value, 225 height->value, 226 rformat->value, 227 extent->value, 228 crs->value 229 ); 230 } 218 if(datatype!=NULL && strncasecmp(datatype->value,"raster",6)==0){ 219 proto=2; 220 rformat=createMap("mimeType","image/tiff"); 221 } 222 else{ 223 proto=1; 224 rformat=createMap("mimeType","text/xml"); 225 } 226 } 227 if(datatype!=NULL && strncasecmp(datatype->value,"raster",6)==0){ 228 addToMap(tmpI->content,"ref_wcs_link",webService_url); 229 } 230 else{ 231 addToMap(tmpI->content,"ref_wfs_link",webService_url); 232 } 233 protoVersion=options[proto][1]; 234 extent=getMap(tmpI->content,options[proto][4]); 235 memset(webService_url,0,strlen(webService_url)); 236 sprintf(webService_url, 237 "%s?map=%s/%s_%s.map&request=%s&service=%s&version=%s&%s&width=%s&height=%s&format=%s&bbox=%s&crs=%s", 238 msUrl->value, 239 dataPath->value, 240 tmpI->name, 241 sid->value, 242 options[proto][2], 243 options[proto][0], 244 protoVersion, 245 layers, 246 width->value, 247 height->value, 248 rformat->value, 249 extent->value, 250 crs->value 251 ); 252 if(proto>0){ 253 addToMap(tmpI->content,"Reference",webService_url); 254 } 255 addToMap(tmpI->content,"ref_wms_link",webService_url); 231 256 if(hasCRS==0){ 232 257 freeMap(&crs); 233 258 free(crs); 234 259 } 235 addToMap(tmpI->content,"Reference",webService_url);236 260 free(webService_url); 237 261 } … … 531 555 free(sdsName); 532 556 free(dsName); 533 557 534 558 OGRDataSourceH poDS = NULL; 535 559 OGRSFDriverH *poDriver = NULL; … … 548 572 } 549 573 574 addToMap(output->content,"datatype","vector"); 550 575 int iLayer = 0; 551 576 for( iLayer=0; iLayer < OGR_DS_GetLayerCount(poDS); iLayer++ ){ … … 757 782 #endif 758 783 784 addToMap(output->content,"datatype","raster"); 759 785 /** 760 786 * Add a new layer set name, data -
branches/prototype-v0/zoo-project/zoo-kernel/sqlapi.c
r839 r850 396 396 char* _getStatus(maps* conf,char* pid){ 397 397 int zoo_ds_nb=getCurrentId(conf); 398 int created=-1; 398 399 map *schema=getMapFromMaps(conf,"database","schema"); 399 400 char *sqlQuery=(char*)malloc((strlen(schema->value)+strlen(pid)+58+1)*sizeof(char)); … … 408 409 init_sql(conf); 409 410 zoo_ds_nb++; 411 created=1; 410 412 } 411 413 execSql(conf,zoo_ds_nb-1,sqlQuery); -
branches/prototype-v0/zoo-project/zoo-kernel/ulinet.c
r846 r850 286 286 int length=strlen(token)+6; 287 287 char* tmp1=(char*)malloc(length*sizeof(char)); 288 map* tmpMap; 288 289 snprintf(tmp1,6,"HTTP_"); 289 290 int j; … … 296 297 } 297 298 fprintf(stderr,"%s %d %s \n",__FILE__,__LINE__,tmp1); 298 map* tmpMap = getMapFromMaps(conf,"renv",tmp1); 299 if(tmpMap!=NULL) 300 AddMissingHeaderEntry(&handle->ihandle[i],token,tmpMap->value); 299 if(strncmp(tmp1,"HTTP_COOKIE",11)!=0){ 300 tmpMap = getMapFromMaps(conf,"renv",tmp1); 301 if(tmpMap!=NULL) 302 AddMissingHeaderEntry(&handle->ihandle[i],token,tmpMap->value); 303 } 301 304 free(tmp1); 302 305 if(handle->ihandle[i].header!=NULL) -
branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
r839 r850 304 304 { 305 305 char* extn = strstr(dp->d_name, ".zcfg"); 306 if(dp->d_name[0] != '.' && extn != NULL && strlen(extn) == 5 )306 if(dp->d_name[0] != '.' && extn != NULL && strlen(extn) == 5 && strlen(dp->d_name)>6) 307 307 { 308 308 int t; … … 311 311 snprintf (tmps1, 1024, "%s/%s", conf_dir, dp->d_name); 312 312 313 char *tmpsn = zStrdup (dp->d_name); 314 tmpsn[strlen (tmpsn) - 5] = 0; 313 char *tmpsn = (char*)malloc((strlen(dp->d_name)-4)*sizeof(char));//zStrdup (dp->d_name); 314 memset (tmpsn, 0, strlen(dp->d_name)-4); 315 snprintf(tmpsn,strlen(dp->d_name)-4,"%s",dp->d_name); 315 316 316 317 map* import = getMapFromMaps (m, IMPORTSERVICE, tmpsn); … … 1181 1182 }; 1182 1183 r_inputs = getMap (request_inputs, "Request"); 1183 REQUEST = zStrdup (r_inputs->value); 1184 fprintf(stderr," ** DEBUG %s %d \n",__FILE__,__LINE__); 1185 fflush(stderr); 1186 dumpMap(r_inputs); 1187 fprintf(stderr," ** DEBUG %s %d \n",__FILE__,__LINE__); 1188 fflush(stderr); 1189 if(r_inputs!=NULL) 1190 REQUEST = zStrdup (r_inputs->value); 1191 fprintf(stderr," ** DEBUG %s %d \n",__FILE__,__LINE__); 1192 fflush(stderr); 1184 1193 int reqId=-1; 1185 1194 if (strncasecmp (REQUEST, "GetCapabilities", 15) != 0){ … … 1188 1197 for(j=0;j<nbSupportedRequests;j++){ 1189 1198 if(requests[vid][j]!=NULL && requests[vid][j+1]!=NULL){ 1190 if(j<nbReqIdentifier && strncasecmp(REQUEST,requests[vid][j+1],strlen( REQUEST))==0){1199 if(j<nbReqIdentifier && strncasecmp(REQUEST,requests[vid][j+1],strlen(requests[vid][j+1]))==0){ 1191 1200 checkValidValue(request_inputs,&err,"identifier",NULL,1); 1192 1201 reqId=j+1; … … 1195 1204 else 1196 1205 if(j>=nbReqIdentifier && j<nbReqIdentifier+nbReqJob && 1197 strncasecmp(REQUEST,requests[vid][j+1],strlen( REQUEST))==0){1206 strncasecmp(REQUEST,requests[vid][j+1],strlen(requests[vid][j+1]))==0){ 1198 1207 checkValidValue(request_inputs,&err,"jobid",NULL,1); 1199 1208 reqId=j+1; … … 1358 1367 r_inputs = getMap (request_inputs, "JobId"); 1359 1368 if(reqId>nbReqIdentifier){ 1360 if (strncasecmp (REQUEST, "GetStatus", strlen(REQUEST)) == 0 ||1361 strncasecmp (REQUEST, "GetResult", strlen(REQUEST)) == 0){1369 if (strncasecmp (REQUEST, "GetStatus", 9) == 0 || 1370 strncasecmp (REQUEST, "GetResult", 9) == 0){ 1362 1371 runGetStatus(m,r_inputs->value,REQUEST); 1372 #ifdef RELY_ON_DB 1373 map* dsNb=getMapFromMaps(m,"lenv","ds_nb"); 1374 if(dsNb!=NULL && atoi(dsNb->value)>1) 1375 close_sql(m,1); 1376 close_sql(m,0); 1377 #endif 1378 1363 1379 freeMaps (&m); 1364 1380 free(m); … … 2160 2176 addToMap (_tmpMaps->content, "soap", "false"); 2161 2177 2162 // Parse the session file and add it to the main maps 2178 // Parse the session file and add it to the main maps 2179 char* originalCookie=NULL; 2163 2180 if (cgiCookie != NULL && strlen (cgiCookie) > 0) 2164 2181 { … … 2252 2269 _tmpMaps = createMaps("renv"); 2253 2270 for (; s; ei++) { 2271 int len=strlen(s); 2254 2272 char* tmpName=zStrdup(s); 2255 2273 char* tmpValue=strstr(s,"=")+1; 2256 char* tmpName1=(char*)malloc((1+( strlen(tmpName)-strlen(tmpValue)))*sizeof(char));2257 snprintf(tmpName1,( strlen(tmpName)-strlen(tmpValue)),"%s",tmpName);2274 char* tmpName1=(char*)malloc((1+(len-strlen(tmpValue)))*sizeof(char)); 2275 snprintf(tmpName1,(len-strlen(tmpValue))+1,"%s",tmpName); 2258 2276 if(_tmpMaps->content == NULL) 2259 2277 _tmpMaps->content = createMap (tmpName1,tmpValue); … … 2263 2281 free(tmpName1); 2264 2282 s = *(orig+ei); 2283 } 2284 if(_tmpMaps->content!=NULL && getMap(_tmpMaps->content,"HTTP_COOKIE")!=NULL){ 2285 /*map* tmpMap1=getMap(_tmpMaps->content,"HTTP_COOKIE"); 2286 free(tmpMap1->value); 2287 tmpMap1->value=zStrdup(cgiCookie);*/ 2288 fprintf(stderr,"[%s]\n",cgiCookie); 2289 addToMap(_tmpMaps->content,"HTTP_COOKIE1",&cgiCookie[0]); 2290 dumpMap(_tmpMaps->content); 2265 2291 } 2266 2292 addMapsToMaps (&m, _tmpMaps); … … 2292 2318 } 2293 2319 #endif 2294 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);2295 invokeCallback(m,NULL,NULL,0,0);2296 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);2297 2320 2298 2321 char *fbkp, *fbkpid, *fbkpres, *fbkp1, *flog; … … 2446 2469 recordServiceStatus(m); 2447 2470 #endif 2471 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 2472 invokeCallback(m,NULL,NULL,0,0); 2473 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 2448 2474 if(vid==0){ 2449 2475 /** … … 2513 2539 return -1; 2514 2540 } 2541 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 2542 invokeCallback(m,request_input_real_format,NULL,1,1); 2543 fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__); 2515 2544 setMapInMaps(m,"lenv","ds_nb","1"); 2516 2545 loadServiceAndRun (&m, s1, request_inputs,
Note: See TracChangeset
for help on using the changeset viewer.