E-MailRelay
gdnsbl_disabled.cpp
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2024 Graeme Walker <graeme_walker@users.sourceforge.net>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16// ===
17///
18/// \file gdnsbl_disabled.cpp
19///
20
21#include "gdef.h"
22#include "gdnsbl.h"
23#include "gexception.h"
24
25class GNet::DnsblImp
26{
27} ;
28
29GNet::Dnsbl::Dnsbl( std::function<void(bool)> callback , EventState , std::string_view ) :
30 m_callback(callback)
31{
32}
33
35= default ;
36
38{
39 m_callback( /*allow=*/true ) ;
40}
41
43{
44 return false ;
45}
46
47void GNet::Dnsbl::checkConfig( const std::string & config )
48{
49 if( !config.empty() )
50 throw G::Exception( "dnsbl has been disabled in this build" ) ;
51}
The GNet::Address class encapsulates a TCP/UDP transport address.
Definition: gaddress.h:63
bool busy() const
Returns true after start() and before the completion callback.
static void checkConfig(const std::string &)
See DnsBlock::checkConfig().
void start(const Address &)
Starts an asychronous check on the given address.
Dnsbl(std::function< void(bool)> callback, EventState, std::string_view config={})
Constructor. See DnsBlock::DnsBlock().
~Dnsbl()
Destructor.
A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and opt...
Definition: geventstate.h:131
A general-purpose exception class derived from std::exception and containing an error message.
Definition: gexception.h:64