diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/uscxml/Interpreter.cpp | 9 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 5 | ||||
-rw-r--r-- | src/uscxml/server/HTTPServer.cpp | 20 |
4 files changed, 22 insertions, 14 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp index 1a79a63..0758cd1 100644 --- a/src/uscxml/Interpreter.cpp +++ b/src/uscxml/Interpreter.cpp @@ -98,7 +98,7 @@ Interpreter Interpreter::fromXML(const std::string& xml, const std::string& base Interpreter Interpreter::fromElement(XERCESC_NS::DOMElement* scxml, const std::string& baseURL) { URL absUrl = normalizeURL(baseURL); - + std::shared_ptr<InterpreterImpl> interpreterImpl(new InterpreterImpl()); Interpreter interpreter(interpreterImpl); @@ -147,6 +147,13 @@ Interpreter Interpreter::fromDocument(XERCESC_NS::DOMDocument* dom, const std::s Interpreter Interpreter::fromURL(const std::string& url) { URL absUrl = normalizeURL(url); +#ifdef _WIN32 + // Xercesc is hard to build with SSL on windows, whereas curl uses winssl + if (absUrl.scheme() == "https") { + return fromXML(absUrl.getInContent(), absUrl); + } +#endif + std::shared_ptr<InterpreterImpl> interpreterImpl(new InterpreterImpl()); Interpreter interpreter(interpreterImpl); diff --git a/src/uscxml/plugins/datamodel/CMakeLists.txt b/src/uscxml/plugins/datamodel/CMakeLists.txt index e70598e..a03e7c8 100644 --- a/src/uscxml/plugins/datamodel/CMakeLists.txt +++ b/src/uscxml/plugins/datamodel/CMakeLists.txt @@ -72,7 +72,7 @@ if (V8_FOUND) endif() -if (LUA51_FOUND AND WITH_DM_LUA) +if (LUA_FOUND AND WITH_DM_LUA) set(USCXML_DATAMODELS "lua ${USCXML_DATAMODELS}") # Lua ecmascript datamodel file(GLOB LUA_DATAMODEL diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index 4f78e7d..92866ee 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -163,9 +163,10 @@ static luabridge::LuaRef getDataAsLua(lua_State* _luaState, const Data& data) { luaData = luabridge::newTable(_luaState); std::map<std::string, Data>::const_iterator compoundIter = data.compound.begin(); while(compoundIter != data.compound.end()) { - if (isInteger(compoundIter->first.c_str(), 10) && strTo<size_t>(compoundIter->first) > 0) { + if (isInteger(compoundIter->first.c_str(), 10) && strTo<long>(compoundIter->first) > 0) { // it makes a difference whether we pass a numeric string or a proper number! - luaData[strTo<size_t>(compoundIter->first)] = getDataAsLua(_luaState, compoundIter->second); + // MSVC throws assertion with LuaBridge for size_t instead of int + luaData[strTo<long>(compoundIter->first)] = getDataAsLua(_luaState, compoundIter->second); } else { luaData[compoundIter->first] = getDataAsLua(_luaState, compoundIter->second); } diff --git a/src/uscxml/server/HTTPServer.cpp b/src/uscxml/server/HTTPServer.cpp index 367df21..e9a1039 100644 --- a/src/uscxml/server/HTTPServer.cpp +++ b/src/uscxml/server/HTTPServer.cpp @@ -49,6 +49,10 @@ extern "C" { #include <unistd.h> // for gethostname //#include <netdb.h> //#include <arpa/inet.h> +#else +#ifdef HTTPS_ENABLED +#define EVENT__HAVE_OPENSSL +#endif #endif #ifdef HTTPS_ENABLED @@ -125,6 +129,7 @@ HTTPServer::HTTPServer(unsigned short port, unsigned short wsPort, SSLConfig* ss SSL_library_init (); SSL_load_error_strings (); + ERR_load_crypto_strings(); OpenSSL_add_all_algorithms (); SSL_CTX *ctx = SSL_CTX_new (SSLv23_server_method ()); @@ -135,31 +140,26 @@ HTTPServer::HTTPServer(unsigned short port, unsigned short wsPort, SSLConfig* ss EC_KEY *ecdh = EC_KEY_new_by_curve_name (NID_X9_62_prime256v1); if (! ecdh) { - LOGD(USCXML_ERROR) << ("EC_KEY_new_by_curve_name"); - ERR_print_errors_fp(stderr); + LOGD(USCXML_ERROR) << ("EC_KEY_new_by_curve_name") << ERR_error_string(ERR_get_error(), NULL); goto FAIL_SSL_SETUP; } if (1 != SSL_CTX_set_tmp_ecdh (ctx, ecdh)) { - LOGD(USCXML_ERROR) << ("SSL_CTX_set_tmp_ecdh"); - ERR_print_errors_fp(stderr); + LOGD(USCXML_ERROR) << ("SSL_CTX_set_tmp_ecdh") << ERR_error_string(ERR_get_error(), NULL); goto FAIL_SSL_SETUP; } if (1 != SSL_CTX_use_certificate_chain_file(ctx, sslConf->publicKey.c_str())) { - LOGD(USCXML_ERROR) << ("SSL_CTX_use_certificate_chain_file"); - ERR_print_errors_fp(stderr); + LOGD(USCXML_ERROR) << ("SSL_CTX_use_certificate_chain_file") << ERR_error_string(ERR_get_error(), NULL); goto FAIL_SSL_SETUP; } if (1 != SSL_CTX_use_PrivateKey_file(ctx, sslConf->privateKey.c_str(), SSL_FILETYPE_PEM)) { - LOGD(USCXML_ERROR) << ("SSL_CTX_use_PrivateKey_file"); - ERR_print_errors_fp(stderr); + LOGD(USCXML_ERROR) << ("SSL_CTX_use_PrivateKey_file") << ERR_error_string(ERR_get_error(), NULL); goto FAIL_SSL_SETUP; } if (1 != SSL_CTX_check_private_key(ctx)) { - LOGD(USCXML_ERROR) << ("SSL_CTX_check_private_key"); - ERR_print_errors_fp(stderr); + LOGD(USCXML_ERROR) << ("SSL_CTX_check_private_key") << ERR_error_string(ERR_get_error(), NULL); goto FAIL_SSL_SETUP; } |