Changeset 784 for trunk/zoo-project/zoo-kernel/zoo_service_loader.c
- Timestamp:
- Jun 29, 2016, 3:40:46 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r781 r784 415 415 */ 416 416 map *r_inputs = NULL; 417 map* cwdMap=getMapFromMaps(m,"main","servicePath"); 418 if(cwdMap!=NULL){ 419 sprintf(ntmp,"%s",cwdMap->value); 420 }else{ 417 421 #ifndef WIN32 418 getcwd (ntmp, 1024);422 getcwd (ntmp, 1024); 419 423 #else 420 _getcwd (ntmp, 1024); 421 #endif 424 _getcwd (ntmp, 1024); 425 #endif 426 } 422 427 r_inputs = getMap (s1->content, "serviceType"); 423 428 #ifdef DEBUG … … 915 920 } 916 921 char ntmp[1024]; 922 #ifndef ETC_DIR 917 923 #ifndef WIN32 918 924 getcwd (ntmp, 1024); … … 920 926 _getcwd (ntmp, 1024); 921 927 #endif 928 #else 929 sprintf(ntmp,"%s",ETC_DIR); 930 #endif 922 931 r_inputs = getMapOrFill (&request_inputs, "metapath", ""); 923 932 924 933 char conf_file[10240]; 925 934 snprintf (conf_file, 10240, "%s/%s/main.cfg", ntmp, r_inputs->value); 935 #ifdef ETC_DIR 936 #ifndef WIN32 937 getcwd (ntmp, 1024); 938 #else 939 _getcwd (ntmp, 1024); 940 #endif 941 #endif 926 942 if (conf_read (conf_file, m) == 2) 927 943 { … … 945 961 else 946 962 { 947 bindtextdomain ("zoo-kernel", "/usr/share/locale/");948 bindtextdomain ("zoo-services", "/usr/share/locale/");963 bindtextdomain ("zoo-kernel", LOCALEDIR); 964 bindtextdomain ("zoo-services", LOCALEDIR); 949 965 } 950 966 … … 1186 1202 r_inputs = NULL; 1187 1203 r_inputs = getMap (request_inputs, "metapath"); 1188 1204 map* cwdMap0=getMapFromMaps(m,"main","servicePath"); 1189 1205 if (r_inputs != NULL) 1190 snprintf (conf_dir, 1024, "%s/%s", ntmp, r_inputs->value); 1206 if(cwdMap0!=NULL) 1207 snprintf (conf_dir, 1024, "%s/%s", cwdMap0->value, r_inputs->value); 1208 else 1209 snprintf (conf_dir, 1024, "%s/%s", ntmp, r_inputs->value); 1191 1210 else 1192 snprintf (conf_dir, 1024, "%s", ntmp); 1193 1211 if(cwdMap0!=NULL) 1212 snprintf (conf_dir, 1024, "%s", cwdMap0->value); 1213 else 1214 snprintf (conf_dir, 1024, "%s", ntmp); 1194 1215 map* reg = getMapFromMaps (m, "main", "registry"); 1195 1216 registry* zooRegistry=NULL; … … 1292 1313 { 1293 1314 errorException (m, _("The specified path does not exist."), 1294 "In validParameterValue", conf_dir);1315 "InternalError", NULL); 1295 1316 freeMaps (&m); 1296 1317 free (m); … … 1617 1638 } 1618 1639 1619 r_inputs = getMap (request_inputs, "MetaPath");1620 if (r_inputs != NULL)1621 snprintf (tmps1, 1024, "%s/%s", ntmp, r_inputs->value);1622 else1623 snprintf (tmps1, 1024, "%s/", ntmp);1624 1640 r_inputs = getMap (request_inputs, "Identifier"); 1625 char *ttmp = zStrdup (tmps1); 1626 snprintf (tmps1, 1024, "%s/%s.zcfg", ttmp, r_inputs->value); 1627 free (ttmp); 1641 snprintf (tmps1, 1024, "%s/%s.zcfg", conf_dir, r_inputs->value); 1628 1642 #ifdef DEBUG 1629 1643 fprintf (stderr, "Trying to load %s\n", tmps1); … … 1862 1876 * - message : is a string where you can store error messages, in case 1863 1877 * service is failing, or o provide details on the ongoing operation. 1864 * - cwd : is the current working directory1878 * - cwd : the current working directory or servicePath if defined 1865 1879 * - soap : is a boolean value, true if the request was contained in a SOAP 1866 1880 * Envelop … … 1888 1902 free(tmpUuid); 1889 1903 addToMap (_tmpMaps->content, "status", "0"); 1890 addToMap (_tmpMaps->content, "cwd", ntmp); 1904 if(cwdMap0!=NULL){ 1905 addToMap (_tmpMaps->content, "cwd", cwdMap0->value); 1906 addToMap (_tmpMaps->content, "rcwd", ntmp); 1907 } 1908 else 1909 addToMap (_tmpMaps->content, "cwd", ntmp); 1891 1910 addToMap (_tmpMaps->content, "message", _("No message provided")); 1892 1911 map *ltmp = getMap (request_inputs, "soap");
Note: See TracChangeset
for help on using the changeset viewer.