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

Unified Diff: net/url_request/url_request_new_ftp_job.cc

Issue 207014: Various cleanups FTP-related. (Closed)
Patch Set: Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_new_ftp_job.cc
diff --git a/net/url_request/url_request_new_ftp_job.cc b/net/url_request/url_request_new_ftp_job.cc
index 40b23c4df43b58265f60d2cb2920d81a82005f10..7755503228b224310823dc559e06b16c9317d74b 100644
--- a/net/url_request/url_request_new_ftp_job.cc
+++ b/net/url_request/url_request_new_ftp_job.cc
@@ -300,7 +300,12 @@ int URLRequestNewFtpJob::ProcessFtpDir(net::IOBuffer *buf,
break;
}
}
- LogFtpServerType(state);
+
+ // We can't recognize server type based on empty directory listings. Only log
+ // server type when we have enough data to recognize one.
+ if (state.parsed_one)
+ LogFtpServerType(state.lstyle);
+
directory_html_.append(file_entry);
size_t bytes_to_copy = std::min(static_cast<size_t>(buf_size),
directory_html_.length());
@@ -311,14 +316,8 @@ int URLRequestNewFtpJob::ProcessFtpDir(net::IOBuffer *buf,
return bytes_to_copy;
}
-void URLRequestNewFtpJob::LogFtpServerType(
- const struct net::list_state& list_state) {
- // We can't recognize server type based on empty directory listings. Don't log
- // that as unknown, it's misleading.
- if (!list_state.parsed_one)
- return;
-
- switch (list_state.lstyle) {
+void URLRequestNewFtpJob::LogFtpServerType(char server_type) {
wtc 2009/09/18 17:24:39 Nit: may want to name the parameter "list_style" a
+ switch (server_type) {
case 'E':
net::UpdateFtpServerTypeHistograms(net::SERVER_EPLF);
break;
« chrome/browser/resources/about_credits.html ('K') | « net/url_request/url_request_new_ftp_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698