]> git.ipfire.org Git - thirdparty/squid.git/blob - src/DnsLookupDetails.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / DnsLookupDetails.h
1 /*
2 * Copyright (C) 1996-2015 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_LOOKUP_DETAILS_H
12 #define SQUID_DNS_LOOKUP_DETAILS_H
13
14 #include "SquidString.h"
15
16 /// encapsulates DNS lookup results
17 class DnsLookupDetails
18 {
19 public:
20 DnsLookupDetails(); ///< no error, no lookup delay (i.e., no lookup)
21 DnsLookupDetails(const String &error, int wait);
22
23 std::ostream &print(std::ostream &os) const;
24
25 public:
26 String error; ///< error message for unsuccessdul lookups; empty otherwise
27 int wait; ///< msecs spent waiting for the lookup (if any) or -1 (if none)
28 };
29
30 inline
31 std::ostream &operator << (std::ostream &os, const DnsLookupDetails &dns)
32 {
33 return dns.print(os);
34 }
35
36 #endif
37