mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 10:24:26 +01:00
TCP connection logging
This commit is contained in:
parent
c01eb22f91
commit
542f5518a6
@ -38,10 +38,12 @@ static void signal_handler(int signum)
|
||||
static void session(tcp::socket &&sock)
|
||||
{
|
||||
boost::system::error_code error;
|
||||
|
||||
const auto remoteIP = sock.remote_endpoint().address();
|
||||
std::vector<char> data;
|
||||
data.resize(SOCKET_BUFFERLENGTH);
|
||||
|
||||
l("Incoming TCP connection from " + remoteIP.to_string(), LogLevel::notice);
|
||||
|
||||
try {
|
||||
size_t length = sock.read_some(boost::asio::buffer(data),
|
||||
error);
|
||||
|
Loading…
Reference in New Issue
Block a user