Commit 9c484365 authored by loyso's avatar loyso Committed by Commit bot

Revert of Make FTP directory parser less strict (patchset #3 id:40001 of...

Revert of Make FTP directory parser less strict (patchset #3 id:40001 of https://codereview.chromium.org/2608213002/ )

Reason for revert:
Fails on all platforms.

https://uberchromegw.corp.google.com/i/chromium.win/builders/Win7%20Tests%20%281%29/builds/62042

Original issue's description:
> Make FTP directory parser less strict
>
> FTP directory listing returns empty result if encoding detection or
> conversion fails. This CL puts less strict constraint on conversion
> so that the whole list can survive some filenames with broken chars
> and be shown to users. Other browsers seem to work this way.
>
> The broken chars can happen due to wrong encoding detection, which
> cannot be avoided 100%, as reported in the bug.
>
> BUG=676762
> R=mmenke@chromium.org, phajdan.jr@chromium.org
>
> Review-Url: https://codereview.chromium.org/2608213002 .
> Cr-Commit-Position: refs/heads/master@{#441856}
> Committed: https://chromium.googlesource.com/chromium/src/+/ed3ef90ecc3c01246a3d838fbeefdab72c94c228

TBR=phajdan.jr@chromium.org,mmenke@chromium.org,jinsukkim@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=676762

Review-Url: https://codereview.chromium.org/2614103002
Cr-Commit-Position: refs/heads/master@{#441866}
parent b4271bc3
-rw-rw-r-- 1 ftpuser ftpusers 1761280 Dec 20 2002 controle_embarqu‚_avec_labview_real_time_et_compactfieldpoint.ppt
-rw-rw-r-- 1 ftpuser ftpusers 329216 Dec 20 2002 optimisez_l'acquisition_de_donn‚es_sous_labview.ppt
-
controle_embarqu�_avec_labview_real_time_et_compactfieldpoint.ppt
1761280
2002
12
20
0
0
-
optimisez_l'acquisition_de_donnFs_sous_labview.ppt
329216
2002
12
20
0
0
......@@ -28,7 +28,7 @@ int FillInRawName(const std::string& encoding,
std::vector<FtpDirectoryListingEntry>* entries) {
for (size_t i = 0; i < entries->size(); i++) {
if (!base::UTF16ToCodepage(entries->at(i).name, encoding.c_str(),
base::OnStringConversionError::SUBSTITUTE,
base::OnStringConversionError::FAIL,
&entries->at(i).raw_name)) {
return ERR_ENCODING_CONVERSION_FAILED;
}
......@@ -91,7 +91,7 @@ int DecodeAndParse(const std::string& text,
base::string16 converted_text;
if (base::CodepageToUTF16(text, encoding_name,
base::OnStringConversionError::SUBSTITUTE,
base::OnStringConversionError::FAIL,
&converted_text)) {
const char* const kNewlineSeparators[] = {"\n", "\r\n"};
......
......@@ -158,7 +158,6 @@ const FtpTestParam kTestParams[] = {
{"dir-listing-ls-31", OK},
{"dir-listing-ls-32", OK}, // busybox
{"dir-listing-ls-33", OK},
{"dir-listing-ls-34", OK}, // Broken encoding. Should not fail.
{"dir-listing-netware-1", OK},
{"dir-listing-netware-2", OK},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment