summaryrefslogtreecommitdiffstats
path: root/net/data/ftp
Commit message (Collapse)AuthorAgeFilesLines
* FTP: Multiple fixes for localized directory listings:phajdan.jr@chromium.org2011-04-116-0/+177
| | | | | | | | | | | | | | | | | | | | | - fix detection of KOI8-R and possibly other encodings - fix parsing Russian month names When detecting the listing encoding, we need to not only check whether the data can be converted using given encoding, but also whether the result can be parsed as a valid directory listing. Also, we only need to compare the first three characters of the abbreviated month name, because that's how they're abbreviated in FTP directory listings. Finally, the Russian directory listings have swapped the "month" and "day of month" columns. BUG=65917 Review URL: http://codereview.chromium.org/6718043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81081 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 80587 - FTP: Multiple fixes for localized directory listings:- fix ↵phajdan.jr@chromium.org2011-04-066-177/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | detection of KOI8-R and possibly other encodings- fix parsing Russian month namesWhen detecting the listing encoding, we need to not onlycheck whether the data can be converted using given encoding,but also whether the result can be parsed as a valid directory listing.Also, we only need to compare the first three characters of theabbreviated month name, because that's how they're abbreviatedin FTP directory listings.Finally, the Russian directory listings have swapped the "month" and "day of month" columns.BUG=65917Review URL: http://codereview.chromium.org/6718043 TBR=phajdan.jr@chromium.org Failures (Windows only, both Vista and XP): FtpDirectoryListingBufferTest.Parse: .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".." Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .. .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[25]: dir-listing-ls-25 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".message" Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .message .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[25]: dir-listing-ls-25 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".." Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .. .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[26]: dir-listing-ls-26 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".message" Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .message .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[26]: dir-listing-ls-26 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".." Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .. .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[27]: dir-listing-ls-27 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".message" Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .message .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[27]: dir-listing-ls-27 FtpDirectoryListingParserLsTest.Good: c:\b\build\slave\cr-win-rel\build\src\net/ftp/ftp_directory_listing_parser_unittest.h(47): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(test_case.filename) Which is: L"test" Google Test trace: .\ftp\ftp_directory_listing_parser_ls_unittest.cc(109): Test[21]: -rwxrwxr-x 1 ftp ftp 123 23 май 2011 test c:\b\build\slave\cr-win-rel\build\src\net/ftp/ftp_directory_listing_parser_unittest.h(47): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(test_case.filename) Which is: L"dir" Google Test trace: .\ftp\ftp_directory_listing_parser_ls_unittest.cc(109): Test[22]: drwxrwxr-x 1 ftp ftp 4096 19 окт 2011 dir Review URL: http://codereview.chromium.org/6802006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80590 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: Multiple fixes for localized directory listings:phajdan.jr@chromium.org2011-04-066-0/+177
| | | | | | | | | | | | | | | | | | | | | - fix detection of KOI8-R and possibly other encodings - fix parsing Russian month names When detecting the listing encoding, we need to not only check whether the data can be converted using given encoding, but also whether the result can be parsed as a valid directory listing. Also, we only need to compare the first three characters of the abbreviated month name, because that's how they're abbreviated in FTP directory listings. Finally, the Russian directory listings have swapped the "month" and "day of month" columns. BUG=65917 Review URL: http://codereview.chromium.org/6718043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80587 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: Compatibility fix for "ls -l" style directory listing parser.phajdan.jr@chromium.org2011-02-162-0/+10
| | | | | | | | | | | | | | | Some servers, for example smallftpd, add an empty line at the end of the listing. We should not fail on those. I think this bug was introduced in 2009 by http://codereview.chromium.org/449011 Now we have more test cases, and this change shouldn't introduce new compatibility problems. BUG=72060 TEST=net_unittests Review URL: http://codereview.chromium.org/6515009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75079 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: correctly handle directory listings containing "Permission denied" errors.phajdan.jr@chromium.org2011-01-042-0/+2
| | | | | | | | | BUG=67797 TEST=net_unittests Review URL: http://codereview.chromium.org/6096006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70435 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: fix compatibility problems with MLSD by removing MLSD support.phajdan.jr@chromium.org2010-12-1010-145/+0
| | | | | | | | | | | | | | | | | | | | | | | | Some FTP servers send MLSD listings with no facts, just the file names. This is a valid RFC-3659 listing, but is useless for web browsers. In theory we could check whether a server advertises MLSD support in FEAT response, or use LIST when MLSD only returns file names, but the extra complexity is not worth it. All servers supporting MLSD must also support LIST, so this should not regress compatibility. This change also removes the "HPRC" directory listing parser. Actually, it was just MLSD listing with no facts. BUG=65328, 65584 TEST=net_unittests, also see the bugs Review URL: http://codereview.chromium.org/5669001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68859 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: improve character encoding detection in cases where ICU's first guess ↵phajdan.jr@chromium.org2010-11-186-0/+767
| | | | | | | | | | | | | | | | | | | is wrong. Instead of using ICU's first guessed encoding immediately, we ask it for all possible encodings, try them in order, and use the first one that works. For some sites this still results in a gibberish being displayed, but at least the links are clickable so the site navigation is possible. BUG=61073 TEST=see bug Review URL: http://codereview.chromium.org/4967001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66664 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: fix directory listing parser for ftp://ftp.dd-wrt.com/others/juno6/phajdan.jr@chromium.org2010-10-282-0/+10
| | | | | | | | | | | | Now the "ls -l" parser ignores lines with empty file names instead of failing. BUG=60065 TEST=net_unittests Review URL: http://codereview.chromium.org/4182002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64208 0039d316-1c4b-4281-b951-d872f2087c98
* Fix FTP directory listing for ftp.cisco.com.phajdan.jr@chromium.org2010-10-142-0/+29
| | | | | | | | | BUG=58963 TEST=net_unittests Review URL: http://codereview.chromium.org/3774002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62515 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: fix directory listing parser for ftp.usa.hp.comphajdan.jr@chromium.org2010-09-306-0/+87
| | | | | | | | | BUG=56547 TEST=net_unittests Review URL: http://codereview.chromium.org/3448029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61052 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 60765 - FTP: fix directory listing parser for ftp.usa.hp.comphajdan.jr@chromium.org2010-09-286-87/+0
| | | | | | | | | | | BUG=56547 TEST=net_unittests Review URL: http://codereview.chromium.org/3448029 TBR=phajdan.jr@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60766 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: fix directory listing parser for ftp.usa.hp.comphajdan.jr@chromium.org2010-09-286-0/+87
| | | | | | | | | BUG=56547 TEST=net_unittests Review URL: http://codereview.chromium.org/3448029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60765 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a renderer crash while processing FTP directory listing.phajdan.jr@chromium.org2010-06-262-0/+1
| | | | | | | | | | | | | | | | | The problem was caused by a broken assumption about current_parser_. After adding OnEndOfInput to FtpDirectoryListingParser interface, it was possible that during processing of input we ended up with just one parser, which returned error when OnEndOfInput was called. In that case, we should just reset current_parser_ to NULL to avoid a use-after-free error. TEST=net_unittests BUG=47528 Review URL: http://codereview.chromium.org/2846037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50930 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the "ls -l" style date parser to correctly guess the year if it is not ↵phajdan.jr@chromium.org2010-03-2410-16/+16
| | | | | | | | | | | | | provided. Also provide an infrastructure to mock the current time in the tests. BUG=36293 TEST=net_unittests Review URL: http://codereview.chromium.org/1120012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42447 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for MLSD FTP directory listing (RFC-3659)phajdan.jr@chromium.org2009-12-104-0/+58
| | | | | | | | | | | At least the format is specified... that's a good thing. TEST=Covered by net_unittests. BUG=25520, 29691 Review URL: http://codereview.chromium.org/479004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34268 0039d316-1c4b-4281-b951-d872f2087c98
* Compatibility updates for "ls -l" style FTP LIST response parser:phajdan.jr@chromium.org2009-12-104-0/+109
| | | | | | | | | | | | - recognize permission listing with ACL indicator as valid - add one more test for non-ASCII encoding TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/472003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34240 0039d316-1c4b-4281-b951-d872f2087c98
* Compatibility improvements for "ls -l" FTP LIST response format.phajdan.jr@chromium.org2009-12-084-0/+58
| | | | | | | | | TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/460139 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34079 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for wu-ftpd style FTP LIST response format.phajdan.jr@chromium.org2009-12-084-0/+140
| | | | | | | | | TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/469010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34049 0039d316-1c4b-4281-b951-d872f2087c98
* Implement parser for Netware-style FTP LIST response listing.phajdan.jr@chromium.org2009-12-074-0/+50
| | | | | | | | | TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/465059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33978 0039d316-1c4b-4281-b951-d872f2087c98
* Make new FTP LIST parsing code more robust.phajdan.jr@chromium.org2009-12-0312-0/+288
| | | | | | | | | | | | | | Some highlights: - more tests (including non-ASCII characters in different encodings) - handling more variants of "ls" listing - handling spaces in file names in "ls" listings TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/449011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33688 0039d316-1c4b-4281-b951-d872f2087c98
* Fix recognizing FTP listings consisting of only one line.phajdan.jr@chromium.org2009-11-232-0/+9
| | | | | | | | | | | | | | It turns out we have to be a little more strict with that. Before this change both ls and VMS listing parsers would claim that they recognize the format. Also fallback to Mozilla code was broken in that case. TEST=Covered by net_unittests. BUG=28263 Review URL: http://codereview.chromium.org/421006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32831 0039d316-1c4b-4281-b951-d872f2087c98
* Implement Windows FTP directory listing parser.phajdan.jr@chromium.org2009-11-074-0/+178
| | | | | | | | | TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/374010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31376 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the "ls -l" FTP LIST format parser to understand correctlyphajdan.jr@chromium.org2009-11-064-0/+150
| | | | | | | | | | | listings sent by VMS MultiNet servers emulating Unix. TEST=Covered by net_unittests. BUG=22193, 25520 Review URL: http://codereview.chromium.org/368006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31217 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Fix leaking UCharsetDetector in ftp code.mattm@chromium.org2009-11-052-0/+59
| | | | | | | | | | CID=7193 BUG=none TEST=using the additional test data, tools/valgrind/chrome_tests.sh -t net --gtest_filter="FtpDirectoryListingBufferTest.*" Review URL: http://codereview.chromium.org/355037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31099 0039d316-1c4b-4281-b951-d872f2087c98
* Implement VMS FTP directory listing parser.phajdan.jr@chromium.org2009-11-048-0/+501
| | | | | | | | | | | | | This may not yet correctly handle all possible variants of VMS, because there multiple TCP/IP network stacks available for that system. TEST=Covered by net_unittests. BUG=22193, 25520 Review URL: http://codereview.chromium.org/348036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30995 0039d316-1c4b-4281-b951-d872f2087c98
* Also parse file size in new FTP LIST parsing code.phajdan.jr@chromium.org2009-10-292-0/+13
| | | | | | | | | TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/343022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30445 0039d316-1c4b-4281-b951-d872f2087c98
* First parts of new FTP LIST response parsing code.phajdan.jr@chromium.org2009-10-284-0/+115
Added parser for "ls" listing style, and tests. This is not yet used by the browser (will do that in a following CL). TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/244008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30354 0039d316-1c4b-4281-b951-d872f2087c98