"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/cli/consolecommand.cpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

consolecommand.cpp  (icinga2-2.11.5):consolecommand.cpp  (icinga2-2.12.0)
skipping to change at line 44 skipping to change at line 44
#ifdef HAVE_EDITLINE #ifdef HAVE_EDITLINE
#include "cli/editline.hpp" #include "cli/editline.hpp"
#endif /* HAVE_EDITLINE */ #endif /* HAVE_EDITLINE */
using namespace icinga; using namespace icinga;
namespace po = boost::program_options; namespace po = boost::program_options;
static ScriptFrame *l_ScriptFrame; static ScriptFrame *l_ScriptFrame;
static Url::Ptr l_Url; static Url::Ptr l_Url;
static std::shared_ptr<AsioTlsStream> l_TlsStream; static Shared<AsioTlsStream>::Ptr l_TlsStream;
static String l_Session; static String l_Session;
REGISTER_CLICOMMAND("console", ConsoleCommand); REGISTER_CLICOMMAND("console", ConsoleCommand);
INITIALIZE_ONCE(&ConsoleCommand::StaticInitialize); INITIALIZE_ONCE(&ConsoleCommand::StaticInitialize);
extern "C" void dbg_spawn_console() extern "C" void dbg_spawn_console()
{ {
ScriptFrame frame(true); ScriptFrame frame(true);
ConsoleCommand::RunScriptConsole(frame); ConsoleCommand::RunScriptConsole(frame);
skipping to change at line 524 skipping to change at line 524
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
/** /**
* Connects to host:port and performs a TLS shandshake * Connects to host:port and performs a TLS shandshake
* *
* @returns AsioTlsStream pointer for future HTTP connections. * @returns AsioTlsStream pointer for future HTTP connections.
*/ */
std::shared_ptr<AsioTlsStream> ConsoleCommand::Connect() Shared<AsioTlsStream>::Ptr ConsoleCommand::Connect()
{ {
std::shared_ptr<boost::asio::ssl::context> sslContext; Shared<boost::asio::ssl::context>::Ptr sslContext;
try { try {
sslContext = MakeAsioSslContext(Empty, Empty, Empty); //TODO: Add support for cert, key, ca parameters sslContext = MakeAsioSslContext(Empty, Empty, Empty); //TODO: Add support for cert, key, ca parameters
} catch(const std::exception& ex) { } catch(const std::exception& ex) {
Log(LogCritical, "DebugConsole") Log(LogCritical, "DebugConsole")
<< "Cannot make SSL context: " << ex.what(); << "Cannot make SSL context: " << ex.what();
throw; throw;
} }
String host = l_Url->GetHost(); String host = l_Url->GetHost();
String port = l_Url->GetPort(); String port = l_Url->GetPort();
std::shared_ptr<AsioTlsStream> stream = std::make_shared<AsioTlsStream>(I oEngine::Get().GetIoContext(), *sslContext, host); Shared<AsioTlsStream>::Ptr stream = Shared<AsioTlsStream>::Make(IoEngine: :Get().GetIoContext(), *sslContext, host);
try { try {
icinga::Connect(stream->lowest_layer(), host, port); icinga::Connect(stream->lowest_layer(), host, port);
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
Log(LogWarning, "DebugConsole") Log(LogWarning, "DebugConsole")
<< "Cannot connect to REST API on host '" << host << "' p ort '" << port << "': " << ex.what(); << "Cannot connect to REST API on host '" << host << "' p ort '" << port << "': " << ex.what();
throw; throw;
} }
auto& tlsStream (stream->next_layer()); auto& tlsStream (stream->next_layer());
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)