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

Side by Side Diff: net/ftp/ftp_network_transaction.cc

Issue 1585022: Make sure to strip the brackets around IPv6 literals when resolving the hostn... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address wtc's comments Created 10 years, 8 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
« no previous file with comments | « no previous file | net/ftp/ftp_network_transaction_unittest.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "net/ftp/ftp_network_transaction.h" 5 #include "net/ftp/ftp_network_transaction.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 next_state_ = STATE_CTRL_RESOLVE_HOST; 526 next_state_ = STATE_CTRL_RESOLVE_HOST;
527 return OK; 527 return OK;
528 } 528 }
529 529
530 int FtpNetworkTransaction::DoCtrlResolveHost() { 530 int FtpNetworkTransaction::DoCtrlResolveHost() {
531 next_state_ = STATE_CTRL_RESOLVE_HOST_COMPLETE; 531 next_state_ = STATE_CTRL_RESOLVE_HOST_COMPLETE;
532 532
533 std::string host; 533 std::string host;
534 int port; 534 int port;
535 535
536 host = request_->url.host(); 536 host = request_->url.HostNoBrackets();
537 port = request_->url.EffectiveIntPort(); 537 port = request_->url.EffectiveIntPort();
538 538
539 HostResolver::RequestInfo info(host, port); 539 HostResolver::RequestInfo info(host, port);
540 // TODO(wtc): Until we support the FTP extensions for IPv6 specified in 540 // TODO(wtc): Until we support the FTP extensions for IPv6 specified in
541 // RFC 2428, we have to turn off IPv6 in FTP. See http://crbug.com/32945. 541 // RFC 2428, we have to turn off IPv6 in FTP. See http://crbug.com/32945.
542 info.set_address_family(ADDRESS_FAMILY_IPV4); 542 info.set_address_family(ADDRESS_FAMILY_IPV4);
543 // No known referrer. 543 // No known referrer.
544 return resolver_.Resolve(info, &addresses_, &io_callback_, net_log_); 544 return resolver_.Resolve(info, &addresses_, &io_callback_, net_log_);
545 } 545 }
546 546
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 if (!had_error_type[type]) { 1283 if (!had_error_type[type]) {
1284 had_error_type[type] = true; 1284 had_error_type[type] = true;
1285 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", 1285 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened",
1286 type, NUM_OF_NET_ERROR_TYPES); 1286 type, NUM_OF_NET_ERROR_TYPES);
1287 } 1287 }
1288 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", 1288 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount",
1289 type, NUM_OF_NET_ERROR_TYPES); 1289 type, NUM_OF_NET_ERROR_TYPES);
1290 } 1290 }
1291 1291
1292 } // namespace net 1292 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698