Chromium Code Reviews| 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; |