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
25 class GNet::DnsblImp
26{
27} ;
28
29 GNet::Dnsbl::Dnsbl( std::function<void(bool)> callback , EventState , std::string_view ) :
30 m_callback(callback)
31{
32}
33
34 GNet::Dnsbl::~Dnsbl()
35= default ;
36
37 void GNet::Dnsbl::start( const Address & )
38{
39 m_callback( /*allow=*/true ) ;
40}
41
42 bool GNet::Dnsbl::busy() const
43{
44 return false ;
45}
46
47 void GNet::Dnsbl::checkConfig( const std::string & config )
48{
49 if( !config.empty() )
50 throw G::Exception( "dnsbl has been disabled in this build" ) ;
51}
GNet::Address
The GNet::Address class encapsulates a TCP/UDP transport address.
Definition: gaddress.h:63
GNet::Dnsbl::busy
bool busy() const
Returns true after start() and before the completion callback.
Definition: gdnsbl_disabled.cpp:42
GNet::Dnsbl::checkConfig
static void checkConfig(const std::string &)
See DnsBlock::checkConfig().
Definition: gdnsbl_disabled.cpp:47
GNet::Dnsbl::start
void start(const Address &)
Starts an asychronous check on the given address.
Definition: gdnsbl_disabled.cpp:37
GNet::Dnsbl::Dnsbl
Dnsbl(std::function< void(bool)> callback, EventState, std::string_view config={})
Constructor. See DnsBlock::DnsBlock().
Definition: gdnsbl_disabled.cpp:29
GNet::Dnsbl::~Dnsbl
~Dnsbl()
Destructor.
GNet::EventState
A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and opt...
Definition: geventstate.h:131
G::Exception
A general-purpose exception class derived from std::exception and containing an error message.
Definition: gexception.h:64
gdnsbl.h
gexception.h