0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-09 05:29:00 +02:00

ircd::net::acceptor: Add filter instance stub to listener.

This commit is contained in:
Jason Volk 2022-07-07 22:07:59 -07:00
parent d3584274ac
commit 18b3b58709
2 changed files with 22 additions and 2 deletions

View file

@ -46,6 +46,7 @@ ircd::net::acceptor
size_t backlog;
listener::callback cb;
listener::proffer pcb;
bpf::prog filter;
asio::ssl::context ssl;
ip::tcp::endpoint ep;
ip::tcp::acceptor a;

View file

@ -324,6 +324,13 @@ try
std::move(pcb):
proffer_default
}
,filter
{
const_buffer
{
nullptr, nullptr
},
}
,ssl
{
asio::ssl::context::method::sslv23_server
@ -388,10 +395,22 @@ ircd::net::acceptor::open()
a.non_blocking(true);
log::debug
{
log, "%s opened listener socket",
loghead(*this)
log, "%s opened listener socket:%d",
loghead(*this),
int(a.native_handle()),
};
if(filter)
{
net::attach(a.native_handle(), filter.fd);
log::debug
{
log, "%s attach filter fd:%d",
loghead(*this),
int(filter.fd),
};
}
a.bind(ep);
log::debug
{