diff options
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request_new_ftp_job.cc | 17 | ||||
-rw-r--r-- | net/url_request/url_request_new_ftp_job.h | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/net/url_request/url_request_new_ftp_job.cc b/net/url_request/url_request_new_ftp_job.cc index 40b23c4..7755503 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) { + switch (server_type) { case 'E': net::UpdateFtpServerTypeHistograms(net::SERVER_EPLF); break; diff --git a/net/url_request/url_request_new_ftp_job.h b/net/url_request/url_request_new_ftp_job.h index fade74d..e29687f 100644 --- a/net/url_request/url_request_new_ftp_job.h +++ b/net/url_request/url_request_new_ftp_job.h @@ -56,7 +56,7 @@ class URLRequestNewFtpJob : public URLRequestJob { int ProcessFtpDir(net::IOBuffer *buf, int buf_size, int bytes_read); - void LogFtpServerType(const struct net::list_state& list_state); + void LogFtpServerType(char server_type); net::FtpRequestInfo request_info_; scoped_ptr<net::FtpTransaction> transaction_; |