Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: net/tools/dns_fuzz_stub/dns_fuzz_stub.cc

Issue 10442098: [net/dns] Resolve AF_UNSPEC on dual-stacked systems. Sort addresses according to RFC3484. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor edits. Fix one typo in variable name. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« net/dns/dns_client.h ('K') | « net/net.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <sstream> 6 #include <sstream>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 if (!response.InitParse(resp_buf.size(), query)) { 143 if (!response.InitParse(resp_buf.size(), query)) {
144 LOG(INFO) << "InitParse failed."; 144 LOG(INFO) << "InitParse failed.";
145 return; 145 return;
146 } 146 }
147 147
148 net::AddressList address_list; 148 net::AddressList address_list;
149 base::TimeDelta ttl; 149 base::TimeDelta ttl;
150 net::DnsResponse::Result result = response.ParseToAddressList( 150 net::DnsResponse::Result result = response.ParseToAddressList(
151 &address_list, &ttl); 151 &address_list, &ttl);
152 if (result != net::DnsResponse::DNS_SUCCESS) { 152 if (result != net::DnsResponse::DNS_PARSE_OK) {
153 LOG(INFO) << "ParseToAddressList failed: " << result; 153 LOG(INFO) << "ParseToAddressList failed: " << result;
154 return; 154 return;
155 } 155 }
156 156
157 // Print the response in one compact line. 157 // Print the response in one compact line.
158 std::stringstream result_line; 158 std::stringstream result_line;
159 result_line << "Response: address_list={ "; 159 result_line << "Response: address_list={ ";
160 for (unsigned int i = 0; i < address_list.size(); i++) 160 for (unsigned int i = 0; i < address_list.size(); i++)
161 result_line << address_list[i].ToString() << " "; 161 result_line << address_list[i].ToString() << " ";
162 result_line << "}, ttl=" << ttl.InSeconds() << "s"; 162 result_line << "}, ttl=" << ttl.InSeconds() << "s";
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (!ReadAndRunTestCase(argv[i])) 206 if (!ReadAndRunTestCase(argv[i]))
207 ret = 2; 207 ret = 2;
208 208
209 // Cluster-Fuzz likes "#EOF" as the last line of output to help distinguish 209 // Cluster-Fuzz likes "#EOF" as the last line of output to help distinguish
210 // successful runs from crashes. 210 // successful runs from crashes.
211 printf("#EOF\n"); 211 printf("#EOF\n");
212 212
213 return ret; 213 return ret;
214 } 214 }
215 215
OLDNEW
« net/dns/dns_client.h ('K') | « net/net.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698