Changeset 896 for branches/prototype-v0/zoo-project/zoo-kernel
- Timestamp:
- Feb 25, 2019, 1:57:11 PM (6 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-kernel
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/response_print.c
r890 r896 1776 1776 * @param outputs the outputs generated by the service 1777 1777 */ 1778 void printProcessResponse(maps* m,map* request, int pid,service* serv,const char* service,int status,maps* inputs,maps* outputs){ 1778 void printProcessResponse(maps* m,map* request, int pid,service* serv,const char* service,int status,maps* inputs,maps* outputs){ 1779 1779 xmlNsPtr ns,ns_ows,ns_xlink; 1780 1780 xmlNodePtr nr,n,nc,nc1=NULL,nc3; … … 1797 1797 char stored_path[1024]; 1798 1798 memset(stored_path,0,1024); 1799 1799 1800 1800 if(vid==0){ 1801 1801 char tmp[256]; … … 1982 1982 } 1983 1983 } 1984 1984 1985 1985 /** 1986 1986 * Display the process output only when requested ! … … 1993 1993 maps* mcursor=outputs; 1994 1994 elements* scursor=serv->outputs; 1995 map* testResponse=getMap(request,"RawDataOutput"); 1995 map* testResponse=getMap(request,"RawDataOutput"); 1996 1996 if(testResponse==NULL) 1997 1997 testResponse=getMap(request,"ResponseDocument"); 1998 while(mcursor!=NULL){ 1998 while(mcursor!=NULL){ 1999 1999 map* tmp0=getMap(mcursor->content,"inRequest"); 2000 scursor=getElements(serv->outputs,mcursor->name); 2001 if(scursor!=NULL){ 2002 if(testResponse==NULL || tmp0==NULL){ 2000 scursor=getElements(serv->outputs,mcursor->name); 2001 if(scursor!=NULL){ 2002 if(testResponse==NULL || tmp0==NULL){ 2003 2003 if(vid==0) 2004 2004 printIOType(doc,nc,ns,ns_ows,ns_xlink,scursor,mcursor,"Output",vid); … … 2007 2007 } 2008 2008 else 2009 if(tmp0!=NULL && strncmp(tmp0->value,"true",4)==0){ 2009 if(tmp0!=NULL && strncmp(tmp0->value,"true",4)==0){ 2010 2010 if(vid==0) 2011 2011 printIOType(doc,nc,ns,ns_ows,ns_xlink,scursor,mcursor,"Output",vid); 2012 2012 else 2013 2013 printIOType(doc,n,ns,ns_ows,ns_xlink,scursor,mcursor,"Output",vid); 2014 } 2014 } 2015 2015 }else 2016 2016 /** … … 2023 2023 printIOType(doc,n,ns,ns_ows,ns_xlink,scursor,mcursor,"Output",vid); 2024 2024 mcursor=mcursor->next; 2025 } 2025 } 2026 2026 if(vid==0) 2027 2027 xmlAddChild(n,nc); 2028 } 2029 2028 } 2030 2029 if(vid==0 && 2031 2030 hasStoredExecuteResponse==true … … 2176 2175 * @param type the type 2177 2176 */ 2178 void printIOType(xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_wps,xmlNsPtr ns_ows,xmlNsPtr ns_xlink,elements* e,maps* m,const char* type,int vid){ 2179 2177 void printIOType(xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_wps,xmlNsPtr ns_ows,xmlNsPtr ns_xlink,elements* e,maps* m,const char* type,int vid){ 2180 2178 xmlNodePtr nc1,nc2,nc3; 2181 2179 nc1=xmlNewNode(ns_wps, BAD_CAST type); … … 2184 2182 tmp=e->content; 2185 2183 else 2186 tmp=m->content; 2187 2184 tmp=m->content; 2188 2185 if(vid==0){ 2189 2186 nc2=xmlNewNode(ns_ows, BAD_CAST "Identifier"); … … 2225 2222 xmlNewProp(nc1,BAD_CAST "id",BAD_CAST (e!=NULL?e->name:m->name)); 2226 2223 } 2227 2224 2228 2225 // IO type nested outputs 2229 if(m->child!=NULL){ 2226 if(m->child!=NULL){ 2230 2227 maps* curs=m->child; 2231 2228 elements* ecurs=getElements(e,(e!=NULL?e->name:m->name)); … … 2241 2238 } 2242 2239 } 2243 else{ 2240 else{ 2244 2241 map *tmpMap=getMap(m->content,"Reference"); 2245 if(tmpMap==NULL){ 2242 if(tmpMap==NULL){ 2246 2243 nc2=xmlNewNode(ns_wps, BAD_CAST "Data"); 2247 if(e!=NULL && e->format!=NULL){ 2248 if(strncasecmp(e->format,"LiteralOutput",strlen(e->format))==0)2249 nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData");2244 if(e!=NULL && e->format!=NULL){ 2245 if (strncasecmp(e->format, "LiteralOutput", strlen(e->format)) == 0) 2246 nc3 = xmlNewNode(ns_wps, BAD_CAST "LiteralData"); 2250 2247 else 2251 2248 if(strncasecmp(e->format,"ComplexOutput",strlen(e->format))==0) … … 2254 2251 nc3=xmlNewNode(ns_wps, BAD_CAST "BoundingBoxData"); 2255 2252 else 2256 nc3=xmlNewNode(ns_wps, BAD_CAST e->format); 2257 } 2258 else { 2259 map* tmpV=getMapFromMaps(m,"format","value"); 2253 nc3=xmlNewNode(ns_wps, BAD_CAST e->format); 2254 } 2255 else { 2256 map* tmpV=getMapFromMaps(m,"format","value"); 2260 2257 if(tmpV!=NULL) 2261 2258 nc3=xmlNewNode(ns_wps, BAD_CAST tmpV->value); … … 2263 2260 nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData"); 2264 2261 } 2265 tmp=m->content; 2266 2262 tmp=m->content; 2263 2267 2264 while(tmp!=NULL){ 2268 2265 if(strcasecmp(tmp->name,"mimeType")==0 || … … 2270 2267 strcasecmp(tmp->name,"schema")==0 || 2271 2268 strcasecmp(tmp->name,"datatype")==0 || 2272 strcasecmp(tmp->name,"uom")==0) { 2273 2269 strcasecmp(tmp->name,"uom")==0) { 2274 2270 if(vid==0) 2275 2271 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); … … 2282 2278 } 2283 2279 } 2280 2284 2281 if(vid==0) 2285 2282 xmlAddChild(nc2,nc3); 2286 tmp=tmp->next; 2283 tmp=tmp->next; 2287 2284 } 2288 2285 if(e!=NULL && e->format!=NULL && strcasecmp(e->format,"BoundingBoxData")==0) { … … 2295 2292 } 2296 2293 } 2297 else { 2298 if(e!=NULL) 2299 tmp=getMap(e->defaults->content,"mimeType"); 2294 else { 2295 //if (e != NULL) { 2296 if (e != NULL && e->defaults != NULL) { // knut: add extra NULL pointer check in case user omits <Default> block in config file 2297 tmp = getMap(e->defaults->content, "mimeType"); 2298 } 2300 2299 else 2301 tmp=NULL; 2302 2300 tmp=NULL; 2303 2301 map* tmp1=getMap(m->content,"encoding"); 2304 2302 map* tmp2=getMap(m->content,"mimeType"); … … 2640 2638 dumpMaps(request_outputs); 2641 2639 fprintf(stderr,"printProcessResponse\n"); 2642 #endif 2640 #endif 2643 2641 map* toto=getMap(request_inputs1,"RawDataOutput"); 2644 2642 int asRaw=0; … … 2727 2725 } 2728 2726 2729 if(res!=SERVICE_SUCCEEDED){ 2727 if(res!=SERVICE_SUCCEEDED){ 2730 2728 printProcessResponse(m,request_inputs1,cpid, 2731 2729 s, s->name,res, // replace serviceProvider with serviceName in stored response file name … … 2734 2732 return; 2735 2733 } 2736 2737 2734 2738 2735 map *tmp1=getMapFromMaps(m,"main","tmpPath"); 2739 2736 if(asRaw==0){ … … 2757 2754 #endif 2758 2755 map *gfile=getMap(tmpI->content,"generated_file"); 2759 char *file_name=NULL; 2756 char *file_name=NULL; 2760 2757 if(gfile!=NULL){ 2761 2758 gfile=getMap(tmpI->content,"expected_generated_file"); … … 2765 2762 readGeneratedFile(m,tmpI->content,gfile->value); 2766 2763 file_name=zStrdup((gfile->value)+strlen(tmp1->value)); 2767 } 2764 } 2768 2765 toto=getMap(tmpI->content,"asReference"); 2769 2766 #ifdef USE_MS … … 2776 2773 if(toto!=NULL && strcasecmp(toto->value,"true")==0) 2777 2774 #endif 2778 { 2775 { 2779 2776 elements* in=getElements(s->outputs,tmpI->name); 2780 2777 if(in==NULL && s->outputs->child!=NULL){ … … 2791 2788 addToMap(tmpI->content,"encoding","UTF-8"); 2792 2789 addToMap(tmpI->content,"schema","http://schemas.opengis.net/ows/1.1.0/owsCommon.xsd"); 2793 } 2794 2790 } 2795 2791 char *file_path=NULL; 2796 2792 if(gfile==NULL) { … … 2880 2876 } 2881 2877 } 2882 #endif 2878 #endif 2883 2879 if(file_name!=NULL){ 2884 2880 free(file_name); … … 2896 2892 fprintf(stderr,"SERVICE : %s\n",s->name); 2897 2893 dumpMaps(m); 2898 #endif 2894 #endif 2899 2895 if(error<0) 2900 2896 printProcessResponse(m,request_inputs1,cpid, -
branches/prototype-v0/zoo-project/zoo-kernel/response_print.h
r880 r896 38 38 39 39 #include <libintl.h> 40 #include <xlocale.h> 40 //#include <xlocale.h> //#include <xlocale> 41 #include <locale.h> 42 41 43 /** 42 44 * ZOO-Kernel internal messages translation function … … 80 82 #endif 81 83 #ifndef WIN32 82 #include <locale.h> 84 //#include <locale.h> 85 #include <xlocale.h> // knut: this appears to be a non-standard header file that has been removed in newer versions of glibc; it may be sufficient to include <locale.h> (see above) 83 86 #endif 84 87 #include "ulinet.h" -
branches/prototype-v0/zoo-project/zoo-kernel/service.c
r890 r896 25 25 #include "service.h" 26 26 27 // knut: time utilities required for new log function (logMessage) 28 #include <ctime> 29 #include <chrono> 30 #include <process.h> 27 31 28 32 #if defined(_MSC_VER) && _MSC_VER < 1800 … … 507 511 */ 508 512 void addToMap(map* m,const char* n,const char* v){ 509 if(hasKey(m,n)==false){ 510 map* _cursor=m; 511 while(_cursor->next!=NULL){ 512 _cursor=_cursor->next; 513 } 514 _cursor->next=createMap(n,v); 515 } 516 else{ 517 map *tmp=getMap(m,n); 518 if(tmp->value!=NULL) 519 free(tmp->value); 520 tmp->value=zStrdup(v); 521 } 513 if (m != NULL) { // knut: add NULL-pointer check 514 if (hasKey(m, n) == false) { 515 map* _cursor = m; 516 while (_cursor->next != NULL) { 517 _cursor = _cursor->next; 518 } 519 _cursor->next = createMap(n, v); 520 } 521 else { 522 map *tmp = getMap(m, n); 523 if (tmp->value != NULL) 524 free(tmp->value); 525 tmp->value = zStrdup(v); 526 } 527 } 522 528 } 523 529 … … 1690 1696 m=&trorf; 1691 1697 } 1698 1699 /** 1700 * Verify that a map has a value 1701 * 1702 * @param map pointer to map that should be checked 1703 * @return true if map has a value or false if value is missing/empty/NULL 1704 */ 1705 bool nonempty(map* map) { 1706 return (map != NULL && map->value != NULL && strlen(map->value) > 0 && strcmp(map->value, "NULL") != 0); 1707 } 1708 1709 /** 1710 * Verify that a particular map value exists in a maps 1711 * data structure, and obtain that value 1712 * 1713 * @param source pointer to maps structure 1714 * @param node name of maps node to search 1715 * @param key name of map node to find 1716 * @param kvp address to the map* if it exists, otherwise NULL 1717 * @return true if map has a value or false if value is missing/NULL 1718 * 1719 * @note The map assigned to kvp is owned by the source maps 1720 */ 1721 bool hasvalue(maps* source, const char* node, const char* key, map** kvp) { 1722 *kvp = getMapFromMaps(source, node, key); 1723 return (*kvp != NULL && (*kvp)->value != NULL && 1724 strlen((*kvp)->value) > 0 && strcmp((*kvp)->value, "NULL") != 0); 1725 } 1726 1727 /* 1728 * Set error message in configuration maps 1729 * 1730 * @param conf reference to configuration maps 1731 * @param service name of service 1732 * @param exc WPSException code 1733 * @param message exception text (default: exception text in WPS specification) 1734 */ 1735 void setErrorMessage(maps*& conf, const char* service, WPSException exc, const char* message) { 1736 1737 if (message == NULL) { 1738 message = WPSExceptionText[exc]; 1739 } 1740 1741 size_t len = strlen(service) + strlen(": ") + strlen(message) + strlen(": ") + strlen(WPSExceptionCode[exc]) + 16; 1742 char* msg = (char*)malloc(len * sizeof(char)); 1743 1744 if (msg != NULL) { 1745 snprintf(msg, len * sizeof(char), "\n%s: %s: %s\n", service, message, WPSExceptionCode[exc]); 1746 setMapInMaps(conf, "lenv", "message", msg); 1747 free(msg); 1748 } 1749 } 1750 1751 void logMessage(const char* source, const char* function, int line, const char* file, const char* message) { //, const char* source, const char* function, int line) { 1752 1753 size_t msglen = 512; 1754 const char empty[] = ""; 1755 1756 FILE* log; 1757 1758 // system time, process time [nanoseconds] 1759 unsigned long long sys_t, proc_t; 1760 1761 // processor time consumed by the program: 1762 clock_t t = clock(); 1763 1764 // system time: 1765 std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); 1766 1767 std::time_t now_t = std::chrono::system_clock::to_time_t(now); 1768 std::tm* tm = localtime(&now_t); 1769 char* str = asctime(tm); 1770 str[strlen(str) - 1] = '\0'; // remove newline 1771 1772 sys_t = std::chrono::duration_cast<std::chrono::nanoseconds>(now.time_since_epoch()).count(); 1773 //proc_t = (unsigned long long)(1.0e9*t/CLOCKS_PER_SEC); 1774 proc_t = t; 1775 1776 if (message != NULL) { 1777 msglen += strlen(message); 1778 } 1779 else { 1780 message = empty; 1781 } 1782 //getLastErrorMessage(); // cgiScriptName 1783 char* text = (char*)malloc(sizeof(char)*msglen); 1784 1785 snprintf(text, msglen, "pid: %d %s line %d %s() %s systime: %lld ns ticks: %lld %s\n", 1786 _getpid(), source, line, function, str, sys_t, proc_t, message); // __FILE__ __LINE__ __func__ // 1787 1788 if (file != NULL && (log = fopen(file, "a+")) != NULL) { 1789 fputs(text, log); 1790 fclose(log); 1791 } 1792 else { 1793 #ifdef MSG_LOG_FILE 1794 if ((log = fopen(MSG_LOG_FILE, "a+")) != NULL) { 1795 fputs(text, log); 1796 fclose(log); 1797 } 1798 #endif 1799 } 1800 1801 if (text != NULL) free(text); 1802 } 1803 1804 // knut: 1805 // Example: 1806 // zooLog; 1807 // zooLogMsg(NULL, getLastErrorMessage()); 1808 // zooLogMsg("log.txt", getLastErrorMessage()); -
branches/prototype-v0/zoo-project/zoo-kernel/service.h
r890 r896 32 32 #else 33 33 #define ZOO_DLL_EXPORT 34 #endif 35 36 // knut: add bool if necessary 37 #ifndef __cplusplus 38 #ifndef WIN32 39 #include <stdbool.h> 40 #else 41 typedef int bool; 42 #define false 0 43 #define true 1 44 #endif 45 #endif 46 #ifndef __bool_true_false_are_defined 47 #define __bool_true_false_are_defined 1 34 48 #endif 35 49 … … 229 243 #ifdef WIN32 230 244 #define NULLMAP ((map*) 0) 231 #define bool int 232 #define true 1 233 #define false 0 245 // knut: see new definition above 246 //#define bool int 247 //#define true 1 248 //#define false 0 234 249 #else 235 250 #define NULLMAP NULL … … 303 318 struct registry* next; //!< the next registry pointer 304 319 } registry; 320 321 // knut 322 enum WPSException { 323 /* 324 * StatusOK is not a WPS exception, it is added 325 * here for convenience. 326 */ 327 StatusOK, 328 /* 329 * See WPS 1.0 specification, Table 38 and Table 62. 330 */ 331 MissingParameterValue, 332 InvalidParameterValue, 333 NoApplicableCode, 334 NotEnoughStorage, 335 ServerBusy, 336 FileSizeExceeded, 337 StorageNotSupported, 338 VersionNegotiationFailed, 339 /* 340 * See WPS 2.0 specification, Tables 41, 46, 48, and 50. 341 */ 342 NoSuchProcess, 343 NoSuchMode, 344 NoSuchInput, 345 NoSuchOutput, 346 DataNotAccessible, 347 SizeExceeded, 348 TooManyInputs, 349 TooManyOutputs, 350 NoSuchFormat, 351 WrongInputData, 352 InternalServerError, 353 NoSuchJob, 354 ResultNotReady 355 }; 356 357 static const char* const WPSExceptionCode[] = { 358 "StatusOK", 359 "MissingParameterValue", 360 "InvalidParameterValue", 361 "NoApplicableCode", 362 "NotEnoughStorage", 363 "ServerBusy", 364 "FileSizeExceeded", 365 "StorageNotSupported", 366 "VersionNegotiationFailed", 367 "NoSuchProcess", 368 "NoSuchMode", 369 "NoSuchInput", 370 "NoSuchOutput", 371 "DataNotAccessible", 372 "SizeExceeded", 373 "TooManyInputs", 374 "TooManyOutputs", 375 "NoSuchFormat", 376 "WrongInputData", 377 "InternalServerError", 378 "NoSuchJob", 379 "ResultNotReady" 380 }; 381 382 static const char* const WPSExceptionText[] = { 383 "No problem detected", 384 "Operation request does not include a parameter value, and this server did not declare a default value for that parameter.", 385 "Operation request contains an invalid parameter value.", 386 "No other exceptionCode specified by this service and server applies to this exception.", 387 "The server does not have enough space available to store the inputs and outputs associated with the request.", 388 "The server is too busy to accept and queue the request at this time.", 389 "The file size of one of the input parameters was too large for this process to handle.", 390 "Execute operation request included transmission=”reference” for one of the outputs, but storage is not offered by this server.", 391 "Service version for a ComplexData xlink:href input was not supported by the referenced server, and version negotiation failed.", 392 "One of the identifiers passed does not match with any of the processes offered by this server.", 393 "The process does not permit the desired execution mode.", 394 "One or more of the input identifiers passed does not match with any of the input identifiers of this process.", 395 "One or more of the output identifiers passed does not match with any of the input identifiers of this process.", 396 "One of the referenced input data sets was inaccessible.", 397 "The size of one of the input parameters was too large for this process to handle.", 398 "Too many input items have been specified.", 399 "Too many output items have been specified.", 400 "One or more of the input or output formats specified in the request did not match with any of the formats defined for that particular input or output.", 401 "One or more of inputs for which the service was able to retrieve the data but could not read it.", 402 "", 403 "The JobID from the request does not match any of the Jobs running on this server.", 404 "The result for the requested JobID has not yet been generated." 405 }; 305 406 306 407 ZOO_DLL_EXPORT void _dumpMap(map*); … … 370 471 ZOO_DLL_EXPORT int snprintf(char *buffer, size_t n, const char *format, ...); 371 472 #endif 473 474 // knut: some new utility functions; logMessage is primarily intended for debugging 475 ZOO_DLL_EXPORT bool nonempty(map* map); 476 ZOO_DLL_EXPORT bool hasvalue(maps* source, const char* node, const char* key, map** kvp); 477 ZOO_DLL_EXPORT void setErrorMessage(maps*& conf, const char* service, WPSException exc, const char* message = NULL); 478 ZOO_DLL_EXPORT void logMessage(const char* source, const char* function, int line, const char* file = NULL, const char* message = NULL); 479 #define zooLogMsg(file,message) logMessage(__FILE__, __func__, __LINE__, (file), (message)) 480 #define zooLog logMessage(__FILE__, __func__, __LINE__) 481 372 482 #ifdef __cplusplus 373 483 } -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal.c
r890 r896 917 917 } 918 918 919 /** 920 * Check if file exists in specified folder 921 * 922 * @param dir the folder in which to search for file 923 * @param name the name of the file (not full path) 924 * @return a character string with the full path [dir/name], or NULL if the file does not exist 925 * 926 * @attention Caller is responsible for applying free() to the returned pointer 927 */ 928 char* file_exists(const char* dir, const char* name) { 929 char* d = (dir != NULL ? dir : "."); 930 if (name != NULL) { 931 size_t length = strlen(d) + strlen(name) + 2; // including file separator and \0 character 932 char* path = (char*)calloc(length, sizeof(char)); 933 snprintf(path, length, "%s/%s", d, name); 934 935 struct stat buffer; 936 if (stat(path, &buffer) != 0) { 937 free(path); 938 path = NULL; 939 } 940 return path; 941 } 942 else { 943 return NULL; 944 } 945 } -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal.h
r891 r896 38 38 39 39 #include <libintl.h> 40 #include < xlocale.h>40 #include <locale.h> 41 41 /** 42 42 * ZOO-Kernel internal messages translation function … … 162 162 ZOO_DLL_EXPORT int unlockShm(semid); 163 163 164 ZOO_DLL_EXPORT char* file_exists(const char* dir, const char* name); 165 164 166 #ifdef __cplusplus 165 167 } -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_mono.c
r794 r896 30 30 #include "response_print.h" 31 31 32 MonoClass *iclasses[4]; 33 MonoMethod *imethods[10]; 34 32 35 /** 33 36 * Load a Mono dll then run the static public method corresponding to the … … 69 72 mono_config_parse(NULL); 70 73 71 MonoDomain* monoDomain = mono_jit_init_version("ZOO_Embedded_Domain", 72 "v4.0.30319"); 73 74 map* cwdMap=getMapFromMaps(*main_conf,"main","servicePath"); 75 if(cwdMap==NULL) 76 cwdMap=getMapFromMaps(*main_conf,"lenv","cwd"); 77 78 char *zooAssembly=(char*)malloc((strlen(cwdMap->value)+11)*sizeof(char)); 79 sprintf(zooAssembly,"%s/ZMaps.dll",cwdMap->value); 80 assembly = mono_domain_assembly_open(monoDomain,zooAssembly); 81 if(assembly==NULL){ 82 setMapInMaps(*main_conf,"lenv","message",_("The ZMaps.dll assembly cannot be found!")); 83 return 4; 84 } 85 mono_add_internal_call ("ZOO_API::Translate", MonoTranslate); 86 mono_add_internal_call ("ZOO_API::UpdateStatus", MonoUpdateStatus); 87 74 MonoDomain* monoDomain; 75 map* mono; 76 if (hasvalue(*main_conf, "mono", "version", &mono)) { 77 monoDomain = mono_jit_init_version("ZOO_Embedded_Domain", mono->value); 78 } 79 else { 80 monoDomain = mono_jit_init("ZOO_Embedded_Domain"); // use default framework version 81 } 82 83 //MonoDomain* monoDomain = mono_jit_init_version("ZOO_Embedded_Domain", "v4.0.30319"); 84 //MonoDomain* monoDomain = mono_jit_init("ZOO_Embedded_Domain"); 85 86 char* ZMapsLib = "ZMaps.dll"; 87 char *zooAssembly = NULL; 88 89 map* config = NULL, *basedir = NULL; 90 if (hasvalue(*main_conf, "mono", "configdir", &basedir) && // knut: rename to e.g. "base_dir"? 91 hasvalue(*main_conf, "mono", "configfile", &config)) { 92 mono_domain_set_config(monoDomain, basedir->value, config->value); 93 zooAssembly = file_exists(basedir->value, ZMapsLib); 94 } 95 else { 96 mono_domain_set_config(monoDomain, "./", ""); 97 } 98 99 map* cwdMap; 100 if (! hasvalue(*main_conf, "main", "servicePath", &cwdMap) && 101 ! hasvalue(*main_conf, "main", "libPath", &cwdMap) ) { 102 cwdMap = getMapFromMaps(*main_conf, "lenv", "cwd"); 103 } 104 105 if (zooAssembly != NULL || (zooAssembly = file_exists(cwdMap->value, ZMapsLib)) != NULL) { 106 assembly = mono_domain_assembly_open(monoDomain, zooAssembly); 107 } 108 else { 109 // try to load from default locations (GAC?) 110 assembly = mono_domain_assembly_open(monoDomain, ZMapsLib); 111 } 112 free(zooAssembly); 113 114 if (assembly == NULL) { 115 setMapInMaps(*main_conf, "lenv", "message", _("The ZMaps.dll assembly cannot be found!")); 116 return 4; 117 } 118 119 mono_add_internal_call ("ZOO_API::Translate", MonoTranslate); 120 mono_add_internal_call("ZOO_API::UpdateStatus", MonoUpdateStatus); 121 88 122 monoImage = mono_assembly_get_image(assembly); 89 123 MonoClass *KeysList = mono_class_from_name(monoImage, "ZooGenerics", "KeysList"); … … 104 138 MonoClass *classes[3]={_ZMapsClass,ZMapsClass,ZMapClass}; 105 139 MonoMethod *methods[5]={ZMapsAdd,_ZMapsSetContent,_ZMapsSetChild,ZMapAdd,ZMapDisplay}; 106 140 107 141 MonoMethod *ZMapsGetKeys = mono_class_get_method_from_name(ZMapsClass, "getKeys", 0); 142 108 143 MonoMethod *ZMapsGetKeysCount = mono_class_get_method_from_name(ZMapsClass, "getKeysCount", 0); 109 144 MonoMethod *ZMapsGetKey = mono_class_get_method_from_name(ZMapsClass, "getKey", 1); … … 116 151 MonoClass *oclasses[4]={_ZMapsClass,ZMapsClass,ZMapClass,KeysList}; 117 152 MonoMethod *omethods[10]={ZMapsGetMaps,ZMapsGetKeysCount,ZMapsGetKey,ZMapGetMap,ZMapGetKeysCount,ZMapGetKey,_ZMapsGetContent,_ZMapsGetChild,ZMapGetSize,ZMapGetMapAsBytes}; 118 153 119 154 for(int i=0;i<4;i++){ 120 155 iclasses[i]=oclasses[i]; … … 131 166 132 167 MonoObject * out=ZMapsFromMaps(monoDomain,classes,methods,&exc,outputs); 133 168 134 169 args [0] = main; 135 170 args [1] = in; 136 171 args [2] = out; 137 172 138 tmp=getMap(s->content,"serviceProvider"); 139 char *sName=(char*)malloc((strlen(tmp->value)+strlen(cwdMap->value)+2)*sizeof(char)); 140 sprintf(sName,"%s/%s",cwdMap->value,tmp->value); 141 MonoAssembly* serviceAssembly = mono_domain_assembly_open(monoDomain,sName); 173 char* sName = NULL; 174 MonoAssembly* serviceAssembly = NULL; 175 176 tmp = getMap(s->content, "serviceProvider"); 177 char* test = file_exists(NULL, "log.txt"); 178 if ( (sName = file_exists(cwdMap->value, tmp->value)) != NULL || 179 (sName = file_exists(".", tmp->value)) != NULL || // in case servicePath is defined but serviceProvider is in working directory 180 (basedir != NULL && (sName = file_exists(basedir->value, tmp->value)) != NULL) ) { 181 182 serviceAssembly = mono_domain_assembly_open(monoDomain, sName); 183 } 184 else { 185 // try to open from default locations 186 serviceAssembly = mono_domain_assembly_open(monoDomain, tmp->value); 187 } 188 free(sName); 189 190 //char *sName=(char*)malloc((strlen(tmp->value)+strlen(cwdMap->value)+2)*sizeof(char)); 191 //sprintf(sName,"%s/%s",cwdMap->value,tmp->value); 192 //MonoAssembly* serviceAssembly = mono_domain_assembly_open(monoDomain,sName); 193 142 194 if(serviceAssembly==NULL){ 143 195 char *msg=(char*)malloc((strlen(_("Your service assembly: %s cannot be found!"))+strlen(tmp->value)+1)*sizeof(char)); … … 147 199 return 4; 148 200 } 149 201 150 202 MonoImage* serviceImage = mono_assembly_get_image(serviceAssembly); 151 203 152 204 map* tmp1=getMap(s->content,"serviceNameSpace"); 205 153 206 tmp=getMap(s->content,"serviceClass"); 154 207 MonoClass *serviceClass = mono_class_from_name(serviceImage, tmp1->value, tmp->value); … … 160 213 return 4; 161 214 } 215 162 216 MonoMethod *serviceFunction = mono_class_get_method_from_name(serviceClass, s->name, 3); 163 217 if(serviceFunction==NULL){ … … 168 222 return 4; 169 223 } 224 170 225 MonoObject *exception=NULL; 171 226 MonoObject *result = mono_runtime_invoke(serviceFunction,NULL,args,&exception); 227 228 if (exception != NULL) { // knut: add exception handling 229 MonoString* pMsg = mono_object_to_string(exception, NULL); 230 setErrorMessage(*main_conf, s->name, NoApplicableCode, mono_string_to_utf8(pMsg)); 231 return 4; 232 } 233 172 234 res=*(int*)mono_object_unbox (result); 235 173 236 if(res==3){ 174 237 freeMaps(&outputs); 175 238 free(outputs); 176 outputs=mapsFromZMaps(monoDomain,oclasses,omethods, args[2]);239 outputs=mapsFromZMaps(monoDomain,oclasses,omethods,(MonoObject*)args[2]); 177 240 *real_outputs=outputs; 178 241 } 242 179 243 freeMaps(&m); 180 244 free(m); 181 m=mapsFromZMaps(monoDomain,oclasses,omethods, args[0]);245 m=mapsFromZMaps(monoDomain,oclasses,omethods,(MonoObject*)args[0]); 182 246 *main_conf=m; 183 mono_jit_cleanup (monoDomain); 247 mono_jit_cleanup (monoDomain); 184 248 return res; 185 249 } … … 288 352 values[0]=&i; 289 353 exc=NULL; 290 Mono Object*okey = (MonoString*) mono_runtime_invoke(methods[2],m,values,&exc);354 MonoString *okey = (MonoString*) mono_runtime_invoke(methods[2],m,values,&exc); 291 355 char* key = mono_string_to_utf8(okey); 292 356 maps* tmp=createMaps(key); 293 357 values[0]=mono_string_new (domain, key); 294 Mono Object*content_ZMaps = (MonoString*) mono_runtime_invoke(methods[0],m,values,&exc);295 MonoObject *content = mono_runtime_invoke(methods[6], content_ZMaps,NULL,&exc);358 MonoString *content_ZMaps = (MonoString*) mono_runtime_invoke(methods[0],m,values,&exc); 359 MonoObject *content = mono_runtime_invoke(methods[6],(MonoObject*)content_ZMaps,NULL,&exc); 296 360 tmp->content=mapFromZMap(domain,classes,methods,content); 297 361 MonoObject *childs = mono_runtime_invoke(methods[7],content_ZMaps,NULL,&exc); … … 329 393 values[0]=&i; 330 394 exc=NULL; 331 Mono Object*okey = (MonoString*) mono_runtime_invoke(methods[5],m,values,&exc);395 MonoString *okey = (MonoString*) mono_runtime_invoke(methods[5],m,values,&exc); 332 396 char* key = mono_string_to_utf8(okey); 333 397 values[0]=mono_string_new (domain, key); 334 398 exc=NULL; 335 Mono Object*ovalue = (MonoString*) mono_runtime_invoke(methods[3],m,values,&exc);399 MonoString *ovalue = (MonoString*) mono_runtime_invoke(methods[3],m,values,&exc); 336 400 char* value = mono_string_to_utf8(ovalue); 337 401 if(res==NULL) … … 350 414 */ 351 415 static MonoString* MonoTranslate(MonoString *str){ 352 return mono_string_new (mono_domain_get(), mono_string_to_utf8(_(str)));416 return mono_string_new (mono_domain_get(), _(mono_string_to_utf8(str))); 353 417 } 354 418 … … 360 424 * @return the translated string 361 425 */ 362 static void MonoUpdateStatus(MonoObject* obj,MonoString *str,int* p){ 363 MonoDomain* domain = mono_object_get_domain (obj); 364 maps *confMaps=mapsFromZMaps(domain,iclasses,imethods,obj); 365 setMapInMaps(confMaps,"lenv","message",mono_string_to_utf8(str)); 366 int tmp=p; 367 if (p < 0 || p > 100){ 368 tmp=-1; 369 } 370 char tmpStatus[5]; 371 snprintf(tmpStatus, 4, "%d", tmp); 372 setMapInMaps(confMaps,"lenv","status",(char*)tmpStatus); 373 _updateStatus(confMaps); 374 freeMaps(&confMaps); 375 free(confMaps); 376 return; 377 } 426 static void MonoUpdateStatus(MonoObject* obj, MonoString *str, int p) { 427 MonoDomain* domain = mono_object_get_domain(obj); 428 maps *confMaps = mapsFromZMaps(domain, iclasses, imethods, obj); 429 setMapInMaps(confMaps, "lenv", "message", mono_string_to_utf8(str)); 430 int tmp = p > 100 || p < 0 ? -1 : p; 431 char tmpStatus[5]; 432 snprintf(tmpStatus, 4, "%d", tmp); 433 setMapInMaps(confMaps, "lenv", "status", (char*)tmpStatus); 434 _updateStatus(confMaps); 435 freeMaps(&confMaps); 436 free(confMaps); 437 return; 438 } -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_mono.h
r794 r896 45 45 map* mapFromZMap(MonoDomain*,MonoClass**,MonoMethod**,MonoObject*); 46 46 static MonoString* MonoTranslate(MonoString*); 47 static void MonoUpdateStatus(MonoObject*,MonoString*,int*); 48 MonoClass *iclasses[4]; 49 MonoMethod *imethods[10]; 47 //static void MonoUpdateStatus(MonoObject*,MonoString*,int*); 48 static void MonoUpdateStatus(MonoObject*, MonoString*, int); 49 //MonoClass *iclasses[4]; // knut: move declarations to service_internal_mono.c 50 //MonoMethod *imethods[10]; 50 51 51 52 #ifdef __cplusplus -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_php7.c
r796 r896 25 25 #ifdef WIN32 26 26 #define NO_FCGI_DEFINES 27 #define ZEND_WIN32_KEEP_INLINE 27 28 #endif 28 29 -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_python.c
r890 r896 146 146 */ 147 147 int zoo_python_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){ 148 148 149 char *pythonpath; 149 150 char *python_path; 151 152 #ifdef WIN32 153 char* os_pathsep = ";"; 154 #else 155 char* os_pathsep = ":"; 156 #endif 157 150 158 maps* m=*main_conf; 151 159 maps* inputs=*real_inputs; 152 160 maps* outputs=*real_outputs; 153 161 map* tmp0=getMapFromMaps(*main_conf,"lenv","cwd"); 154 char *ntmp=tmp0->value; 162 char *ntmp=tmp0->value; 155 163 map* tmp=NULL; 156 164 int hasToClean=0; 157 tmp=getMapFromMaps(*main_conf,"env","PYTHONPATH"); 165 tmp=getMapFromMaps(*main_conf,"env","PYTHONPATH"); 166 167 map* kvp = NULL; 168 char* libPath = NULL; 169 if (hasvalue(*main_conf, "main", "libPath", &kvp)) { 170 libPath = kvp->value; 171 } 172 else { 173 libPath = ""; 174 } 175 158 176 #ifdef DEBUG 159 177 fprintf(stderr,"PYTHON SUPPORT \n"); … … 172 190 python_path=cwdMap->value; 173 191 else 174 python_path=(char*)"."; 192 python_path=(char*)"."; 175 193 } 176 194 tmp=NULL; 177 195 tmp=getMap(request,"metapath"); 178 196 if(tmp!=NULL && strcmp(tmp->value,"")!=0){ 179 pythonpath=(char*)malloc((4+strlen(python_path)+strlen(ntmp)+strlen(tmp->value))*sizeof(char)); 197 //pythonpath=(char*)malloc((4+strlen(python_path)+strlen(ntmp)+strlen(tmp->value))*sizeof(char)); 198 pythonpath = (char*)malloc((5 + strlen(python_path) + strlen(ntmp) + strlen(tmp->value) + strlen(libPath)) * sizeof(char)); 180 199 #ifdef WIN32 181 sprintf(pythonpath,"%s/%s/;%s",ntmp,tmp->value,python_path); 200 //sprintf(pythonpath,"%s/%s/;%s",ntmp,tmp->value,python_path); 201 sprintf(pythonpath, "%s/%s/;%s;%s", ntmp, tmp->value, python_path, libPath); 182 202 #else 183 sprintf(pythonpath,"%s/%s/:%s",ntmp,tmp->value,python_path); 203 //sprintf(pythonpath,"%s/%s/:%s",ntmp,tmp->value,python_path); 204 sprintf(pythonpath, "%s/%s/:%s:%s", ntmp, tmp->value, python_path, libPath); 184 205 #endif 185 206 } 186 207 else{ 187 pythonpath=(char*)malloc((2+strlen(python_path)+strlen(ntmp))*sizeof(char)); 208 //pythonpath=(char*)malloc((2+strlen(python_path)+strlen(ntmp))*sizeof(char)); 209 pythonpath = (char*)malloc((3 + strlen(python_path) + strlen(ntmp) + strlen(libPath)) * sizeof(char)); 188 210 #ifdef WIN32 189 sprintf(pythonpath,"%s;%s",ntmp,python_path); 211 //sprintf(pythonpath,"%s;%s",ntmp,python_path); 212 sprintf(pythonpath, "%s;%s;%s", ntmp, python_path, libPath); 190 213 #else 191 sprintf(pythonpath,"%s:%s",ntmp,python_path); 192 #endif 214 //sprintf(pythonpath,"%s:%s",ntmp,python_path); 215 sprintf(pythonpath, "%s:%s:%s", ntmp, python_path, libPath); 216 #endif 193 217 } 194 218 #ifdef DEBUG 195 219 fprintf(stderr,"PYTHONPATH=%s\n",pythonpath); 196 220 #endif 197 #ifndef WIN32 198 setenv("PYTHONPATH",pythonpath,1); 199 #else 221 map* home = NULL; 222 // knut: also set PYTHONHOME environment variable so that Python can load standard modules 223 #ifndef WIN32 224 setenv("PYTHONPATH",pythonpath,1); 225 //= getMapFromMaps(*main_conf, "env", "PYTHONHOME"); 226 if (hasvalue(*main_conf, "env", "PYTHONHOME", &home)) { 227 setenv("PYTHONHOME", home->value, 1); // overwrite 228 } 229 #else 200 230 SetEnvironmentVariable("PYTHONPATH",pythonpath); 201 231 char* toto=(char*)malloc((strlen(pythonpath)+12)*sizeof(char)); … … 203 233 _putenv(toto); 204 234 free(toto); 205 #endif 235 if (hasvalue(*main_conf, "env", "PYTHONHOME", &home)) { 236 SetEnvironmentVariable("PYTHONHOME", home->value); 237 } 238 char buffer[128]; 239 #endif 206 240 if(hasToClean>0) 207 241 free(python_path); … … 209 243 210 244 PyThreadState *mainstate; 211 #if PY_MAJOR_VERSION >= 3 212 PyImport_AppendInittab("zoo", init_zoo); 245 #if PY_MAJOR_VERSION >= 3 246 PyImport_AppendInittab("zoo", init_zoo); 213 247 #else 214 248 PyEval_InitThreads(); 215 #endif 216 Py_Initialize(); 217 #if PY_MAJOR_VERSION >= 3 249 #endif 250 Py_Initialize(); 251 #if PY_MAJOR_VERSION >= 3 218 252 PyEval_InitThreads(); 219 PyImport_ImportModule("zoo"); 253 PyImport_ImportModule("zoo"); 220 254 #else 221 255 init_zoo(); 222 #endif 256 #endif 223 257 mainstate = PyThreadState_Swap(NULL); 224 258 PyEval_ReleaseLock(); … … 240 274 char *mn=(char*)malloc((strlen(mps)+strlen(tmp->value)+2)*sizeof(char)); 241 275 sprintf(mn,"%s.%s",mps,tmp->value); 242 pName = PyString_FromString(mn); 276 pName = PyString_FromString(mn); 243 277 free(mn); 244 278 free(mps); … … 251 285 errorException (m, "Unable to parse serviceProvider please check your zcfg file.", "NoApplicableCode", NULL); 252 286 exit(-1); 253 } 254 pModule = PyImport_Import(pName); 287 } 288 pModule = PyImport_Import(pName); 255 289 int res=SERVICE_FAILED; 256 290 if (pModule != NULL) { … … 267 301 PyTuple_SetItem(pArgs, 1, (PyObject *)arg2); 268 302 PyTuple_SetItem(pArgs, 2, (PyObject *)arg3); 269 pValue = PyObject_CallObject(pFunc, pArgs); 303 pValue = PyObject_CallObject(pFunc, pArgs); 270 304 if (pValue != NULL) { 271 305 res=PyInt_AsLong(pValue); … … 275 309 free(*main_conf); 276 310 *main_conf=mapsFromPyDict(arg1); 277 *real_outputs=mapsFromPyDict(arg3); 311 *real_outputs=mapsFromPyDict(arg3); 278 312 #ifdef DEBUG 279 313 fprintf(stderr,"Result of call: %i\n", PyInt_AsLong(pValue)); … … 301 335 #endif 302 336 PyThreadState_Swap(mainstate); 303 Py_Finalize(); 337 Py_Finalize(); 304 338 return res; 305 339 } -
branches/prototype-v0/zoo-project/zoo-kernel/ulinet.c
r891 r896 118 118 ; 119 119 #endif 120 tmp=strtok( buffer,";");120 tmp=strtok((char*) buffer,";"); // knut: added cast to char* 121 121 int cnt=0; 122 122 _HINTERNET *psInternet=(_HINTERNET *)data; … … 322 322 * @return 1 if the host is listed as protected, 0 in other case 323 323 */ 324 int isProtectedHost(const char* protectedHosts,const char* url){ 325 char *token, *saveptr; 326 token = strtok_r (url, "//", &saveptr); 327 int cnt=0; 328 char* host; 329 while(token!=NULL && cnt<=1){ 330 if(cnt==1 && strstr(protectedHosts,token)!=NULL){ 331 return 1; 332 } 333 token = strtok_r (NULL, "/", &saveptr); 334 cnt+=1; 335 } 336 return 0; 324 int isProtectedHost(const char* protectedHosts, const char* url) { 325 char *token, *saveptr; 326 int cnt; 327 char* host; 328 329 // knut: make a copy of url since strtok family modifies first argument and cannot be used on constant strings 330 char* urlcpy = (char*)malloc(sizeof(char)*(strlen(url) + 1)); 331 urlcpy = strncpy(urlcpy, url, strlen(url) + 1); // since count > strlen(url), a null character is properly appended 332 333 //token = strtok_r (url, "//", &saveptr); 334 token = strtok_r(urlcpy, "//", &saveptr); // knut 335 cnt = 0; 336 while (token != NULL && cnt <= 1) { 337 fprintf(stderr, "%s %d %s \n", __FILE__, __LINE__, token); 338 if (cnt == 1) 339 fprintf(stderr, "%s %d %s \n", __FILE__, __LINE__, strstr(protectedHosts, token)); 340 fflush(stderr); 341 if (cnt == 1 && strstr(protectedHosts, token) != NULL) { 342 fprintf(stderr, "%s %d %s \n", __FILE__, __LINE__, strstr(protectedHosts, token)); 343 free(urlcpy); 344 return 1; 345 } 346 token = strtok_r(NULL, "/", &saveptr); 347 cnt += 1; 348 } 349 free(urlcpy); 350 return 0; 337 351 } 338 352 … … 457 471 int ldwFlags=INTERNET_FLAG_NEED_FILE; 458 472 struct MemoryStruct header; 459 map* memUse=getMapFromMaps( conf,"main","memory");473 map* memUse=getMapFromMaps((maps*) conf,"main","memory"); // knut: addad cast to maps* 460 474 461 475 hInternet->ihandle[hInternet->nb].handle=curl_easy_init( ); … … 505 519 map* tmpPath=NULL; 506 520 if(conf!=NULL){ 507 tmpPath=getMapFromMaps( conf,"main","tmpPath");521 tmpPath=getMapFromMaps((maps*) conf,"main","tmpPath"); // knut added cast to maps* 508 522 } 509 523 if(tmpPath==NULL) -
branches/prototype-v0/zoo-project/zoo-kernel/ulinet.h
r880 r896 46 46 #endif 47 47 #ifndef __cplusplus 48 #ifndef bool 49 #define bool int 50 #endif 51 #ifndef true 52 #define true 1 53 #define false 0 54 #endif 48 // knut: see new def of bool in service.h 49 //#ifndef bool 50 //#define bool int 51 //#endif 52 //#ifndef true 53 //#define true 1 54 //#define false 0 55 //#endif 55 56 #endif 56 57 … … 157 158 typedef size_t* LPDWORD; 158 159 #endif 159 #ifndef bool 160 #define bool int 161 #endif 160 // knut: see new definition of bool in service.h 161 //#ifndef bool 162 //#define bool int 163 //#endif 162 164 163 165 # define CHECK_INET_HANDLE(h) (h.handle != 0) -
branches/prototype-v0/zoo-project/zoo-kernel/zoo_loader.c
r877 r896 123 123 if(res!=NULL) 124 124 free(res); 125 }else{ 125 }else{ 126 126 char *buffer=new char[cgiContentLength+1]; 127 127 if(fread(buffer,sizeof(char),cgiContentLength,cgiIn)>0){ … … 163 163 } 164 164 } 165 else{ 165 else{ 166 166 #ifdef DEBUG 167 167 dumpMap(tmpMap); … … 187 187 cgiStringArrayFree(array); 188 188 } 189 189 190 190 #ifdef WIN32 191 map *tmpReq=getMap(tmpMap,"rfile"); 192 if(tmpReq!=NULL){ 193 FILE *lf=fopen(tmpReq->value,"r"); 191 map *tmpReq=getMap(tmpMap,"rfile"); 192 if(tmpReq!=NULL){ 193 FILE *lf=fopen(tmpReq->value,"r"); 194 194 fseek(lf,0,SEEK_END); 195 195 long flen=ftell(lf); … … 395 395 } 396 396 } 397 397 398 398 if(strncasecmp(cgiContentType,"multipart/form-data",19)==0){ 399 399 map* tmp=getMap(tmpMap,"dataInputs"); … … 408 408 if(strQuery!=NULL) 409 409 free(strQuery); 410 410 411 411 runRequest(&tmpMap); 412 412 -
branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
r893 r896 229 229 fread (tmps1, flen, 1, f2); 230 230 #ifdef WIN32 231 /* knut: I think this block can be dropped; pchr may be NULL if result is not in XML format 231 232 char *pchr=strrchr(tmps1,'>'); 232 233 flen=strlen(tmps1)-strlen(pchr)+1; 233 234 tmps1[flen]=0; 235 */ 234 236 #endif 235 237 fwrite (tmps1, 1, flen, f3); … … 483 485 #endif 484 486 485 map* libp = getMapFromMaps(m, "main", "libPath"); 486 487 map* libp = getMapFromMaps(m, "main", "libPath"); 487 488 if (strlen (r_inputs->value) == 1 488 489 && strncasecmp (r_inputs->value, "C", 1) == 0) … … 707 708 #ifdef USE_PYTHON 708 709 if (strncasecmp (r_inputs->value, "PYTHON", 6) == 0) 709 { 710 { 710 711 *eres = 711 712 zoo_python_support (&m, request_inputs, s1, 712 713 &request_input_real_format, 713 &request_output_real_format); 714 &request_output_real_format); 714 715 } 715 716 else … … 798 799 } 799 800 *myMap = m; 800 *ioutputs = request_output_real_format; 801 *ioutputs = request_output_real_format; 801 802 } 802 803 … … 2359 2360 dumpMapsValuesToFiles(&m,&request_input_real_format); 2360 2361 loadServiceAndRun (&m, s1, request_inputs, &request_input_real_format, 2361 &request_output_real_format, &eres); 2362 &request_output_real_format, &eres); 2362 2363 2363 2364 #ifdef META_DB … … 2593 2594 } 2594 2595 } 2595 2596 2596 2597 #ifdef DEBUG 2597 2598 fprintf (stderr, "RUN IN BACKGROUND MODE %s %d \n",__FILE__,__LINE__); … … 2602 2603 rewind(stdout); 2603 2604 2604 //fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres); 2605 2605 //fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres); 2606 2606 if (eres != -1) 2607 2607 outputResponse (s1, request_input_real_format, … … 2609 2609 cpid, m, eres); 2610 2610 fflush (stdout); 2611 2611 2612 2612 /** 2613 2613 * Ensure that if error occurs when freeing memory, no signal will return
Note: See TracChangeset
for help on using the changeset viewer.