LookupDetails.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9/* DEBUG: section 78 DNS lookups */
10
11#ifndef SQUID_DNS_LOOKUPDETAILS_H
12#define SQUID_DNS_LOOKUPDETAILS_H
13
14#include "sbuf/SBuf.h"
15
16#include <optional>
17
18namespace Dns
19{
20
23{
24public:
27
31 LookupDetails(const SBuf &anError, const int aWait):
32 error(anError.isEmpty() ? std::nullopt : std::make_optional(anError)),
33 wait(aWait)
34 {}
35
36 std::ostream &print(std::ostream &os) const;
37
38public:
39 const std::optional<SBuf> error;
40 int wait;
41};
42
43inline std::ostream &
44operator <<(std::ostream &os, const LookupDetails &dns)
45{
46 return dns.print(os);
47}
48
49} // namespace Dns
50
51#endif /* SQUID_DNS_LOOKUPDETAILS_H */
52
encapsulates DNS lookup results
Definition: LookupDetails.h:23
LookupDetails()
no lookup attempt: no error and no lookup delay
Definition: LookupDetails.h:26
std::ostream & print(std::ostream &os) const
LookupDetails(const SBuf &anError, const int aWait)
Definition: LookupDetails.h:31
const std::optional< SBuf > error
error message (if any)
Definition: LookupDetails.h:39
int wait
msecs spent waiting for the lookup (if any) or -1 (if none)
Definition: LookupDetails.h:40
Definition: SBuf.h:94
generic DNS API
Definition: forward.h:20
std::ostream & operator<<(std::ostream &os, const LookupDetails &dns)
Definition: LookupDetails.h:44
STL namespace.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors