Ignore:
Timestamp:
Jun 19, 2015, 4:02:34 PM (9 years ago)
Author:
david
Message:
  • add add zcfg files loading
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PublicaMundi_David_integration_01-devel/zoo-project/zoo-kernel/zoo_service_loader.c

    r667 r677  
    4242#include <libxml/xpathInternals.h>
    4343}
    44 
     44#include "zoo_zcfg.h"
    4545#include "ulinet.h"
    4646
     
    184184    }
    185185}
    186 
    187 
    188 /**
    189  * Create the profile registry.
    190  *
    191  * The profile registry is optional (created only if the registry key is
    192  * available in the [main] section of the main.cfg file) and can be used to
    193  * store the profiles hierarchy. The registry is a directory which should
    194  * contain the following sub-directories:
    195  *  * concept: direcotry containing .html files describing concept
    196  *  * generic: directory containing .zcfg files for wps:GenericProcess
    197  *  * implementation: directory containing .zcfg files for wps:Process
    198  *
    199  * @param m the conf maps containing the main.cfg settings
    200  * @param r the registry to update
    201  * @param reg_dir the resgitry
    202  * @param saved_stdout the saved stdout identifier
    203  * @return 0 if the resgitry is null or was correctly updated, -1 on failure
    204  */
    205 int
    206 createRegistry (maps* m,registry ** r, char *reg_dir, int saved_stdout)
    207 {
    208   struct dirent *dp;
    209   int scount = 0;
    210 
    211   if (reg_dir == NULL)
    212     return 0;
    213   DIR *dirp = opendir (reg_dir);
    214   if (dirp == NULL)
    215     {
    216       return -1;
    217     }
    218   while ((dp = readdir (dirp)) != NULL){
    219     if ((dp->d_type == DT_DIR || dp->d_type == DT_LNK) && dp->d_name[0] != '.')
    220       {
    221 
    222         char * tmpName =
    223           (char *) malloc ((strlen (reg_dir) + strlen (dp->d_name) + 2) *
    224                            sizeof (char));
    225         sprintf (tmpName, "%s/%s", reg_dir, dp->d_name);
    226        
    227         DIR *dirp1 = opendir (tmpName);
    228         struct dirent *dp1;
    229         while ((dp1 = readdir (dirp1)) != NULL){
    230           char* extn = strstr(dp1->d_name, ".zcfg");
    231           if(dp1->d_name[0] != '.' && extn != NULL && strlen(extn) == 5)
    232             {
    233               int t;
    234               char *tmps1=
    235                 (char *) malloc ((strlen (tmpName) + strlen (dp1->d_name) + 2) *
    236                                  sizeof (char));
    237               sprintf (tmps1, "%s/%s", tmpName, dp1->d_name);
    238               char *tmpsn = zStrdup (dp1->d_name);
    239               tmpsn[strlen (tmpsn) - 5] = 0;
    240               service* s1 = (service *) malloc (SERVICE_SIZE);
    241               if (s1 == NULL)
    242                 {
    243                   dup2 (saved_stdout, fileno (stdout));
    244                   errorException (m, _("Unable to allocate memory."),
    245                                   "InternalError", NULL);
    246                   return -1;
    247                 }
    248               t = readServiceFile (m, tmps1, &s1, tmpsn);
    249               free (tmpsn);
    250               if (t < 0)
    251                 {
    252                   map *tmp00 = getMapFromMaps (m, "lenv", "message");
    253                   char tmp01[1024];
    254                   if (tmp00 != NULL)
    255                     sprintf (tmp01, _("Unable to parse the ZCFG file: %s (%s)"),
    256                              dp1->d_name, tmp00->value);
    257                   else
    258                     sprintf (tmp01, _("Unable to parse the ZCFG file: %s."),
    259                              dp1->d_name);
    260                   dup2 (saved_stdout, fileno (stdout));
    261                   errorException (m, tmp01, "InternalError", NULL);
    262                   return -1;
    263                 }
    264 #ifdef DEBUG
    265               dumpService (s1);
    266               fflush (stdout);
    267               fflush (stderr);
    268 #endif
    269               if(strncasecmp(dp->d_name,"implementation",14)==0){
    270                 inheritance(*r,&s1);
    271               }
    272               addServiceToRegistry(r,dp->d_name,s1);
    273               freeService (&s1);
    274               free (s1);
    275               scount++;
    276             }
    277         }
    278         (void) closedir (dirp1);
    279       }
    280   }
    281   (void) closedir (dirp);
    282   return 0;
    283 }
    284 
    285 /**
    286  * Recursivelly parse zcfg starting from the ZOO-Kernel cwd.
    287  * Call the func function given in arguments after parsing the ZCFG file.
    288  *
    289  * @param m the conf maps containing the main.cfg settings
    290  * @param r the registry containing profiles hierarchy
    291  * @param n the root XML Node to add the sub-elements
    292  * @param conf_dir the location of the main.cfg file (basically cwd)
    293  * @param prefix the current prefix if any, or NULL
    294  * @param saved_stdout the saved stdout identifier
    295  * @param level the current level (number of sub-directories to reach the
    296  * current path)
    297  * @see inheritance, readServiceFile
    298  */
    299 int
    300 recursReaddirF (maps * m, registry *r, xmlNodePtr n, char *conf_dir, char *prefix,
    301                 int saved_stdout, int level, void (func) (maps *, xmlNodePtr,
    302                                                           service *))
    303 {
    304   struct dirent *dp;
    305   int scount = 0;
    306 
    307   if (conf_dir == NULL)
    308     return 1;
    309   DIR *dirp = opendir (conf_dir);
    310   if (dirp == NULL)
    311     {
    312       if (level > 0)
    313         return 1;
    314       else
    315         return -1;
    316     }
    317   char tmp1[25];
    318   sprintf (tmp1, "sprefix_%d", level);
    319   char levels[17];
    320   sprintf (levels, "%d", level);
    321   setMapInMaps (m, "lenv", "level", levels);
    322   while ((dp = readdir (dirp)) != NULL)
    323     if ((dp->d_type == DT_DIR || dp->d_type == DT_LNK) && dp->d_name[0] != '.'
    324         && strstr (dp->d_name, ".") == NULL)
    325       {
    326 
    327         char *tmp =
    328           (char *) malloc ((strlen (conf_dir) + strlen (dp->d_name) + 2) *
    329                            sizeof (char));
    330         sprintf (tmp, "%s/%s", conf_dir, dp->d_name);
    331 
    332         if (prefix != NULL)
    333           {
    334             prefix = NULL;
    335           }
    336         prefix = (char *) malloc ((strlen (dp->d_name) + 2) * sizeof (char));
    337         sprintf (prefix, "%s.", dp->d_name);
    338 
    339         //map* tmpMap=getMapFromMaps(m,"lenv",tmp1);
    340 
    341         int res;
    342         if (prefix != NULL)
    343           {
    344             setMapInMaps (m, "lenv", tmp1, prefix);
    345             char levels1[17];
    346             sprintf (levels1, "%d", level + 1);
    347             setMapInMaps (m, "lenv", "level", levels1);
    348             res =
    349               recursReaddirF (m, r, n, tmp, prefix, saved_stdout, level + 1,
    350                               func);
    351             sprintf (levels1, "%d", level);
    352             setMapInMaps (m, "lenv", "level", levels1);
    353             free (prefix);
    354             prefix = NULL;
    355           }
    356         else
    357           res = -1;
    358         free (tmp);
    359         if (res < 0)
    360           {
    361             return res;
    362           }
    363       }
    364     else
    365       {
    366         char* extn = strstr(dp->d_name, ".zcfg");
    367         if(dp->d_name[0] != '.' && extn != NULL && strlen(extn) == 5)
    368           {
    369             int t;
    370             char tmps1[1024];
    371             memset (tmps1, 0, 1024);
    372             snprintf (tmps1, 1024, "%s/%s", conf_dir, dp->d_name);
    373             service *s1 = (service *) malloc (SERVICE_SIZE);
    374             if (s1 == NULL)
    375               {
    376                 dup2 (saved_stdout, fileno (stdout));
    377                 errorException (m, _("Unable to allocate memory."),
    378                                 "InternalError", NULL);
    379                 return -1;
    380               }
    381 #ifdef DEBUG
    382             fprintf (stderr, "#################\n%s\n#################\n",
    383                      tmps1);
    384 #endif
    385             char *tmpsn = zStrdup (dp->d_name);
    386             tmpsn[strlen (tmpsn) - 5] = 0;
    387             t = readServiceFile (m, tmps1, &s1, tmpsn);
    388             free (tmpsn);
    389             if (t < 0)
    390               {
    391                 map *tmp00 = getMapFromMaps (m, "lenv", "message");
    392                 char tmp01[1024];
    393                 if (tmp00 != NULL)
    394                   sprintf (tmp01, _("Unable to parse the ZCFG file: %s (%s)"),
    395                            dp->d_name, tmp00->value);
    396                 else
    397                   sprintf (tmp01, _("Unable to parse the ZCFG file: %s."),
    398                            dp->d_name);
    399                 dup2 (saved_stdout, fileno (stdout));
    400                 errorException (m, tmp01, "InternalError", NULL);
    401                 return -1;
    402               }
    403 #ifdef DEBUG
    404             dumpService (s1);
    405             fflush (stdout);
    406             fflush (stderr);
    407 #endif
    408             inheritance(r,&s1);
    409             func (m, n, s1);
    410             freeService (&s1);
    411             free (s1);
    412             scount++;
    413           }
    414       }
    415   (void) closedir (dirp);
    416   return 1;
    417 }
    418 
    419186/**
    420187 * Signal handling function which simply call exit(0).
     
    520287                sprintf (tmps1, "%s/%s", libp->value, r_inputs->value);
    521288         }
    522      else {     
    523         r_inputs = getMap (request_inputs, "metapath");
    524         if (r_inputs != NULL)
    525           sprintf (tmps1, "%s/%s", ntmp, r_inputs->value);
    526         else
    527           sprintf (tmps1, "%s/", ntmp);
    528          
    529         char *altPath = zStrdup (tmps1);
     289     else {
     290        char *tmp_path = (char *) malloc ((strlen (s1->zcfg) + 1) * sizeof (char *));
     291        sprintf (tmp_path, "%s", s1->zcfg);
     292        char *dir = dirname (tmp_path);
    530293        r_inputs = getMap (s1->content, "ServiceProvider");
    531         sprintf (tmps1, "%s/%s", altPath, r_inputs->value);
    532         free (altPath);
     294        sprintf (tmps1, "%s/%s", dir, r_inputs->value);
     295        free (tmp_path);
     296
    533297         }
    534298#ifdef DEBUG
     
    620384#endif
    621385#endif
    622               r_inputs = getMapFromMaps (m, "lenv", "Identifier");
    623 #ifdef DEBUG
    624               fprintf (stderr, "Try to load function %s\n", r_inputs->value);
    625 #endif
    626386              typedef int (*execute_t) (maps **, maps **, maps **);
     387
     388              fprintf(stderr,"%s \n",s1->name);
    627389#ifdef WIN32
    628390              execute_t execute =
    629                 (execute_t) GetProcAddress (so, r_inputs->value);
    630 #else
    631               execute_t execute = (execute_t) dlsym (so, r_inputs->value);
     391                (execute_t) GetProcAddress (so, s1->name);
     392#else
     393              execute_t execute = (execute_t) dlsym (so, s1->name);
    632394#endif
    633395
     
    640402#endif
    641403                  char *tmpMsg =
    642                     (char *) malloc (2048 + strlen (r_inputs->value));
     404                    (char *) malloc (2048 + strlen (s1->name));
    643405                  sprintf (tmpMsg,
    644406                           _
    645407                           ("Error occured while running the %s function: %s"),
    646                            r_inputs->value, errstr);
     408                           s1->name, errstr);
    647409                  errorException (m, tmpMsg, "InternalError", NULL);
    648410                  free (tmpMsg);
    649411#ifdef DEBUG
    650                   fprintf (stderr, "Function %s error %s\n", r_inputs->value,
     412                  fprintf (stderr, "Function %s error %s\n", s1->name,
    651413                           errstr);
    652414#endif
     
    12531015    snprintf (conf_dir, 1024, "%s", ntmp);
    12541016
    1255   map* reg = getMapFromMaps (m, "main", "registry");
    1256   registry* zooRegistry=NULL;
    1257   if(reg!=NULL){
    1258     int saved_stdout = dup (fileno (stdout));
    1259     dup2 (fileno (stderr), fileno (stdout));
    1260     createRegistry (m,&zooRegistry,reg->value,saved_stdout);
    1261     dup2 (saved_stdout, fileno (stdout));
    1262   }
    12631017
    12641018  if (strncasecmp (REQUEST, "GetCapabilities", 15) == 0)
     
    12691023      xmlDocPtr doc = xmlNewDoc (BAD_CAST "1.0");
    12701024      xmlNodePtr n=printGetCapabilitiesHeader(doc,m,(version!=NULL?version->value:"1.0.0"));
     1025      CapabilitiesAllProcess(m,n);
    12711026      /**
    12721027       * Here we need to close stdout to ensure that unsupported chars
    12731028       * has been found in the zcfg and then printed on stdout
    12741029       */
     1030      /*
    12751031      int saved_stdout = dup (fileno (stdout));
    12761032      dup2 (fileno (stderr), fileno (stdout));
     
    12921048      fflush (stdout);
    12931049      dup2 (saved_stdout, fileno (stdout));
     1050      */
    12941051      printDocument (m, doc, getpid ());
    12951052      freeMaps (&m);
    12961053      free (m);
     1054      /*
    12971055      if(zooRegistry!=NULL){
    12981056        freeRegistry(&zooRegistry);
    12991057        free(zooRegistry);
    13001058      }
     1059*/
    13011060      free (REQUEST);
    13021061      free (SERVICE_URL);
     
    13131072          freeMaps (&m);
    13141073          free (m);
    1315           if(zooRegistry!=NULL){
    1316             freeRegistry(&zooRegistry);
    1317             free(zooRegistry);
    1318           }
    13191074          free (REQUEST);
    13201075          free (SERVICE_URL);
     
    13261081            freeMaps (&m);
    13271082            free (m);
    1328             if(zooRegistry!=NULL){
    1329               freeRegistry(&zooRegistry);
    1330               free(zooRegistry);
    1331             }
    13321083            free (REQUEST);
    13331084            free (SERVICE_URL);
     
    13481099            freeMaps (&m);
    13491100            free (m);
    1350             if(zooRegistry!=NULL){
    1351               freeRegistry(&zooRegistry);
    1352               free(zooRegistry);
    1353             }
    13541101            free (REQUEST);
    13551102            free (SERVICE_URL);
     
    13711118            char *orig = zStrdup (r_inputs->value);
    13721119
    1373             int saved_stdout = dup (fileno (stdout));
    1374             dup2 (fileno (stderr), fileno (stdout));
    1375             if (strcasecmp ("all", orig) == 0)
    1376               {
    1377                 if (int res =
    1378                     recursReaddirF (m, zooRegistry, n, conf_dir, NULL, saved_stdout, 0,
    1379                                     printDescribeProcessForProcess) < 0)
    1380                   return res;
    1381               }
    1382             else
    1383               {
    1384                 char *saveptr;
    1385                 char *tmps = strtok_r (orig, ",", &saveptr);
    1386 
    1387                 char buff[256];
    1388                 char buff1[1024];
    1389                 while (tmps != NULL)
    1390                   {
    1391                     int hasVal = -1;
    1392                     char *corig = zStrdup (tmps);
    1393                     if (strstr (corig, ".") != NULL)
    1394                       {
    1395 
    1396                         parseIdentifier (m, conf_dir, corig, buff1);
    1397                         map *tmpMap = getMapFromMaps (m, "lenv", "metapath");
    1398                         if (tmpMap != NULL)
    1399                           addToMap (request_inputs, "metapath", tmpMap->value);
    1400                         map *tmpMapI = getMapFromMaps (m, "lenv", "Identifier");
    1401 
    1402                         s1 = (service *) malloc (SERVICE_SIZE);
    1403                         t = readServiceFile (m, buff1, &s1, tmpMapI->value);
    1404                         if (t < 0)
    1405                           {
    1406                             map *tmp00 = getMapFromMaps (m, "lenv", "message");
    1407                             char tmp01[1024];
    1408                             if (tmp00 != NULL)
    1409                               sprintf (tmp01,
    1410                                        _
    1411                                        ("Unable to parse the ZCFG file for the following ZOO-Service: %s. Message: %s"),
    1412                                        tmps, tmp00->value);
    1413                             else
    1414                               sprintf (tmp01,
    1415                                        _
    1416                                        ("Unable to parse the ZCFG file for the following ZOO-Service: %s."),
    1417                                        tmps);
    1418                             dup2 (saved_stdout, fileno (stdout));
    1419                             errorException (m, tmp01, "InvalidParameterValue",
    1420                                             "identifier");
    1421                             freeMaps (&m);
    1422                             free (m);
    1423                             if(zooRegistry!=NULL){
    1424                               freeRegistry(&zooRegistry);
    1425                               free(zooRegistry);
    1426                             }
    1427                             free (REQUEST);
    1428                             free (corig);
    1429                             free (orig);
    1430                             free (SERVICE_URL);
    1431                             free (s1);
    1432                             closedir (dirp);
    1433                             xmlFreeDoc (doc);
    1434                             xmlCleanupParser ();
    1435                             zooXmlCleanupNs ();
    1436                             return 1;
    1437                           }
    1438 #ifdef DEBUG
    1439                         dumpService (s1);
    1440 #endif
    1441                         inheritance(zooRegistry,&s1);
    1442                         printDescribeProcessForProcess (m, n, s1);
    1443                         freeService (&s1);
    1444                         free (s1);
    1445                         s1 = NULL;
    1446                         scount++;
    1447                         hasVal = 1;
    1448                         setMapInMaps (m, "lenv", "level", "0");
    1449                       }
    1450                     else
    1451                       {
    1452                         memset (buff, 0, 256);
    1453                         snprintf (buff, 256, "%s.zcfg", corig);
    1454                         memset (buff1, 0, 1024);
    1455 #ifdef DEBUG
    1456                         printf ("\n#######%s\n########\n", buff);
    1457 #endif
    1458                         while ((dp = readdir (dirp)) != NULL)
    1459                           {
    1460                             if (strcasecmp (dp->d_name, buff) == 0)
    1461                               {
    1462                                 memset (buff1, 0, 1024);
    1463                                 snprintf (buff1, 1024, "%s/%s", conf_dir,
    1464                                           dp->d_name);
    1465                                 s1 = (service *) malloc (SERVICE_SIZE);
    1466                                 if (s1 == NULL)
    1467                                   {
    1468                                     dup2 (saved_stdout, fileno (stdout));
    1469                                     return errorException (m,
    1470                                                            _
    1471                                                            ("Unable to allocate memory."),
    1472                                                            "InternalError",
    1473                                                            NULL);
    1474                                   }
    1475 #ifdef DEBUG
    1476                                 printf
    1477                                   ("#################\n(%s) %s\n#################\n",
    1478                                    r_inputs->value, buff1);
    1479 #endif
    1480                                 char *tmp0 = zStrdup (dp->d_name);
    1481                                 tmp0[strlen (tmp0) - 5] = 0;
    1482                                 t = readServiceFile (m, buff1, &s1, tmp0);
    1483                                 free (tmp0);
    1484                                 if (t < 0)
    1485                                   {
    1486                                     map *tmp00 =
    1487                                       getMapFromMaps (m, "lenv", "message");
    1488                                     char tmp01[1024];
    1489                                     if (tmp00 != NULL)
    1490                                       sprintf (tmp01,
    1491                                                _
    1492                                                ("Unable to parse the ZCFG file: %s (%s)"),
    1493                                                dp->d_name, tmp00->value);
    1494                                     else
    1495                                       sprintf (tmp01,
    1496                                                _
    1497                                                ("Unable to parse the ZCFG file: %s."),
    1498                                                dp->d_name);
    1499                                     dup2 (saved_stdout, fileno (stdout));
    1500                                     errorException (m, tmp01, "InternalError",
    1501                                                     NULL);
    1502                                     freeMaps (&m);
    1503                                     free (m);
    1504                                     if(zooRegistry!=NULL){
    1505                                       freeRegistry(&zooRegistry);
    1506                                       free(zooRegistry);
    1507                                     }
    1508                                     free (orig);
    1509                                     free (REQUEST);
    1510                                     closedir (dirp);
    1511                                     xmlFreeDoc (doc);
    1512                                     xmlCleanupParser ();
    1513                                     zooXmlCleanupNs ();
    1514                                     return 1;
    1515                                   }
    1516 #ifdef DEBUG
    1517                                 dumpService (s1);
    1518 #endif
    1519                                 inheritance(zooRegistry,&s1);
    1520                                 printDescribeProcessForProcess (m, n, s1);
    1521                                 freeService (&s1);
    1522                                 free (s1);
    1523                                 s1 = NULL;
    1524                                 scount++;
    1525                                 hasVal = 1;
    1526                               }
    1527                           }
    1528                       }
    1529                     if (hasVal < 0)
    1530                       {
    1531                         map *tmp00 = getMapFromMaps (m, "lenv", "message");
    1532                         char tmp01[1024];
    1533                         if (tmp00 != NULL)
    1534                           sprintf (tmp01,
    1535                                    _("Unable to parse the ZCFG file: %s (%s)"),
    1536                                    buff, tmp00->value);
    1537                         else
    1538                           sprintf (tmp01,
    1539                                    _("Unable to parse the ZCFG file: %s."),
    1540                                    buff);
    1541                         dup2 (saved_stdout, fileno (stdout));
    1542                         errorException (m, tmp01, "InvalidParameterValue",
    1543                                         "Identifier");
    1544                         freeMaps (&m);
    1545                         free (m);
    1546                         if(zooRegistry!=NULL){
    1547                           freeRegistry(&zooRegistry);
    1548                           free(zooRegistry);
    1549                         }
    1550                         free (orig);
    1551                         free (REQUEST);
    1552                         closedir (dirp);
    1553                         xmlFreeDoc (doc);
    1554                         xmlCleanupParser ();
    1555                         zooXmlCleanupNs ();
    1556                         return 1;
    1557                       }
    1558                     rewinddir (dirp);
    1559                     tmps = strtok_r (NULL, ",", &saveptr);
    1560                     if (corig != NULL)
    1561                       free (corig);
    1562                   }
    1563               }
    1564             closedir (dirp);
     1120        DescribeProcess(m,n,orig);
    15651121            fflush (stdout);
     1122        int saved_stdout;
    15661123            dup2 (saved_stdout, fileno (stdout));
    15671124            free (orig);
     
    15691126            freeMaps (&m);
    15701127            free (m);
    1571             if(zooRegistry!=NULL){
    1572               freeRegistry(&zooRegistry);
    1573               free(zooRegistry);
    1574             }
    15751128            free (REQUEST);
    15761129            free (SERVICE_URL);
     
    16231176            freeMaps (&m);
    16241177            free (m);
    1625             if(zooRegistry!=NULL){
    1626               freeRegistry(&zooRegistry);
    1627               free(zooRegistry);
    1628             }
    16291178            free (REQUEST);
    16301179            free (SERVICE_URL);
     
    16431192    freeMaps (&m);
    16441193    free (m);
    1645     if(zooRegistry!=NULL){
    1646       freeRegistry(&zooRegistry);
    1647       free(zooRegistry);
    1648     }
    16491194    free (REQUEST);
    16501195    free (SERVICE_URL);
     
    16541199 
    16551200  s1 = NULL;
    1656   s1 = (service *) malloc (SERVICE_SIZE);
     1201  r_inputs = getMap (request_inputs, "Identifier");
     1202  s1 = search_service (r_inputs->value);
     1203 int saved_stdout = dup (fileno (stdout));
     1204 
     1205 
    16571206  if (s1 == NULL)
    1658     {
    1659       freeMaps (&m);
    1660       free (m);
    1661       if(zooRegistry!=NULL){
    1662         freeRegistry(&zooRegistry);
    1663         free(zooRegistry);
    1664       }
    1665       free (REQUEST);
    1666       free (SERVICE_URL);
    1667       return errorException (m, _("Unable to allocate memory."),
    1668                              "InternalError", NULL);
    1669     }
    1670 
    1671   r_inputs = getMap (request_inputs, "MetaPath");
    1672   if (r_inputs != NULL)
    1673     snprintf (tmps1, 1024, "%s/%s", ntmp, r_inputs->value);
    1674   else
    1675     snprintf (tmps1, 1024, "%s/", ntmp);
    1676   r_inputs = getMap (request_inputs, "Identifier");
    1677   char *ttmp = zStrdup (tmps1);
    1678   snprintf (tmps1, 1024, "%s/%s.zcfg", ttmp, r_inputs->value);
    1679   free (ttmp);
    1680 #ifdef DEBUG
    1681   fprintf (stderr, "Trying to load %s\n", tmps1);
    1682 #endif
    1683   if (strstr (r_inputs->value, ".") != NULL)
    1684     {
    1685       char *identifier = zStrdup (r_inputs->value);
    1686       parseIdentifier (m, conf_dir, identifier, tmps1);
    1687       map *tmpMap = getMapFromMaps (m, "lenv", "metapath");
    1688       if (tmpMap != NULL)
    1689         addToMap (request_inputs, "metapath", tmpMap->value);
    1690       free (identifier);
    1691     }
    1692   else
    1693     {
    1694       setMapInMaps (m, "lenv", "Identifier", r_inputs->value);
    1695       setMapInMaps (m, "lenv", "oIdentifier", r_inputs->value);
    1696     }
    1697 
    1698   r_inputs = getMapFromMaps (m, "lenv", "Identifier");
    1699   int saved_stdout = dup (fileno (stdout));
    1700   dup2 (fileno (stderr), fileno (stdout));
    1701   t = readServiceFile (m, tmps1, &s1, r_inputs->value);
    1702   inheritance(zooRegistry,&s1);
    1703   if(zooRegistry!=NULL){
    1704     freeRegistry(&zooRegistry);
    1705     free(zooRegistry);
    1706   }
    1707   fflush (stdout);
    1708   dup2 (saved_stdout, fileno (stdout));
    1709   if (t < 0)
    17101207    {
    17111208      char *tmpMsg = (char *) malloc (2048 + strlen (r_inputs->value));
     
    17161213      errorException (m, tmpMsg, "InvalidParameterValue", "identifier");
    17171214      free (tmpMsg);
    1718       free (s1);
    17191215      freeMaps (&m);
    17201216      free (m);
     
    17581254    free (SERVICE_URL);
    17591255    InternetCloseHandle (&hInternet);
    1760     freeService (&s1);
    1761     free (s1);
    17621256    return 0;
    17631257  }
     
    18411335                        ("The status parameter cannot be set to true if storeExecuteResponse is set to false. Please modify your request parameters."),
    18421336                        "InvalidParameterValue", "storeExecuteResponse");
    1843         freeService (&s1);
     1337        //freeService (&s1);
    18441338        free (s1);
    18451339        freeMaps (&m);
     
    18711365          freeMaps (&m);
    18721366          free (m);
    1873           if(zooRegistry!=NULL){
    1874             freeRegistry(&zooRegistry);
    1875             free(zooRegistry);
    1876           }
    18771367          freeMaps (&request_input_real_format);
    18781368          free (request_input_real_format);
     
    20571547    {
    20581548      if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,&hInternet)<0){
    2059         freeService (&s1);
    20601549        free (s1);
    20611550        freeMaps (&m);
     
    22171706
    22181707          if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,&hInternet)<0){
    2219             freeService (&s1);
     1708            //freeService (&s1);
    22201709            free (s1);
    22211710            freeMaps (&m);
     
    23311820    }
    23321821
    2333   freeService (&s1);
     1822  //freeService (&s1);
    23341823  free (s1);
    23351824  freeMaps (&m);
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png