Skip to content

Commit

Permalink
Encapsulate CHostLookup member variables
Browse files Browse the repository at this point in the history
The host lookup job is currently only used for the DNSBL lookup, so only one change was necessary.
  • Loading branch information
Robyt3 committed Oct 22, 2023
1 parent bab9356 commit 67480f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/engine/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,7 @@ int CServer::Run()
else if(m_aClients[ClientID].m_DnsblState == CClient::DNSBL_STATE_PENDING &&
m_aClients[ClientID].m_pDnsblLookup->Status() == IJob::STATE_DONE)
{
if(m_aClients[ClientID].m_pDnsblLookup->m_Result != 0)
if(m_aClients[ClientID].m_pDnsblLookup->Result() != 0)
{
// entry not found -> whitelisted
m_aClients[ClientID].m_DnsblState = CClient::DNSBL_STATE_WHITELISTED;
Expand Down
13 changes: 9 additions & 4 deletions src/engine/shared/host_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@
class CHostLookup : public IJob
{
private:
int m_Result;
char m_aHostname[128];
int m_Nettype;
NETADDR m_Addr;

void Run() override;

public:
CHostLookup();
CHostLookup(const char *pHostname, int Nettype);

int m_Result;
char m_aHostname[128];
int m_Nettype;
NETADDR m_Addr;
int Result() const { return m_Result; }
const char *Hostname() const { return m_aHostname; }
int Nettype() const { return m_Nettype; }
NETADDR Addr() const { return m_Addr; }
};

#endif

0 comments on commit 67480f1

Please sign in to comment.