mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 18:34:25 +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)
|
static void session(tcp::socket &&sock)
|
||||||
{
|
{
|
||||||
boost::system::error_code error;
|
boost::system::error_code error;
|
||||||
|
const auto remoteIP = sock.remote_endpoint().address();
|
||||||
std::vector<char> data;
|
std::vector<char> data;
|
||||||
data.resize(SOCKET_BUFFERLENGTH);
|
data.resize(SOCKET_BUFFERLENGTH);
|
||||||
|
|
||||||
|
l("Incoming TCP connection from " + remoteIP.to_string(), LogLevel::notice);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
size_t length = sock.read_some(boost::asio::buffer(data),
|
size_t length = sock.read_some(boost::asio::buffer(data),
|
||||||
error);
|
error);
|
||||||
|
Loading…
Reference in New Issue
Block a user