]> git.ipfire.org Git - thirdparty/squid.git/blob - src/DnsLookupDetails.h
Merged from trunk
[thirdparty/squid.git] / src / DnsLookupDetails.h
1 /*
2 * DEBUG: section 78 DNS lookups
3 */
4
5 #ifndef SQUID_DNS_LOOKUP_DETAILS_H
6 #define SQUID_DNS_LOOKUP_DETAILS_H
7
8 #include "SquidString.h"
9
10 /// encapsulates DNS lookup results
11 class DnsLookupDetails
12 {
13 public:
14 DnsLookupDetails(); ///< no error, no lookup delay (i.e., no lookup)
15 DnsLookupDetails(const String &error, int wait);
16
17 std::ostream &print(std::ostream &os) const;
18
19 public:
20 String error; ///< error message for unsuccessdul lookups; empty otherwise
21 int wait; ///< msecs spent waiting for the lookup (if any) or -1 (if none)
22 };
23
24 inline
25 std::ostream &operator << (std::ostream &os, const DnsLookupDetails &dns)
26 {
27 return dns.print(os);
28 }
29
30 #endif