summaryrefslogtreecommitdiffstats
path: root/net/ftp
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup: use OK instead of 0 when checking return code in ↵phajdan.jr@chromium.org2009-09-021-1/+1
| | | | | | | | | | | ftp_network_transaction_unittest.cc TEST=none BUG=none Review URL: http://codereview.chromium.org/176069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25177 0039d316-1c4b-4281-b951-d872f2087c98
* Don't log FTP commands being issued.phajdan.jr@chromium.org2009-09-011-1/+0
| | | | | | | | | TEST=none http://crbug.com/20561 Review URL: http://codereview.chromium.org/173648 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25104 0039d316-1c4b-4281-b951-d872f2087c98
* Move Mozilla FTP LIST response parsing code to net/third_party directory.phajdan.jr@chromium.org2009-09-012-1529/+0
| | | | | | | | | | | This should make licensing terms and third-party origin of the code more clear. TEST=none BUG=none Review URL: http://codereview.chromium.org/179041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25047 0039d316-1c4b-4281-b951-d872f2087c98
* Add histograms for FTP server types encountered by users.phajdan.jr@chromium.org2009-08-282-0/+81
| | | | | | | | | | | This should help with decision which FTP server types we can safely stop supporting. TEST=none BUG=none Review URL: http://codereview.chromium.org/176020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24824 0039d316-1c4b-4281-b951-d872f2087c98
* Don't trust server's PASV response that much in FtpNetworkTransaction.phajdan.jr@chromium.org2009-08-283-38/+116
| | | | | | | | | TEST=Covered by net_unittests. http://crbug.com/20334 Review URL: http://codereview.chromium.org/180011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24818 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix a ton of compiler warnings."tony@chromium.org2009-08-281-5/+5
| | | | | | | | | | | This reverts commit r24792. TBR=estade Review URL: http://codereview.chromium.org/179028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a ton of compiler warnings.estade@chromium.org2009-08-281-5/+5
| | | | | | | | | | | | | | | Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
* Fix transaction hang when downloading certain FTP files.phajdan.jr@chromium.org2009-08-262-1/+76
| | | | | | | | | TEST=Covered by net_unittests. http://crbug.com/19855 Review URL: http://codereview.chromium.org/174428 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24492 0039d316-1c4b-4281-b951-d872f2087c98
* Implement RestartWithAuth for NewFtpTransaction.phajdan.jr@chromium.org2009-08-264-32/+62
| | | | | | | | | TEST=Covered by net_unittests. http://crbug.com/20112 Review URL: http://codereview.chromium.org/173270 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24449 0039d316-1c4b-4281-b951-d872f2087c98
* Followup after http://codereview.chromium.org/165167, fixing the nits in ↵phajdan.jr@chromium.org2009-08-212-9/+9
| | | | | | | | | | | FtpAuthCache. TEST=Covered by net_unittests. BUG=none Review URL: http://codereview.chromium.org/174184 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23961 0039d316-1c4b-4281-b951-d872f2087c98
* LoadLog is used as an output parameter, reorder it to the last parameter.willchan@chromium.org2009-08-144-13/+13
| | | | | | Review URL: http://codereview.chromium.org/164531 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23419 0039d316-1c4b-4281-b951-d872f2087c98
* Add a missing Stop() call to DoDataResolveHostComplete().wtc@chromium.org2009-08-131-4/+6
| | | | | | | | | | | | | | Fix some minor nits. The patch is contributed by Ibrar Ahmed <ibrar.ahmad@gmail.com>. Original review URL: http://codereview.chromium.org/164330 R=wtc BUG=http://crbug.com/4965 TEST=none Review URL: http://codereview.chromium.org/165496 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23389 0039d316-1c4b-4281-b951-d872f2087c98
* Make FtpNetworkTransaction report its load state.phajdan.jr@chromium.org2009-08-122-0/+22
| | | | | | | | | TEST=Covered by net_unittests. http://crbug.com/19095 Review URL: http://codereview.chromium.org/164354 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23201 0039d316-1c4b-4281-b951-d872f2087c98
* Add a "LoadLog" parameter to transactions, hostresolver, clientsocketpool ↵ericroman@google.com2009-08-124-7/+17
| | | | | | | | and proyxservice.This dependency comes from the parent URLRequest, and is used as a container for per-request profiling data.This change is strictly a no-op refactor -- the parameter is unused, and LoadLog does nothing.BUG=http://crbug.com/14478TEST=none -- just needs to compile and pass existing tests.DESIGN=<http://docs.google.com/Doc?id=dfhcnb2v_21gbtrcpr3&hl=en> Review URL: http://codereview.chromium.org/126303 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23127 0039d316-1c4b-4281-b951-d872f2087c98
* Enforce maximum number of entries in FtpAuthCache.phajdan.jr@chromium.org2009-08-113-27/+83
| | | | | | | | | TEST=Covered by net_unittests. BUG=none Review URL: http://codereview.chromium.org/165167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23094 0039d316-1c4b-4281-b951-d872f2087c98
* Make response code in FtpNetworkTransaction more precise.phajdan.jr@chromium.org2009-08-112-41/+47
| | | | | | | | | | | I consulted RFC 959 while making the changes and checked with real FTP sites. TEST=Covered by net_unittests. http://crbug.com/4965 Review URL: http://codereview.chromium.org/165161 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22977 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup in new ftp transaction:phajdan.jr@chromium.org2009-08-072-50/+82
| | | | | | | | | | | | | - don't use C cast, which is forbidden by the C++ style guide - more intuitive error class names - more precise error class descriptions, based on the RFC 959 TEST=none http://crbug.com/4965 Review URL: http://codereview.chromium.org/164162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22774 0039d316-1c4b-4281-b951-d872f2087c98
* Properly handle invalid server control responses.phajdan.jr@chromium.org2009-08-062-1/+28
| | | | | | | | | | | We should immediately stop the ftp network transaction in such case. TEST=Covered by net_unittests. http://crbug.com/18546 Review URL: http://codereview.chromium.org/164067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22664 0039d316-1c4b-4281-b951-d872f2087c98
* Correctly handle multiple control responses for RETR command.phajdan.jr@chromium.org2009-08-053-21/+52
| | | | | | | | | | | | Re-enable tests which were intermittently failing before this fix and remove debugging code used to track down the issue. TEST=Covered by net_unittests. http://crbug.com/18036 Review URL: http://codereview.chromium.org/160537 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22500 0039d316-1c4b-4281-b951-d872f2087c98
* Followup after http://codereview.chromium.org/149368phajdan.jr@chromium.org2009-08-034-41/+34
| | | | | | | | | | | Fix minor issues in new ftp code. TEST=none BUG=none Review URL: http://codereview.chromium.org/160541 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22347 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a hang if directory listing size is > 8K, for example,wtc@chromium.org2009-07-311-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | ftp://ftp.mozilla.org/pub/addons/ The problem is that data was spooling on network stack and after 8K data TCP Window size becomes small and no more data is received after 8K. The fix is to change the ERROR_CLASS_INITIATED case in the ProcessResponseLIST function to not go back to the STATE_CTRL_READ state. In URLRequestNewFtpJob::ProcessFtpDir. construct the std::string from buf->data() and its length so that buf->data() doesn't need to be null-terminated. Author: Ibrar Ahmed <ibrar.ahmad@gmail.com> Original review: http://codereview.chromium.org/146137 R=wtc,phajdan.jr BUG=http://crbug.com/4965 TEST=ftp://ftp.mozilla.org/pub/addons/ Review URL: http://codereview.chromium.org/159663 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22217 0039d316-1c4b-4281-b951-d872f2087c98
* Add temporary debugging code to diagnose intermittent net_unittests crashes ↵phajdan.jr@chromium.org2009-07-302-0/+18
| | | | | | | | | | | | | on Mac. I can't reproduce locally, but the code should give enough info after one crash. TEST=none http://crbug.com/18036 Review URL: http://codereview.chromium.org/160421 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22119 0039d316-1c4b-4281-b951-d872f2087c98
* Fix uninitialized memory read in FtpNetworkTransaction.phajdan.jr@chromium.org2009-07-301-2/+0
| | | | | | | | | | The comment is inaccurate anyway. Landing a subset of Ibrar's patch. TBR=wtc Review URL: http://codereview.chromium.org/159652 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22082 0039d316-1c4b-4281-b951-d872f2087c98
* Rework FTP control response parsing code and fix socket Write misuse.phajdan.jr@chromium.org2009-07-286-217/+521
| | | | | | | | | | | It also fixes other minor issues in the code, and makes ftp.vim.org work! TEST=Visit ftp.vim.org on Linux with Chromium compiled in Debug mode. You should see directory listing after a short while. BUG=http://crbug.com/15792 Review URL: http://codereview.chromium.org/149368 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21881 0039d316-1c4b-4281-b951-d872f2087c98
* Use base::Time::Exploded instead of struct tm inwtc@chromium.org2009-07-172-129/+116
| | | | | | | | | | | | | | | ftp_directory_parser.{h,cc}. The patch is contributed by Ibrar Ahmed <ibrar.ahmad@gmail.com>. Original review URL: http://codereview.chromium.org/126096 R=wtc BUG=http://crbug.com/4965 TEST=none Review URL: http://codereview.chromium.org/149772 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21003 0039d316-1c4b-4281-b951-d872f2087c98
* Refactorings surrounding HostResolver:ericroman@google.com2009-07-151-6/+5
| | | | | | | | | | | | | | | | | | | | | | (1) Extract HostResolver to an interface. The existing concrete implementation is now named HostResolverImpl. This makes it possible to create mocks with more complex behavior (i.e. choose via rules if response will be sync vs async). (2) Transform HostMapper into HostResolverProc. Conceptually HostResolverProc maps a hostname to a socket address, whereas HostMapper mapped a hostname to another hostname (so you were still at the mercy of the system's host resolver). With HostResolverProc you can specify the exact AddressList, making it possible to run tests requiring IPv6 socketaddrs on systems (like WinXP) that don't actually support it. (3) Add a MockHostResolver implementation of HostResolver. This replaces the [ScopedHostMapper + RuleBasedHostMapper + HostResolver] combo. It is less clunky and a bit more expressive. BUG=http://crbug.com/16452 R=willchan TEST=existing Review URL: http://codereview.chromium.org/149511 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20795 0039d316-1c4b-4281-b951-d872f2087c98
* Correctly handle multiple control response lines in new FTP transactionphajdan.jr@chromium.org2009-07-082-6/+65
| | | | | | | | | | | After this change it should correctly handle all cases of multiple 230 welcome responses. It also fixes some other related bugs. TEST=Covered by net_unittests. BUG=none Review URL: http://codereview.chromium.org/149211 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20148 0039d316-1c4b-4281-b951-d872f2087c98
* Make new FtpNetworkTransaction handle short reads correctly.phajdan.jr@chromium.org2009-07-063-159/+246
| | | | | | | | | | | | | | The problem was that some functions were parsing response lines, but without checking that they have the entire line available. This change will also make it easier to handle multi-line greeting (230 welcome messages). I plan to do that afterwards. TEST=Covered by net_unittests. http://crbug.com/15259 Review URL: http://codereview.chromium.org/149043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19954 0039d316-1c4b-4281-b951-d872f2087c98
* Make net::HostResolver refcounted.ericroman@google.com2009-06-272-3/+2
| | | | | | | | | | | This way it can be properly shared between the url request contexts, and the dns prefetcher, and dns observer. BUG=http://crbug.com/14664 TEST=existing unit tests. Review URL: http://codereview.chromium.org/149053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19451 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 19425.ericroman@google.com2009-06-262-2/+3
| | | | | | Review URL: http://codereview.chromium.org/147242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19432 0039d316-1c4b-4281-b951-d872f2087c98
* Make net::HostResolver refcounted.ericroman@google.com2009-06-262-3/+2
| | | | | | | | | | | This way it can be properly shared between the url request contexts, and the dns prefetcher, and dns observer. BUG=http://crbug.com/14664 TEST=existing unit tests. Review URL: http://codereview.chromium.org/149053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19425 0039d316-1c4b-4281-b951-d872f2087c98
* Add DCHECKs to the states that should be entered only when thewtc@chromium.org2009-06-261-0/+7
| | | | | | | | | | | previous state succeeded. R=ibrar,phajdan.jr BUG=http://crbug.com/4965 TEST=none Review URL: http://codereview.chromium.org/149013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19394 0039d316-1c4b-4281-b951-d872f2087c98
* If we get a connect error in DoCtrlConnectComplete, do not advance towtc@chromium.org2009-06-251-1/+2
| | | | | | | | | | | the STATE_CTRL_READ state. R=ibrar,phajdan.jr BUG=http://crbug.com/4965 TEST=none Review URL: http://codereview.chromium.org/146065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19253 0039d316-1c4b-4281-b951-d872f2087c98
* Return potentially more specific error code in FtpNetworkTransaction.phajdan.jr@chromium.org2009-06-241-2/+2
| | | | | | Review URL: http://codereview.chromium.org/147111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19180 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent infinite loop in new FtpNetworkTransaction.phajdan.jr@chromium.org2009-06-241-1/+4
| | | | | | | | | | It tried to send a QUIT command when sending QUIT command failed. BUG=none TEST=none Review URL: http://codereview.chromium.org/146103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19177 0039d316-1c4b-4281-b951-d872f2087c98
* Move socket related files from net/base to net/socket.willchan@chromium.org2009-06-223-4/+4
| | | | | | Review URL: http://codereview.chromium.org/144009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18985 0039d316-1c4b-4281-b951-d872f2087c98
* Add a simple cache of certificates for SSL client authentication.wtc@chromium.org2009-06-181-1/+1
| | | | | | | | | | | | | It is based on FtpAuthCache and will be used in similar ways. The the only difference is that the authentication data is a certificate rather than username and password. R=eroman BUG=http://crbug.com/318 TEST=new unit tests. Review URL: http://codereview.chromium.org/132004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18735 0039d316-1c4b-4281-b951-d872f2087c98
* Initialize IOBuffers in new FTP unit tests (issue detected by valgrind).phajdan.jr@chromium.org2009-06-151-4/+13
| | | | | | | | | | TEST=none BUG=http://crbug.com/12409 Review URL: http://codereview.chromium.org/126120 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18381 0039d316-1c4b-4281-b951-d872f2087c98
* Add unit tests for new FTP network transaction.phajdan.jr@chromium.org2009-06-151-0/+498
| | | | | | | | | | TEST=Covered by net_unittests. http://crbug.com/12409 Review URL: http://codereview.chromium.org/115779 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18375 0039d316-1c4b-4281-b951-d872f2087c98
* [Refactor] Rename DnsResolutionObserver --> HostResolver::Observer.ericroman@google.com2009-06-151-1/+0
| | | | | | | | | | TEST=this is striclty a refactoring; just needs to compile and pass existing tests. BUG=14056 Review URL: http://codereview.chromium.org/126110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18372 0039d316-1c4b-4281-b951-d872f2087c98
* * Move the global "DnsResolutionObserver" code depended on by DNS ↵ericroman@google.com2009-06-151-7/+7
| | | | | | | | | | | | | | prefetcher, into HostResolver. This has the advantage that consumers of DNS no longer have to remember to call "DidFinishDnsResolutionWithStatus()" followed by "DidStartDnsResolution()" in order for the prefetcher to observe the resolution. Instead it just happens automatically, and subscribers register via HostResolver::AddObserver() on a particular resolver instance. * To accomodate the prefetcher's observer, HostResolver::Resolve() needs an additional "referrer" parameter. This is slightly awkward since "referrer" has nothing to do with the actual resolve request. To simplify plumbing through this and other optional parameters, Resolve() was changed to take a "RequestInfo&" parameter in place of say {hostname, port, flags}. * Added an option to HostResolver::Resolve() for disallowing cached responses (RequestInfo::allow_cached_response). This will be used when you refresh a page, to bypass the host cache. The code to do this has been added to HttpNetworkTransaction, but is commented out pending an appropriate unit-test to verify it. BUG=14056 Review URL: http://codereview.chromium.org/125107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18371 0039d316-1c4b-4281-b951-d872f2087c98
* * Avoid doing concurrent DNS resolves of the same hostname in HostResolver.ericroman@google.com2009-06-125-9/+18
| | | | | | | | | | | | | | | | * Add a 1 minute cache for host resolves. * Refactor HostResolver to handle multiple requests. * Make HostResolver a dependency of URLRequestContext. operate the HostResolver in async mode for proxy resolver (bridging to IO thread). TEST=unittests BUG=13163 Review URL: http://codereview.chromium.org/118100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18236 0039d316-1c4b-4281-b951-d872f2087c98
* Fix FTP binary file download issue.wtc@chromium.org2009-06-091-5/+6
| | | | | | | | | | | | | The patch is contributed by Ibrar Ahmed <ibrar.ahmad@gmail.com>. Original review: http://codereview.chromium.org/118455 R=wtc BUG=http://crbug.com/4965 TEST=Run with --new-ftp, and try to download a file. Review URL: http://codereview.chromium.org/118459 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17981 0039d316-1c4b-4281-b951-d872f2087c98
* Check in the fourth Portable FTP CL from Ibrar Ahmedwtc@chromium.org2009-06-054-66/+191
| | | | | | | | | | | | | | | | <ibrar.ahmad@gmail.com>. Now we can browse some ftp sites and can download files. There are some TODO yet to be fixed. Original review: http://codereview.chromium.org/115291 R=wtc BUG=http://crbug.com/4965 TEST=none Review URL: http://codereview.chromium.org/118274 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17703 0039d316-1c4b-4281-b951-d872f2087c98
* FTP Transaction code for new Portable FTP code.wtc@chromium.org2009-05-118-81/+754
| | | | | | | | | | | | | The patch is contributed by Ibrar Ahmed <ibrar.ahmad@gmail.com>. Original review: http://codereview.chromium.org/39130 R=wtc http://crbug.com/4965 TEST=None. Work in progress. Review URL: http://codereview.chromium.org/115137 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15760 0039d316-1c4b-4281-b951-d872f2087c98
* Add the directory listing code for the new portable FTPwtc@chromium.org2009-03-192-0/+1537
| | | | | | | | | | | | | implementation, based on the Mozilla code mozilla/netwerk/streamconv/converters/ParseFTPList.cpp. Contributed by Ibrar Ahmed <ibrar.ahmad@gmail.com>. R=darin,wtc BUG=4965 Review URL: http://codereview.chromium.org/42261 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12171 0039d316-1c4b-4281-b951-d872f2087c98
* Add command line switch "--new-ftp" for new portable FTPwtc@chromium.org2009-03-161-1/+1
| | | | | | | | | | | | | | implementation. Add the (empty) URLRequestNewFtpJob class. Contributed by Ibrar Ahmed <ibrar.ahmad@gmail.com>. BUG=4965 R=darin,wtc Review URL: http://codereview.chromium.org/42197 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11768 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unneeded uses of logging.h in header files.thestig@chromium.org2009-03-121-0/+1
| | | | | | Review URL: http://codereview.chromium.org/43148 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11590 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-112-2/+0
| | | | | | | | | Normalize end of file newlines in net/. All files end in a single newline. Review URL: http://codereview.chromium.org/43079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11442 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes CRLF and trailing white spaces.maruel@chromium.org2009-03-051-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98