mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-18 18:15:50 +00:00
Compare commits
2 Commits
Bronek/ext
...
vlntb/tran
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf2d64308e | ||
|
|
320d9345d1 |
@@ -9,6 +9,7 @@ target_compile_definitions (opts
|
|||||||
BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS
|
BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS
|
||||||
BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
|
BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
|
||||||
BOOST_CONTAINER_FWD_BAD_DEQUE
|
BOOST_CONTAINER_FWD_BAD_DEQUE
|
||||||
|
BOOST_ASIO_ENABLE_HANDLER_TRACKING
|
||||||
HAS_UNCAUGHT_EXCEPTIONS=1
|
HAS_UNCAUGHT_EXCEPTIONS=1
|
||||||
$<$<BOOL:${boost_show_deprecated}>:
|
$<$<BOOL:${boost_show_deprecated}>:
|
||||||
BOOST_ASIO_NO_DEPRECATED
|
BOOST_ASIO_NO_DEPRECATED
|
||||||
|
|||||||
@@ -157,6 +157,48 @@ private:
|
|||||||
boost::filesystem::path m_path;
|
boost::filesystem::path m_path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class AsioTrackingBuf : public std::streambuf
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit AsioTrackingBuf(beast::Journal j)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int
|
||||||
|
overflow(int ch) override
|
||||||
|
{
|
||||||
|
if (ch == '\n')
|
||||||
|
{
|
||||||
|
flush();
|
||||||
|
}
|
||||||
|
else if (ch != EOF)
|
||||||
|
{
|
||||||
|
buffer_ += static_cast<char>(ch);
|
||||||
|
}
|
||||||
|
return ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
sync() override
|
||||||
|
{
|
||||||
|
flush();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void
|
||||||
|
flush()
|
||||||
|
{
|
||||||
|
if (!buffer_.empty())
|
||||||
|
{
|
||||||
|
buffer_.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string buffer_;
|
||||||
|
};
|
||||||
|
|
||||||
std::mutex mutable mutex_;
|
std::mutex mutable mutex_;
|
||||||
std::map<
|
std::map<
|
||||||
std::string,
|
std::string,
|
||||||
@@ -166,6 +208,8 @@ private:
|
|||||||
beast::severities::Severity thresh_;
|
beast::severities::Severity thresh_;
|
||||||
File file_;
|
File file_;
|
||||||
bool silent_ = false;
|
bool silent_ = false;
|
||||||
|
std::unique_ptr<AsioTrackingBuf> asioBuf_;
|
||||||
|
std::unique_ptr<std::ostream> asioStream_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Logs(beast::severities::Severity level);
|
Logs(beast::severities::Severity level);
|
||||||
|
|||||||
@@ -134,6 +134,9 @@ Logs::File::writeln(char const* text)
|
|||||||
Logs::Logs(beast::severities::Severity thresh)
|
Logs::Logs(beast::severities::Severity thresh)
|
||||||
: thresh_(thresh) // default severity
|
: thresh_(thresh) // default severity
|
||||||
{
|
{
|
||||||
|
asioBuf_ = std::make_unique<AsioTrackingBuf>(journal("AsioTracking"));
|
||||||
|
asioStream_ = std::make_unique<std::ostream>(asioBuf_.get());
|
||||||
|
std::clog.rdbuf(asioStream_->rdbuf());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -580,8 +580,21 @@ PeerImp::close()
|
|||||||
{
|
{
|
||||||
detaching_ = true; // DEPRECATED
|
detaching_ = true; // DEPRECATED
|
||||||
error_code ec;
|
error_code ec;
|
||||||
|
|
||||||
timer_.cancel(ec);
|
timer_.cancel(ec);
|
||||||
|
if (ec)
|
||||||
|
{
|
||||||
|
JLOG(journal_.info())
|
||||||
|
<< "PeerImp::close timer_.cancel ec: " << ec.message();
|
||||||
|
}
|
||||||
|
|
||||||
socket_.close(ec);
|
socket_.close(ec);
|
||||||
|
if (ec)
|
||||||
|
{
|
||||||
|
JLOG(journal_.info())
|
||||||
|
<< "PeerImp::close socket_.close ec: " << ec.message();
|
||||||
|
}
|
||||||
|
|
||||||
overlay_.incPeerDisconnect();
|
overlay_.incPeerDisconnect();
|
||||||
if (inbound_)
|
if (inbound_)
|
||||||
{
|
{
|
||||||
@@ -672,6 +685,10 @@ PeerImp::cancelTimer()
|
|||||||
{
|
{
|
||||||
error_code ec;
|
error_code ec;
|
||||||
timer_.cancel(ec);
|
timer_.cancel(ec);
|
||||||
|
if (ec)
|
||||||
|
{
|
||||||
|
JLOG(journal_.info()) << "PeerImp::cancelTimer ec: " << ec.message();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user