summaryrefslogtreecommitdiffstats
path: root/net/socket
Commit message (Collapse)AuthorAgeFilesLines
* Fix leak in ClientSocketPoolBaseTest. Don't create ConnectJobFactory unless ↵willchan@chromium.org2009-08-041-6/+5
| | | | | | | | needed. Review URL: http://codereview.chromium.org/159831 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22349 0039d316-1c4b-4281-b951-d872f2087c98
* Add timeouts for ConnectJobs. Limit ConnectJobs per group to number of ↵willchan@chromium.org2009-08-035-18/+161
| | | | | | | | | | Requests per group + 1. In the histograms for Net.SocketRequestTime, late binding has a much longer tail. This is presumably because I didn't implement timeouts and CancelRequest() never cancelled jobs. I'm limiting TCPConnectJobs to 60 seconds and cancelling jobs if there are too many more than there are requests. Review URL: http://codereview.chromium.org/160499 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22338 0039d316-1c4b-4281-b951-d872f2087c98
* Add timeouts for ConnectJobs. Limit ConnectJobs per group to number of ↵willchan@chromium.org2009-08-035-154/+18
| | | | | | | | | | Requests per group + 1. In the histograms for Net.SocketRequestTime, late binding has a much longer tail. This is presumably because I didn't implement timeouts and CancelRequest() never cancelled jobs. I'm limiting TCPConnectJobs to 30 seconds and cancelling jobs if there are too many more than there are requests. Review URL: http://codereview.chromium.org/160499 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22330 0039d316-1c4b-4281-b951-d872f2087c98
* Add timeouts for ConnectJobs. Limit ConnectJobs per group to number of ↵willchan@chromium.org2009-08-035-18/+154
| | | | | | | | | | Requests per group + 1. In the histograms for Net.SocketRequestTime, late binding has a much longer tail. This is presumably because I didn't implement timeouts and CancelRequest() never cancelled jobs. I'm limiting TCPConnectJobs to 30 seconds and cancelling jobs if there are too many more than there are requests. Review URL: http://codereview.chromium.org/160499 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22326 0039d316-1c4b-4281-b951-d872f2087c98
* Integrate OCSP handlers in SSLClientSocketNSS.ukai@chromium.org2009-07-311-1/+6
| | | | | | | | | | | It depends on http://codereview.chromium.org/126046 BUG=none TEST=none Review URL: http://codereview.chromium.org/155912 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22147 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crash in client_socket_pool_base.cc.phajdan.jr@chromium.org2009-07-293-6/+75
| | | | | | | | | | | | | | | The CHECK that was being hit showed a real problem: group's IsEmpty should take into account the pending requests queue too. I also made IsEmpty check for connecting requests queue emptiness, so we can be sure that IsEmpty really means empty. TEST=Added a regression test ClientSocketPoolBaseTest.GroupWithPendingRequestsIsNotEmpty to net_unittests. http://crbug.com/17985 Review URL: http://codereview.chromium.org/159597 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21988 0039d316-1c4b-4281-b951-d872f2087c98
* If a write is pending, just add it to the buffer. Don't trigger a second ↵avi@chromium.org2009-07-291-0/+11
| | | | | | | | | | | concurrent write. BUG=http://crbug.com/17991 TEST=as in bug Review URL: http://codereview.chromium.org/160333 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21981 0039d316-1c4b-4281-b951-d872f2087c98
* Followup after socket tests refactoring http://codereview.chromium.org/155925phajdan.jr@chromium.org2009-07-294-100/+110
| | | | | | | | | | | | | - more complete checks for data validity - private data member with getter instead of public data member, eh - replace some magic numbers with more readable constants TEST=none http://crbug.com/17445 Review URL: http://codereview.chromium.org/159514 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21957 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring in socket pool unittests:phajdan.jr@chromium.org2009-07-234-390/+376
| | | | | | | | | | | | | - share more code - improve readability - help detect cases we don't test order of all requests made TEST=Covered by net_unittests. http://crbug.com/17445 Review URL: http://codereview.chromium.org/155925 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21456 0039d316-1c4b-4281-b951-d872f2087c98
* Limit total number of sockets in the system.phajdan.jr@chromium.org2009-07-226-83/+422
| | | | | | | | | | Based on Eric Roman's patch at http://codereview.chromium.org/62181 http://crbug.com/15093 Review URL: http://codereview.chromium.org/149027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21276 0039d316-1c4b-4281-b951-d872f2087c98
* Use manually constructed IPv6 socket addresses for tests, rather than system ↵ericroman@google.com2009-07-182-13/+3
| | | | | | | | | | | | | | | created ones. The advantage is that GURL's parsing of IPv6 addresses works on all systems, whereas getaddrinfo(ipv6_literal) only succeeds on IPv6 enabled systems. This allows the tests to run consistently on all systems, including our own WinXP buildbots (which do not support IPv6). BUG=http://crbug.com/16452 TEST=[net_unittests] SOCKS5ClientSocketTest.IPv6Domain, SOCKSClientSocketTest.SOCKS4AIfDomainInIPv6 Review URL: http://codereview.chromium.org/155618 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21053 0039d316-1c4b-4281-b951-d872f2087c98
* Add synchronous-mode operation to MockHostResolver; this helps clarify some ↵ericroman@google.com2009-07-181-15/+28
| | | | | | | | tests, which were using caching to get synchronous resolutions.TEST=existingBUG=NONE (addresses a TODO however). Review URL: http://codereview.chromium.org/155620 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21052 0039d316-1c4b-4281-b951-d872f2087c98
* Properly let the SSL engine know when the underlying stream is closed.avi@chromium.org2009-07-161-2/+4
| | | | | | | | | BUG=http://crbug.com/14196 TEST=NONE (this fix is related to the bug but does not fix it) Review URL: http://codereview.chromium.org/155595 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20864 0039d316-1c4b-4281-b951-d872f2087c98
* Disable LoadState net unittest: it's flakeyagl@chromium.org2009-07-161-1/+1
| | | | | | | BUG=16881 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20820 0039d316-1c4b-4281-b951-d872f2087c98
* Refactorings surrounding HostResolver:ericroman@google.com2009-07-158-67/+41
| | | | | | | | | | | | | | | | | | | | | | (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
* Add support for late binding of sockets.willchan@chromium.org2009-07-153-44/+694
| | | | | | | | | | There are tests for this, but the code is not activated yet. The old behavior is maintained. I will follow up this patch with a change to enable an A/B test for this optimization. Credit to jar&mbelshe for the optimization idea. BUG=13289 TEST=Covered by new unit tests. Not activatable yet. Review URL: http://codereview.chromium.org/151190 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20735 0039d316-1c4b-4281-b951-d872f2087c98
* SOCKS v5 implementationarindam@chromium.org2009-07-153-0/+887
| | | | | | | | | | | The implementation is incomplete as it does not support any authentication methods and does not have a UDP layer. BUG=469 TEST=unittests (included) Review URL: http://codereview.chromium.org/150187 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20724 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 20626.arindam@chromium.org2009-07-143-888/+0
| | | | | | | | TBR=eroman Review URL: http://codereview.chromium.org/155505 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20628 0039d316-1c4b-4281-b951-d872f2087c98
* SOCKS v5 implementationarindam@chromium.org2009-07-143-0/+888
| | | | | | | | | | | The implementation is incomplete as it does not support any authentication methods and does not have a UDP layer. BUG=469 TEST=unittests (included) Review URL: http://codereview.chromium.org/150187 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20626 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring needed before adding good unit tests for limiting total socket ↵phajdan.jr@chromium.org2009-07-142-119/+162
| | | | | | | | | | | count. TEST=Covered by net_unittests. http://crbug.com/15093 Review URL: http://codereview.chromium.org/149545 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20623 0039d316-1c4b-4281-b951-d872f2087c98
* Add some CHECKs to track down the source of a NULL deref in the ↵willchan@chromium.org2009-07-101-0/+4
| | | | | | | | | | | SSLClientSocketWin code. BUG=http://crbug.com/16371 TEST=none Review URL: http://codereview.chromium.org/155359 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20415 0039d316-1c4b-4281-b951-d872f2087c98
* Correctly implementing GetPeerName() to point to ↵arindam@chromium.org2009-07-082-9/+5
| | | | | | | | | | | TCPClientSocket::GetPeerName(). This is used by the SSL layer in Linux to resolve Peer Names, which caused a trap to be generated ( http://crbug/16166 ) BUG=16166 TEST=fix of the above BUG Review URL: http://codereview.chromium.org/149242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20170 0039d316-1c4b-4281-b951-d872f2087c98
* Correctly handle multiple control response lines in new FTP transactionphajdan.jr@chromium.org2009-07-082-14/+20
| | | | | | | | | | | 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
* CHECK to make sure connection_group is never empty.willchan@chromium.org2009-07-071-0/+1
| | | | | | | | | | Testing to see if this is the reason we hit the CHECK(!group_name_.empty()) in ClientSocketHandle::GetLoadState(). BUG=http://crbug.com/15374 TEST=none Review URL: http://codereview.chromium.org/155150 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20076 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring in client_socket_pool_base_unittest.cc.phajdan.jr@chromium.org2009-07-061-113/+84
| | | | | | | | | | | | This is a preparation to add tests for limiting total number of sockets. TEST=Covered by net_unittests. http://crbug.com/15093 Review URL: http://codereview.chromium.org/149159 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19975 0039d316-1c4b-4281-b951-d872f2087c98
* Fix up some code not to set off coverity warnings.willchan@chromium.org2009-07-063-3/+6
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/149149 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19962 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Speed up net_unittests by ~20s by manipulating tcp_pinger timeouts."phajdan.jr@chromium.org2009-07-061-2/+2
| | | | | | | | | | | | This reverts commit e0ff42dd35e02eae62f35043072ca23676577cac. Did it break Vista tests? Let's see. TBR=nsylvain Review URL: http://codereview.chromium.org/155093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19958 0039d316-1c4b-4281-b951-d872f2087c98
* Speed up net_unittests by ~20s by manipulating tcp_pinger timeouts.phajdan.jr@chromium.org2009-07-061-2/+2
| | | | | | Review URL: http://codereview.chromium.org/155020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19951 0039d316-1c4b-4281-b951-d872f2087c98
* Make ConnectJob::ReleaseSocket() return NULL on connection error.willchan@chromium.org2009-07-023-1/+6
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/150205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19819 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak on connection error.willchan@chromium.org2009-07-021-2/+2
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/150196 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19792 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor ConnectJob and TCPConnectJob.willchan@chromium.org2009-07-015-163/+291
| | | | | | | | | | | ConnectJob will only call OnConnectJobComplete() on asynchronous completion. TCPConnectJob now uses DoLoop() internally. BUG=http://crbug.com/13289 TEST=none Review URL: http://codereview.chromium.org/151118 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19789 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor ClientSocketPoolBase to be testable without host resolution / tcp ↵willchan@chromium.org2009-06-306-370/+339
| | | | | | | | | | | connections. BUG=http://crbug.com/13289 TEST=none Review URL: http://codereview.chromium.org/147252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19620 0039d316-1c4b-4281-b951-d872f2087c98
* Stop leaking ConnectCallbackWrapper if Connect() does not complete before ↵willchan@chromium.org2009-06-302-40/+46
| | | | | | | | | | | the socket is deleted. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/151059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19592 0039d316-1c4b-4281-b951-d872f2087c98
* Remove some dead code -- this was moved into client_socket_pool_base.cc.ericroman@google.com2009-06-291-15/+0
| | | | | | | | | BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/150050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19525 0039d316-1c4b-4281-b951-d872f2087c98
* Tests for socks4/4a implementation.arindam@chromium.org2009-06-285-150/+438
| | | | | | | | | | | Refactoring of void BuildHandshakeWriteBuffer() to const std::string BuildHandshakeWriteBuffer() const,and removing private members handshake_buf_len_ and buffer_len_ (since buffer_ is now std::string, buffer_.size()) is more than sufficient for buffer size. TEST=unittests BUG=469 Review URL: http://codereview.chromium.org/139009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19474 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 19466.thakis@chromium.org2009-06-275-435/+147
| | | | | | Review URL: http://codereview.chromium.org/150003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19468 0039d316-1c4b-4281-b951-d872f2087c98
* Tests for socks4/4a implementation.arindam@chromium.org2009-06-275-147/+435
| | | | | | | | | | | | Refactoring of void BuildHandshakeWriteBuffer() to const std::string BuildHandshakeWriteBuffer() const, and removing private members handshake_buf_len_ and buffer_len_ (since buffer_ is now std::string, buffer_.size()) is more than sufficient. TEST=unittests BUG=469 Review URL: http://codereview.chromium.org/139009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19466 0039d316-1c4b-4281-b951-d872f2087c98
* Make net::HostResolver refcounted.ericroman@google.com2009-06-276-24/+23
| | | | | | | | | | | 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-266-23/+24
| | | | | | 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-266-24/+23
| | | | | | | | | | | 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
* revert socks_client_socket.cc from r19005arindam@chromium.org2009-06-261-45/+47
| | | | | | | | | | | TEST=none BUG=none TBR=eroman Review URL: http://codereview.chromium.org/149077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19358 0039d316-1c4b-4281-b951-d872f2087c98
* reverting the change 19354, 19356arindam@chromium.org2009-06-264-386/+96
| | | | | | | | | | | TEST=none BUG=none TBR=eroman Review URL: http://codereview.chromium.org/149076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19357 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing compilation warnings for r19354arindam@chromium.org2009-06-262-3/+3
| | | | | | | | | | | TEST=none BUG=none TBR=eroman Review URL: http://codereview.chromium.org/149074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19356 0039d316-1c4b-4281-b951-d872f2087c98
* Tests for socks4/4a implementation.arindam@chromium.org2009-06-265-145/+433
| | | | | | | | | | | | Refactoring of void BuildHandshakeWriteBuffer() to const std::string BuildHandshakeWriteBuffer() const, and removing private members handshake_buf_len_ and buffer_len_ (since buffer_ is now std::string, buffer_.size()) is more than sufficient. TEST=unittests BUG=none Review URL: http://codereview.chromium.org/139009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19354 0039d316-1c4b-4281-b951-d872f2087c98
* Reset internal ClientSocketHandle state on Init() synchronous error (failure ↵willchan@chromium.org2009-06-265-12/+31
| | | | | | | | | | | to do so could lead to a crash). Also delete a CHECK that was asserting on possibly deleted memory. BUG=http://crbug.com/15207 TEST=See bug for repro. Review URL: http://codereview.chromium.org/147155 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19343 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a crash in net::SSLClientSocketWin::OnIOComplete(int) whenwtc@chromium.org2009-06-255-12/+32
| | | | | | | | | | | | | | | | | | | | | an HttpNetworkTransaction is destroyed while its SSLClientSocket is verifying a certificate. Document that ClientSocket::Disconnect aborts any pending IO and prevents completion callback from running, like a cancel method. Change the verifier_ member of SSLClientSocket to a scoped_ptr so that we can destroy the CertVerifier object in the Disconnect method. (CertVerifier doesn't have a cancel method, so we cancel pending certificate verification by destroying the CertVerifier object.) R=willchan BUG=http://crbug.com/13981 TEST=none. I can only reproduce this crash by modifying the source code to create that condition. Review URL: http://codereview.chromium.org/147159 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19307 0039d316-1c4b-4281-b951-d872f2087c98
* Make more things possible with mock sockets:phajdan.jr@chromium.org2009-06-252-25/+41
| | | | | | | | | | | | - check connection state in mock read and write - make possible simulating short reads in DynamicMockSocket TEST=none http://crbug.com/15259 Review URL: http://codereview.chromium.org/147117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19222 0039d316-1c4b-4281-b951-d872f2087c98
* svn cp net/socket/tcp_client_socket_pool_unittest.cc ↵willchan@chromium.org2009-06-241-0/+621
| | | | | | | | | | net/socket/client_socket_pool_base_unittest.cc In preparation for moving tests from tcp_client_socket_pool_unittest.cc to client_socket_pool_base_unittest.cc. Review URL: http://codereview.chromium.org/147101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19163 0039d316-1c4b-4281-b951-d872f2087c98
* Break out classes from tcp_client_socket_pool.h into their own files.willchan@chromium.org2009-06-244-590/+648
| | | | | | | | | | This is just shuffling code around to new files and adjusting header dependencies accordingly. BUG=http://crbug.com/13289 TEST=none Review URL: http://codereview.chromium.org/132060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19123 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crash in ClientSocketPoolBase.willchan@chromium.org2009-06-233-48/+62
| | | | | | | | | | If a ConnectingSocket fails, we need to try to process a pending request. BUG=http://crbug.com/14814 TEST=See bug for repro steps. Review URL: http://codereview.chromium.org/146037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19067 0039d316-1c4b-4281-b951-d872f2087c98