Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 } | 70 } |
| 71 output.append("\n"); | 71 output.append("\n"); |
| 72 | 72 |
| 73 for (size_t i = 0; i < dns_config.nameservers.size(); ++i) { | 73 for (size_t i = 0; i < dns_config.nameservers.size(); ++i) { |
| 74 output.append("nameserver "); | 74 output.append("nameserver "); |
| 75 output.append(dns_config.nameservers[i].ToString()).append("\n"); | 75 output.append(dns_config.nameservers[i].ToString()).append("\n"); |
| 76 } | 76 } |
| 77 | 77 |
| 78 base::StringAppendF(&output, "options ndots:%d\n", dns_config.ndots); | 78 base::StringAppendF(&output, "options ndots:%d\n", dns_config.ndots); |
| 79 base::StringAppendF(&output, "options timeout:%d\n", | 79 base::StringAppendF(&output, "options timeout:%d\n", |
| 80 static_cast<int>(dns_config.timeout.InMilliseconds())); | 80 static_cast<int>(dns_config.timeout.InSeconds())); |
|
Randy Smith (Not in Mondays)
2016/03/15 20:12:30
Why?
Deprecated (see juliatuttle)
2016/03/16 16:45:30
This was wrong; see the man page for resolv.conf.
Randy Smith (Not in Mondays)
2016/03/16 20:11:07
Separate CL or mention in CL description?
| |
| 81 base::StringAppendF(&output, "options attempts:%d\n", dns_config.attempts); | 81 base::StringAppendF(&output, "options attempts:%d\n", dns_config.attempts); |
| 82 if (dns_config.rotate) | 82 if (dns_config.rotate) |
| 83 output.append("options rotate\n"); | 83 output.append("options rotate\n"); |
| 84 if (dns_config.edns0) | 84 if (dns_config.edns0) |
| 85 output.append("options edns0\n"); | 85 output.append("options edns0\n"); |
| 86 return output; | 86 return output; |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Convert DnsConfig hosts member to a human readable text. | 89 // Convert DnsConfig hosts member to a human readable text. |
| 90 std::string DnsHostsToString(const DnsHosts& dns_hosts) { | 90 std::string DnsHostsToString(const DnsHosts& dns_hosts) { |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 } | 512 } |
| 513 | 513 |
| 514 } // empty namespace | 514 } // empty namespace |
| 515 | 515 |
| 516 } // namespace net | 516 } // namespace net |
| 517 | 517 |
| 518 int main(int argc, const char* argv[]) { | 518 int main(int argc, const char* argv[]) { |
| 519 net::GDig dig; | 519 net::GDig dig; |
| 520 return dig.Main(argc, argv); | 520 return dig.Main(argc, argv); |
| 521 } | 521 } |
| OLD | NEW |