"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/check_nscp_api.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.

check_nscp_api.cpp  (icinga2-2.11.5):check_nscp_api.cpp  (icinga2-2.12.0)
skipping to change at line 177 skipping to change at line 177
} }
/** /**
* Connects to host:port and performs a TLS shandshake * Connects to host:port and performs a TLS shandshake
* *
* @param host To connect to. * @param host To connect to.
* @param port To connect to. * @param port To connect to.
* *
* @returns AsioTlsStream pointer for future HTTP connections. * @returns AsioTlsStream pointer for future HTTP connections.
*/ */
static std::shared_ptr<AsioTlsStream> Connect(const String& host, const String& port) static Shared<AsioTlsStream>::Ptr Connect(const String& host, const String& port )
{ {
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;
} }
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());
skipping to change at line 341 skipping to change at line 341
* *
* @return Dictionary de-serialized from JSON data. * @return Dictionary de-serialized from JSON data.
*/ */
static Dictionary::Ptr FetchData(const String& host, const String& port, const S tring& password, static Dictionary::Ptr FetchData(const String& host, const String& port, const S tring& password,
const String& endpoint) const String& endpoint)
{ {
namespace beast = boost::beast; namespace beast = boost::beast;
namespace http = beast::http; namespace http = beast::http;
std::shared_ptr<AsioTlsStream> tlsStream; Shared<AsioTlsStream>::Ptr tlsStream;
try { try {
tlsStream = Connect(host, port); tlsStream = Connect(host, port);
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
std::cerr << "Connection error: " << ex.what(); std::cerr << "Connection error: " << ex.what();
throw ex; throw ex;
} }
Url::Ptr url; Url::Ptr url;
 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)