mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd::net::acceptor: Add filter instance stub to listener.
This commit is contained in:
parent
d3584274ac
commit
18b3b58709
2 changed files with 22 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue