| 242 | } |
| 243 | |
| 244 | void GelfWriter::DisconnectInternal() |
| 245 | { |
| 246 | if (!GetConnected()) |
| 247 | return; |
| 248 | |
| 249 | if (m_Stream.first) { |
| 250 | boost::system::error_code ec; |
| 251 | m_Stream.first->next_layer().shutdown(ec); |
| 252 | |
| 253 | // https://stackoverflow.com/a/25703699 |
| 254 | // As long as the error code's category is not an SSL category, then the protocol was securely shutdown |
| 255 | if (ec.category() == boost::asio::error::get_ssl_category()) { |
| 256 | Log(LogCritical, "GelfWriter") |
| 257 | << "TLS shutdown with host '" << GetHost() << "' could not be done securely."; |
| 258 | } |
| 259 | } else if (m_Stream.second) { |
| 260 | m_Stream.second->close(); |
| 261 | } |
| 262 | |
| 263 | SetConnected(false); |
| 264 | |
| 265 | } |
| 266 | |
| 267 | void GelfWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr) |
| 268 | { |