- Timestamp:
- Nov 5, 2014, 4:58:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/zoo_service_loader.c
r524 r531 38 38 #include <libxml/xpathInternals.h> 39 39 #include "service_zcfg.h" 40 #include <libgen.h> 40 41 } 41 42 #include "ulinet.h" … … 211 212 } 212 213 214 /** 213 215 int 214 216 recursReaddirF (maps * m, xmlNodePtr n, char *conf_dir, char *prefix, … … 334 336 return 1; 335 337 } 336 338 **/ 337 339 xmlXPathObjectPtr 338 340 extractFromDoc (xmlDocPtr doc, const char *search) … … 408 410 */ 409 411 map *r_inputs = NULL; 410 #ifndef WIN32411 getcwd (ntmp, 1024);412 #else413 _getcwd (ntmp, 1024);414 #endif415 412 r_inputs = getMap (s1->content, "serviceType"); 416 413 #ifdef DEBUG … … 421 418 && strncasecmp (r_inputs->value, "C", 1) == 0) 422 419 { 423 r_inputs = getMap (request_inputs, "metapath"); 424 if (r_inputs != NULL) 425 sprintf (tmps1, "%s/%s", ntmp, r_inputs->value); 426 else 427 sprintf (tmps1, "%s/", ntmp); 428 char *altPath = zStrdup (tmps1); 420 char *tmp_path = 421 (char *) malloc ((strlen (s1->zcfg) + 1) * sizeof (char *)); 422 sprintf (tmp_path, "%s", s1->zcfg); 423 char *dir = dirname (tmp_path); 429 424 r_inputs = getMap (s1->content, "ServiceProvider"); 430 sprintf (tmps1, "%s/%s", altPath, r_inputs->value);431 free ( altPath);425 sprintf (tmps1, "%s/%s", dir, r_inputs->value); 426 free (tmp_path); 432 427 #ifdef DEBUG 433 428 fprintf (stderr, "Trying to load %s\n", tmps1); … … 1264 1259 sprintf (tmpMsg, 1265 1260 _ 1266 ("The value for <i ndetifier> seems to be wrong (%s). Please, ensure that the process exist using the GetCapabilities request."),1261 ("The value for <identifier> seems to be wrong (%s). Please, ensure that the process exist using the GetCapabilities request."), 1267 1262 r_inputs->value); 1268 1263 errorException (m, tmpMsg, "InvalidParameterValue", "identifier"); 1269 1264 free (tmpMsg); 1270 free (s1);1265 //free (s1); 1271 1266 freeMaps (&m); 1272 1267 free (m); … … 1460 1455 InternetCloseHandle (&hInternet); 1461 1456 //freeService (&s1); 1462 free (s1);1457 //free (s1); 1463 1458 return 0; 1464 1459 } … … 1624 1619 InternetCloseHandle (&hInternet); 1625 1620 //freeService (&s1); 1626 free (s1);1621 //free (s1); 1627 1622 return 0; 1628 1623 } … … 1646 1641 InternetCloseHandle (&hInternet); 1647 1642 //freeService (&s1); 1648 free (s1);1643 //free (s1); 1649 1644 return 0; 1650 1645 } … … 1681 1676 InternetCloseHandle (&hInternet); 1682 1677 //freeService (&s1); 1683 free (s1);1678 //free (s1); 1684 1679 return 0; 1685 1680 } … … 1749 1744 { 1750 1745 xmlChar *val = xmlNodeListGetString (doc, 1751 cur2-> 1752 xmlChildrenNode, 1746 cur2->xmlChildrenNode, 1753 1747 1); 1754 1748 if (tmpmaps == NULL) … … 1779 1773 { 1780 1774 xmlChar *val = xmlNodeListGetString (doc, 1781 cur2-> 1782 xmlChildrenNode, 1775 cur2->xmlChildrenNode, 1783 1776 1); 1784 1777 if (tmpmaps == NULL) … … 1866 1859 InternetCloseHandle (&hInternet); 1867 1860 //freeService (&s1); 1868 free (s1);1861 //free (s1); 1869 1862 return 0; 1870 1863 } … … 2216 2209 { 2217 2210 xmlChar *mv = xmlNodeListGetString (doc, 2218 cur4->xmlChildrenNode, 2211 cur4-> 2212 xmlChildrenNode, 2219 2213 1); 2220 2214 map *ltmp = getMap (tmpmaps->content, … … 2262 2256 { 2263 2257 xmlChar *tmp = xmlNodeListGetRawString (doc, 2264 cur4->xmlChildrenNode, 2258 cur4-> 2259 xmlChildrenNode, 2265 2260 0); 2266 2261 addToMap (tmpmaps->content, … … 2331 2326 InternetCloseHandle (&hInternet); 2332 2327 //freeService (&s1); 2333 free (s1);2328 //free (s1); 2334 2329 return 0; 2335 2330 } … … 2429 2424 { 2430 2425 xmlChar *val = xmlNodeListGetString (NULL, 2431 cur2-> 2432 xmlChildrenNode, 2426 cur2->xmlChildrenNode, 2433 2427 1); 2434 2428 free (tmpmaps->name); … … 2517 2511 { 2518 2512 xmlChar *val = xmlNodeListGetString (doc, 2519 cur1-> 2520 xmlChildrenNode, 2513 cur1->xmlChildrenNode, 2521 2514 1); 2522 2515 if (tmpmaps == NULL) … … 2578 2571 { 2579 2572 xmlChar *val = xmlNodeListGetString (doc, 2580 cur1-> 2581 xmlChildrenNode, 2573 cur1->xmlChildrenNode, 2582 2574 1); 2583 2575 if (tmpmaps == NULL) … … 2655 2647 { 2656 2648 xmlChar *val = xmlNodeListGetString (doc, 2657 cur2->xmlChildrenNode, 2649 cur2-> 2650 xmlChildrenNode, 2658 2651 1); 2659 2652 if (tmpmaps == NULL) … … 2695 2688 { 2696 2689 xmlChar *val = xmlNodeListGetString (doc, 2697 cur2->xmlChildrenNode, 2690 cur2-> 2691 xmlChildrenNode, 2698 2692 1); 2699 2693 if (tmpmaps == NULL) … … 2797 2791 printExceptionReportResponse (m, tmpe); 2798 2792 //freeService (&s1); 2799 free (s1);2793 //free (s1); 2800 2794 freeMap (&tmpe); 2801 2795 free (tmpe); … … 3027 3021 "InvalidParameterValue", "storeExecuteResponse"); 3028 3022 //freeService (&s1); 3029 free (s1);3023 //free (s1); 3030 3024 freeMaps (&m); 3031 3025 free (m); … … 3349 3343 3350 3344 //freeService (&s1); 3351 free (s1);3345 //free (s1); 3352 3346 freeMaps (&m); 3353 3347 free (m);
Note: See TracChangeset
for help on using the changeset viewer.