Skip to content

Commit

Permalink
Specify WFDnsServer's 'new_session'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim committed Mar 4, 2024
1 parent c6d3ef6 commit 5a42876
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/server/WFDnsServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,22 @@ WFDnsServer::WFServer(dns_process_t proc) :
{
}

template<> inline
CommSession *WFDnsServer::new_session(long long seq, CommConnection *conn)
{
using factory = WFNetworkTaskFactory<protocol::DnsRequest,
protocol::DnsResponse>;
WFDnsTask *task;

task = factory::create_server_task(this, this->process);
task->set_keep_alive(this->params.keep_alive_timeout);
task->set_receive_timeout(this->params.receive_timeout);
task->get_req()->set_size_limit(this->params.request_size_limit);
task->get_req()->set_single_packet(this->params.transport_type == TT_UDP);
task->get_resp()->set_single_packet(this->params.transport_type == TT_UDP);

return task;
}

#endif

0 comments on commit 5a42876

Please sign in to comment.