summaryrefslogtreecommitdiffstats
path: root/net/ftp
Commit message (Collapse)AuthorAgeFilesLines
* FTP: Fix an infinite loop in a rare condition.phajdan.jr@chromium.org2010-05-152-13/+15
| | | | | | | | | | | | | After issuing the PASS command, we should never issue earlier commands again. The code was sending USER when it received "503 Bad command sequence" error code. TEST=added to net_unittests BUG=38707 Review URL: http://codereview.chromium.org/2094002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47364 0039d316-1c4b-4281-b951-d872f2087c98
* FTP: fix navigating to files listed under non-ASCII charactersphajdan.jr@chromium.org2010-05-112-29/+7
| | | | | | | | | | | We need to convert the file name back to server encoding. BUG=38016 TEST=see bug Review URL: http://codereview.chromium.org/1857002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46900 0039d316-1c4b-4281-b951-d872f2087c98
* Pass nulls through test sockets.gavinp@chromium.org2010-05-101-9/+29
| | | | | | | | | | | | | Fixing 35050, one of the tests I wrote for EPSV required NULS go through the testing framework. That created issue 42432 which covers permitting NULs through our socket tests. I added an interface to SimulateRead which passes in an explicit length, and moved as much of that into ftp_network_transaction_unittest as possible. BUG=42432 TEST=see the modified Epsv test in ftp_network_transaction_unittest.cc Review URL: http://codereview.chromium.org/1949003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46813 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove the implicit constructor for BoundNetLog that allowed ↵eroman@chromium.org2010-04-281-5/+5
| | | | | | | | | passing NULL in place of a const BoundNetLog&. BUG=37421 Review URL: http://codereview.chromium.org/1783008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45851 0039d316-1c4b-4281-b951-d872f2087c98
* Add net log entries that summarize transmit and receive byte counts.vandebo@chromium.org2010-04-231-4/+6
| | | | | | | | | | | | | | | | | | | | | Tx/Rx summaries are integrated into the net log at the last point that bytes were transmitted or received. Hopefully this will help resolve http://crbug.com/37729 by showing if we've received bytes over the network when we hit the "Waiting for cache" bug. This change also modernizes the use of NetLog: - ClientSocket now has a net_log() accessor - ClientSocket::Connect no longer takes a NetLog, instead the TCPClientSocket constructor takes one, others use their transport socket's NetLog - TCPClientSocket creates a new source id with source type SOCKET Also updates PassiveLogCollector infrastructure: - The LiveRequestsObserver lets a RequestTracker update a RequestInfo just before it is displayed. This allows ConnectJobs to be associated with URLRequests while connecting and then reassociated if they are late-bound to a different request. BUG=37729 TEST=tx/rx lines show up in chrome://net-internals/ Review URL: http://codereview.chromium.org/1696005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45449 0039d316-1c4b-4281-b951-d872f2087c98
* Modify FTP to implement EPSV per RFC 2428. EPSV is an extended versioncbentzel@chromium.org2010-04-123-64/+325
| | | | | | | | | | | | | | | of PASV, intended specifically to address IPv6 compatibility in FTP. With this change, we now always prefer EPSV over PASV, however our FTP client will fall back to PASV in the case that a remote host does not support EPSV. Contributed by: gavinp@google.com BUG=35050 TEST=ftp to an ipv6 site like ftp.netbsd.org and retrieve data Review URL: http://codereview.chromium.org/1600017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44262 0039d316-1c4b-4281-b951-d872f2087c98
* Fix out of array bounds access in VMSPathToUnix function.inferno@chromium.org2010-04-082-1/+2
| | | | | | | | | BUG=40801 TEST=FtpUtilTest.VMSPathToUnix Review URL: http://codereview.chromium.org/1566029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43961 0039d316-1c4b-4281-b951-d872f2087c98
* Make sure to strip the brackets around IPv6 literals when resolving the ↵eroman@chromium.org2010-04-072-1/+16
| | | | | | | | | | | hostname for FTP. BUG=39830 (comment #9) TEST=FtpNetworkTransactionTest.StripBracketsFromIPv6Literals Review URL: http://codereview.chromium.org/1585022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43888 0039d316-1c4b-4281-b951-d872f2087c98
* Respect typecode in the FTP network transaction.phajdan.jr@chromium.org2010-03-243-19/+145
| | | | | | | | | | | See RFC 1738. BUG=31819 TEST=net_unittests Review URL: http://codereview.chromium.org/1170003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42518 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-2412-55/+106
| | | | | | | | | | | | | 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 unit test to check for zero length dir in FTP PWD response. inferno@chromium.org2010-03-221-0/+11
| | | | | | | | BUG=38845 TEST=FtpNetworkTransactionTest.ZeroLengthDirInPWD Review URL: http://codereview.chromium.org/1166001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42238 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the out-of-bounds array read in the ftp response.inferno@chromium.org2010-03-221-1/+1
| | | | | | | | BUG=38845 TEST=Pass a ftp server response having two double quotes with no character in between and verify no browser crash happens. Review URL: http://codereview.chromium.org/1082008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42204 0039d316-1c4b-4281-b951-d872f2087c98
* Generalize the net module's LoadLog facility from a passive container, to an ↵eroman@chromium.org2010-03-163-11/+12
| | | | | | | | | | | | | | | | event stream (NetLog). This makes it possible to associate a single NetLog with a URLRequestContext, and then attach observers to that log to watch the stream of events. This changelist attempts to do the most direct translation, so there will be subsequent iterations to clean up. The user-visible behavior should remain unchanged. BUG=37421 Review URL: http://codereview.chromium.org/848006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41689 0039d316-1c4b-4281-b951-d872f2087c98
* net: string_utils.h -> utf_string_conversions.h fix.jhawkins@chromium.org2010-03-0812-1/+13
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/668267 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40935 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the problems with some FTP transactions taking a long time.phajdan.jr@chromium.org2010-03-062-74/+27
| | | | | | | | | | | | | | | | | | | | The root cause was not firing the completion callback at the first point the data could be read. This lead to a temporary deaadlock-like situation, where the browser was waiting for the server to send a response on the control connection, and the server was waiting for the browser to start reading from the data connection. This patch makes the completion callback fire as soon as data is ready. It also removes a broken test. We should get a coverage for that scenario from other tests. TEST=Covered by net_unittests. BUG=36116 Review URL: http://codereview.chromium.org/668162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40833 0039d316-1c4b-4281-b951-d872f2087c98
* Add a test for correct FTP SIZE response handling when the file sizephajdan.jr@chromium.org2010-02-251-6/+17
| | | | | | | | | | | is big (doesn't fit in a 32-bit integer). TEST=net_unittests BUG=36360 Review URL: http://codereview.chromium.org/654011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40022 0039d316-1c4b-4281-b951-d872f2087c98
* Really connect to the same server in FTP network transaction.phajdan.jr@chromium.org2010-02-202-22/+24
| | | | | | | | | | | | Also create necessary infrastructure to know the address a client socket is connected to. TEST=Covered by net_unittests. BUG=35670 Review URL: http://codereview.chromium.org/598071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39559 0039d316-1c4b-4281-b951-d872f2087c98
* Improve error reporting for FTP passive connection failures.wtc@chromium.org2010-02-192-5/+5
| | | | | | | | | | | Allocate the -6xx block to FTP errors. R=phajdan.jr BUG=32945 TEST=None Review URL: http://codereview.chromium.org/650006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39510 0039d316-1c4b-4281-b951-d872f2087c98
* Disable IPv6 in FTP until we have implemented the IPv6 extensions for FTPwtc@chromium.org2010-02-191-1/+4
| | | | | | | | | | | | specified in RFC 2428. R=eroman,phajdan.jr BUG=32945 TEST=ftp://ftp.netbsd.org/ should work on a machine with dual IPv4/IPv6 connectivity. Review URL: http://codereview.chromium.org/592001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39416 0039d316-1c4b-4281-b951-d872f2087c98
* Pass the file size infomration from the FTP network transactionphajdan.jr@chromium.org2010-02-134-7/+54
| | | | | | | | | | | to higher parts of the network stack. BUG=23794 TEST=Covered by net_unittest, also see the bug. Review URL: http://codereview.chromium.org/601027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39017 0039d316-1c4b-4281-b951-d872f2087c98
* Add bounds checking to StaticSocketDataProvider, to make tests more reliablephajdan.jr@chromium.org2010-02-091-6/+10
| | | | | | | | | | | when they fail. TEST=net_unittests BUG=27567 Review URL: http://codereview.chromium.org/582020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38453 0039d316-1c4b-4281-b951-d872f2087c98
* Make description in FTP data connection histogram more accurate.phajdan.jr@chromium.org2010-01-201-3/+3
| | | | | | | | | | | This is a follow-up after http://codereview.chromium.org/547020 TEST=none BUG=3073 Review URL: http://codereview.chromium.org/553013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36634 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the fallback Mozilla code for parsing FTP LIST response.phajdan.jr@chromium.org2010-01-201-17/+4
| | | | | | | | | | | | | | | | | | The new parser seems to be compatible enough to do that. The Mozilla code was very helpful in the process of developing the new parser. Also add UI encouraging users to submit bug reports when we can't parse the listings, and an option to see the raw data sent by the server. This should allow us to fix remaining compatibility problems with very rare listing types or variations. When ?raw is found at the end of an FTP url and it is a directory listing, the parsing logic is bypassed and the data is displayed as-is with text/plain MIME type. TEST=none BUG=25520 Review URL: http://codereview.chromium.org/549053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36632 0039d316-1c4b-4281-b951-d872f2087c98
* Record more categories of errors for ftp data connection histograms.phajdan.jr@chromium.org2010-01-121-1/+22
| | | | | | | | | | | The "other error" bucket gets too many hits. TEST=none BUG=3073 Review URL: http://codereview.chromium.org/547020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36002 0039d316-1c4b-4281-b951-d872f2087c98
* Correctly handle file names with spaces in Windows FTP LIST parser.phajdan.jr@chromium.org2010-01-126-20/+62
| | | | | | | | | TEST=Covered by net_unittests. BUG=none Review URL: http://codereview.chromium.org/541023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36001 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup histogram classes mixing SetFlags into FactoryGet argumentsjar@chromium.org2009-12-282-47/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Generic cleanup of histogram class, renaming *FactoryGet to FactoryGet, along with reformatting. The macros were cleaned up to use common sub-macros rather than repeating code as much. Removed ThreadSafeHistogram (and associated ASSET_HISTOGRAM macros) since this class was not getting used. I introduced UMA_HISTOGRAM_ENUMERATION to support the common use of LinearHistograms to count various enumerated values. I added a Flags argument to all the FactoryGet routines to help avoid needing to call SetFlags each time a new sample is Add()ed. This also simplifies the code. This will all help prepare for a "don't histogram at all" macro setting so that I can test the impact of the histogram macro calls on performance (since there are now so many active histograms). BUG=31206 r=raman.tenneti Review URL: http://codereview.chromium.org/515033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35295 0039d316-1c4b-4281-b951-d872f2087c98
* Implement support for MLSD FTP command in FtpNetworkTransaction.phajdan.jr@chromium.org2009-12-223-6/+71
| | | | | | | | | | | | This way we can request the better-parseable MLSD listing, and in case it doesn't work fall back to LIST command. TEST=Covered by net_unittests. BUG=29691 Review URL: http://codereview.chromium.org/500134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35141 0039d316-1c4b-4281-b951-d872f2087c98
* Minor cleanup: add a sys_addrinfo.h header that hides the platform-specific ↵eroman@chromium.org2009-12-121-7/+1
| | | | | | | | | | includes needed for struct addrinfo / struct sockaddr, since we were duplicating that #if #else logic in a growing number of places. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/491038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34399 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for MLSD FTP directory listing (RFC-3659)phajdan.jr@chromium.org2009-12-106-0/+237
| | | | | | | | | | | 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-103-2/+12
| | | | | | | | | | | | - 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-19/+46
| | | | | | | | | 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-17/+64
| | | | | | | | | 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
* net/ftp: Fix control response parsing for a corner cases where the first ↵thestig@chromium.org2009-12-073-17/+42
| | | | | | | | | | line of a continuation has 0 length. BUG=29322 TEST=ftp://sourceware.org works. Review URL: http://codereview.chromium.org/467032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33986 0039d316-1c4b-4281-b951-d872f2087c98
* Implement parser for Netware-style FTP LIST response listing.phajdan.jr@chromium.org2009-12-0711-57/+335
| | | | | | | | | 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
* Use factory to create histograms, and refcounts to track lifetimesjar@chromium.org2009-12-062-20/+24
| | | | | | | | | | | | | | | This is CL patch 377028 by Raman Tenneti, with minor changes to make the try-bots happier. It is cleanup that better ensures lifetimes of histograms (making it harder for users to abuse them). bug=16495 (repairs leak induced by the first landing) bug=18840 (should make leaks less possible) tbr=raman.tenneti Review URL: http://codereview.chromium.org/462027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33933 0039d316-1c4b-4281-b951-d872f2087c98
* Split FTP LIST parsing code into individual files for each listing style.phajdan.jr@chromium.org2009-12-0419-1011/+1164
| | | | | | | | | | | | This turns out to be much better code organisation strategy. We're going to have even more parsers. TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/465035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33807 0039d316-1c4b-4281-b951-d872f2087c98
* Make new FTP LIST parsing code more robust.phajdan.jr@chromium.org2009-12-033-16/+98
| | | | | | | | | | | | | | 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-236-1/+57
| | | | | | | | | | | | | | 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
* Fix one source of flakiness of FTP tests.phajdan.jr@chromium.org2009-11-232-0/+33
| | | | | | | | | | | | It turns out that similarly to RETR case, we can get two responses for LIST command, if the transfer finishes quickly enough. TEST=net_unittests BUG=25045 Review URL: http://codereview.chromium.org/436002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32823 0039d316-1c4b-4281-b951-d872f2087c98
* Add compiler-specific "examine printf format" attributes to printfs.evan@chromium.org2009-11-202-5/+7
| | | | | | | | | | | | Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98
* Add histograms for data connection error types.phajdan.jr@chromium.org2009-11-172-0/+80
| | | | | | | | | | | | The plan is to see how many of them are possibly caused by the passive FTP mode being blocked in the network. TEST=none BUG=3073 Review URL: http://codereview.chromium.org/389023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32175 0039d316-1c4b-4281-b951-d872f2087c98
* There was confusion in the mock socket classes due tombelshe@google.com2009-11-111-190/+190
| | | | | | | | | | | | | | | | | | | overlapping names. The MockSocket is not actually a socket. It is an interface for fetching data for reads and writes on a socket. The MockClientSocket and MockTCPClientSocket are the actual sockets. Rename MockSocket to SocketDataProvider. Rename SSLMockSocket to SSLSocketDataProvider. Update all tests to reflect name change. BUG=none TEST=none Review URL: http://codereview.chromium.org/384024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31640 0039d316-1c4b-4281-b951-d872f2087c98
* Distinguish between old and new FTP LIST response parsersphajdan.jr@chromium.org2009-11-102-10/+18
| | | | | | | | | | | | in FTP histograms. This should allow us to see how compatible the new parser is. TEST=none BUG=25520 Review URL: http://codereview.chromium.org/384007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31591 0039d316-1c4b-4281-b951-d872f2087c98
* Use the new FTP LIST parsing code in the browser.phajdan.jr@chromium.org2009-11-073-6/+23
| | | | | | | | | | | Fall back to the old parsing code on errors. TEST=none BUG=25520 Review URL: http://codereview.chromium.org/343073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31379 0039d316-1c4b-4281-b951-d872f2087c98
* Disable an FTP test which contains a date with year 2079 due to year-2038 ↵phajdan.jr@chromium.org2009-11-071-0/+3
| | | | | | | | | | | | | | | | problem on Linux. The date wraps around then and gives nonsensical results (the field to store the timestamp is too short to store dates beyond year 2038). TBR=wtc TEST=none BUG=25520 Review URL: http://codereview.chromium.org/372044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31378 0039d316-1c4b-4281-b951-d872f2087c98
* Implement Windows FTP directory listing parser.phajdan.jr@chromium.org2009-11-075-2/+163
| | | | | | | | | 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-2/+13
| | | | | | | | | | | 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
* Second patch in making destructors of refcounted objects private.jam@chromium.org2009-11-051-0/+4
| | | | | | | | BUG=26749 Review URL: http://codereview.chromium.org/368001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31165 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Fix leaking UCharsetDetector in ftp code.mattm@chromium.org2009-11-052-0/+2
| | | | | | | | | | 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-045-79/+505
| | | | | | | | | | | | | 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