summaryrefslogtreecommitdiffstats
path: root/net/http
Commit message (Collapse)AuthorAgeFilesLines
* Sanitize proxy response codes to CONNECT requests. Forwtc@chromium.org2009-02-113-17/+29
| | | | | | | | | | | | | | | | | | anything other than 200 (success) or 400-599 (error), we rewrite the response code as 500 (internal server error) to prevent any special handling of the proxy's response to CONNECT by mistake. Add a new error code ERR_UNEXPECTED_SERVER_AUTH for a 401 response to a CONNECT request. Fix nits reported by cpplint.py. R=darin,eroman BUG=7338 Review URL: http://codereview.chromium.org/21158 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9549 0039d316-1c4b-4281-b951-d872f2087c98
* Revert cl 9528 to fix mac test_shell_testsrvargas@google.com2009-02-105-21/+23
| | | | | | Review URL: http://codereview.chromium.org/21236 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9532 0039d316-1c4b-4281-b951-d872f2087c98
* Extend the IOBuffer to the disk cache.rvargas@google.com2009-02-105-23/+21
| | | | | | | | This is cleanup from bug 5325. Review URL: http://codereview.chromium.org/20134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9528 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a minor style nit. Make a comment clearer.wtc@chromium.org2009-01-301-4/+3
| | | | | | | R=eroman Review URL: http://codereview.chromium.org/19731 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8996 0039d316-1c4b-4281-b951-d872f2087c98
* Add more unit tests for net/base/host_resolver.phajdan.jr@chromium.org2009-01-291-4/+9
| | | | | | | | BUG=6661 Review URL: http://codereview.chromium.org/18775 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8872 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 8868.ericroman@google.com2009-01-291-0/+2
| | | | | | | This relands wtc's original CL for working around not caching the intermediate CA certificates. We believe the original commit failed on buildbot because of a bad incremental build, and will be resolved by doing a clobber Review URL: http://codereview.chromium.org/19463 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8870 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 8864.wtc@chromium.org2009-01-291-2/+0
| | | | | | | Revert r8864. It broke the build url_request_intercept_job.cc. Review URL: http://codereview.chromium.org/19462 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8868 0039d316-1c4b-4281-b951-d872f2087c98
* Work around our not caching the intermediate CAwtc@chromium.org2009-01-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | certificates by passing the source of each OSCertHandle to CreateFromHandle and the X509Certificate constructor. If the OSCertHandle comes from the network layer, we know it has a complete certificate chain and therefore prefer it to an OSCertHandle that comes from the HTTP cache, which doesn't have the intermediate CA certificates. A certificate from the network layer can kick out a certificate from the HTTP cache in our certificate cache. This workaround seems good enough to fix all the known symptoms of not caching the intermediate CA certificates. Move the common code in x509_certificate_<os>.cc to x509_certificate.cc. R=eroman BUG=3154,7065 Review URL: http://codereview.chromium.org/18836 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8864 0039d316-1c4b-4281-b951-d872f2087c98
* Change URLRequest to use a ref-counted buffer for actual IO.rvargas@google.com2009-01-297-25/+34
| | | | | | | | | | This will re-land http://codereview.chromium.org/18390 BUG=5325 Review URL: http://codereview.chromium.org/19004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8847 0039d316-1c4b-4281-b951-d872f2087c98
* revert r8603rvargas@google.com2009-01-247-34/+25
| | | | | | Review URL: http://codereview.chromium.org/18576 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8605 0039d316-1c4b-4281-b951-d872f2087c98
* Change URLRequest to use a ref-counted buffer for actual IO.The ref-counting ↵rvargas@google.com2009-01-247-25/+34
| | | | | | | | will prevent the deletion / reuse of memorywhile the buffer is actually being used by pending IO.This seems a very intrusive change, but at least we will be ableto make sure that it works without having to chase every singledestruction of an URLRequest to make sure that any pending IOwas cancelled, and also allows us to avoid blocking onthe object destruction.BUG=5325 Review URL: http://codereview.chromium.org/18390 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8603 0039d316-1c4b-4281-b951-d872f2087c98
* Add q-values to languages in Accept-Language HTTP header to be compatible ↵jungshik@google.com2009-01-233-3/+85
| | | | | | | | | | | | | | with Apache. Add q-values to charsets in Accept-Charset header in the same way as Firefox does. BUG=5899 TEST=HttpUtilTest.Accept* (net_unittest) Review URL: http://codereview.chromium.org/17340 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8527 0039d316-1c4b-4281-b951-d872f2087c98
* If connect succeeds synchronously, the event object is alsowtc@google.com2009-01-161-1/+0
| | | | | | | | | | | | | | signaled, so we need to reset the event object. Otherwise, the event object will be left in the wrong state when we write the request headers. Remove the unnecessary forward declaration of HostResolver. R=eroman BUG=6331 Review URL: http://codereview.chromium.org/18119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8163 0039d316-1c4b-4281-b951-d872f2087c98
* Remove HttpTransactionWinHttp and the --winhttp command-linewtc@google.com2009-01-1310-2616/+0
| | | | | | | | | | | | | | | switch. Remove WinHttpThrottle and CertStatusCache, which are only used by HttpTransactionWinHttp. Fix nits reported by cpplint.py. R=eroman,darin BUG=6323 Review URL: http://codereview.chromium.org/17635 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7970 0039d316-1c4b-4281-b951-d872f2087c98
* Correct latency histograms for SDCH encodingjar@chromium.org2009-01-135-2/+17
| | | | | | | | | | | | | | Add a boolean to indicate if the request_time_ was set via a call to Now(), vs unpickling from the cache, so that cached results can be excluded from latency measurements. bug=1561947 r=darin,rvargas Review URL: http://codereview.chromium.org/17371 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7942 0039d316-1c4b-4281-b951-d872f2087c98
* Measure how often the users are encountering MD5wtc@google.com2009-01-121-2/+5
| | | | | | | | | | certificates. R=jar BUG=6102 Review URL: http://codereview.chromium.org/17471 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7882 0039d316-1c4b-4281-b951-d872f2087c98
* When there are multiple requests for the same resource, it isrvargas@google.com2009-01-072-3/+77
| | | | | | | | | | | | | | | possible that cancelling a request that is currently a reader may be racing with another reader being completed. In that case, we were not removing the transaction for the cancelled request so all queued requests were blocked forever. R=wtc BUG=4769 TEST=unittest Review URL: http://codereview.chromium.org/17217 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7669 0039d316-1c4b-4281-b951-d872f2087c98
* Split ProxyResolver into two interfaces: A. interface for retrieving the ↵ericroman@google.com2008-12-193-25/+28
| | | | | | | | system proxy settings (ProxyConfigService) B. interface for resolving the proxy (ProxyResolver)The motivation behind this change is: 1. Simplify sharing the WinHTTP code that fetches IE settings, with the V8 proxy resolver (avoids having platform-specific code in ProxyResolverV8). 2. Restrict objects to one thread. (ProxyService calls the config getter on IO thread, and the proxy resolving on the PAC thread).(ProxyResolver is now only 1 method, but this will grow shortly). Review URL: http://codereview.chromium.org/15070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7323 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 6966.ericroman@google.com2008-12-137-30/+63
| | | | | | | this failed UI tests catastrophically Review URL: http://codereview.chromium.org/14103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6968 0039d316-1c4b-4281-b951-d872f2087c98
* Use automatic memory management for URLRequestContext's members.ericroman@google.com2008-12-137-63/+30
| | | | | | | | Also make ProxyService refcounted so the sharing between profiles is explicit. Review URL: http://codereview.chromium.org/13701 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6966 0039d316-1c4b-4281-b951-d872f2087c98
* Add a ProxyScriptFetcher class for doing asynch downloads of PAC ↵ericroman@google.com2008-12-101-0/+9
| | | | | | | | scripts.This object will be owned by ProxyService. It will be used to manage the fetching of PAC scripts (on the IO thread, using the primary URLRequestContext).BUG=74,2764 (partial) Review URL: http://codereview.chromium.org/13251 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6699 0039d316-1c4b-4281-b951-d872f2087c98
* Misc proxy service changes.ericroman@google.com2008-12-1010-102/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Changed the proxy service ownership model -- rather than being a detail of the HTTP stack, it is now a dependency owned by UrlRequestContext. - ProxyService is owned by UrlRequestContext (before was HttpNetworkSession) - ProxyResolver is owned by ProxyService (before was HttpNetworkSession) Being able to share the proxy service is needed in several places, including incognito mode http context (http://crbug.com/3564), and for proxy resolving in the new FTP stack. (2) Added an IPC for getting of the ProxyResolverWinHttp dependency in the plugin process. Not hooked up yet, but intent is to route the proxy resolve requests through the browser process. (3) Changed some unit tests which were depending on the system proxy settings (this was a sideffect of their calling HttpNetworkLayer::CreateFactory(NULL)). (4) Moved the first-time ProxyService::UpdateConfig out of the constructor and into the initial request. Done to avoid startup perf regressions, since the ProxyService construction is now done earlier (on the startup critical path). BUG=3564 Review URL: http://codereview.chromium.org/12938 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6693 0039d316-1c4b-4281-b951-d872f2087c98
* If a server answers a cache validation request with 304 and ↵rvargas@google.com2008-12-092-1/+49
| | | | | | | | | | | | | | | cache-control:no-store, we return the cached entry to the requestor but doom the entry so it's not used in the future. B=b/1363355 R=darin TEST=unit test. Review URL: http://codereview.chromium.org/13273 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6605 0039d316-1c4b-4281-b951-d872f2087c98
* Record network latency stats for Win HTTP in a histogramjar@google.com2008-12-052-1/+12
| | | | | | | r=wtc Review URL: http://codereview.chromium.org/12972 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6414 0039d316-1c4b-4281-b951-d872f2087c98
* * Cleanup: move base/platform_test.h -> testing/jeremy@chromium.org2008-12-022-2/+2
| | | | | | | | * Add support for "Debug On Start" switch to MultiprocessTest::SpawnChild Review URL: http://codereview.chromium.org/13052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6227 0039d316-1c4b-4281-b951-d872f2087c98
* Minor refactorings:ericroman@google.com2008-12-024-6/+5
| | | | | | | | | | | | - Change scheme from a (const char*) to a (std::string). This is in response to an earlier comment. Background: It used to be a (const char*) to avoid allocating a string object since all the callers initialize it with a string literal. - Change the initial value of nonce_count_ from 1 to 0. This doesn't functionally change anything (we just change to a pre-increment rather than post-increment), but I prefer the the start-at-zero style. Review URL: http://codereview.chromium.org/12846 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6208 0039d316-1c4b-4281-b951-d872f2087c98
* http_cache: Don't destroy an entry from the transaction destructor ifrvargas@google.com2008-11-242-7/+23
| | | | | | | | | | | | | | | | | | there is a task posted to process the next transaction. Also, fix the check to determine the type of transaction to consider writers that were converted to readers by the time the destructor runs. I'm adding more checks to see if these were all the problems related to bug 3931. B=4731 R=darin Review URL: http://codereview.chromium.org/12608 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5938 0039d316-1c4b-4281-b951-d872f2087c98
* Add run time checks to get more info for bug 3931.rvargas@google.com2008-11-221-8/+26
| | | | | | | | | | | The idea is just crash a little earlier and hopefully see if we can detect memory corruption as the cause of the actual bug. Review URL: http://codereview.chromium.org/11583 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5877 0039d316-1c4b-4281-b951-d872f2087c98
* Add a flags to further control response header persistence. We use this todarin@chromium.org2008-11-204-59/+148
| | | | | | | | | | | | | | | | | filter out Set-Cookie and Set-Cookie2 response headers from being forwarded to the renderer. This serves to prevent the renderer from having any access to HttpOnly cookies, and it also prevents XMLHttpRequest consumers from being able to read cookies in the HTTP response headers. This is consistent with changes made to Firefox and WebKit. Patch by marius.schilder@gmail.com R=deanm,darin Review URL: http://codereview.chromium.org/11264 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5767 0039d316-1c4b-4281-b951-d872f2087c98
* Punt the proxy errors into a bug.evanm@google.com2008-11-181-1/+5
| | | | | | | | | | This cuts down on error spew for test_shell, which lets us make progress on layout tests. Review URL: http://codereview.chromium.org/11220 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5594 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the duplicate session_callback_->AddRef() calls made bywtc@google.com2008-11-142-43/+56
| | | | | | | | | | | | | | | | | | the Restart() calls in DidReceiveError() and the RestartWithAuth() call in DidReceiveHeaders() by adding a new RestartInternal() method that doesn't call session_callback_->AddRef(). Remove the username/password that the server rejected from the auth cache only if the cache entry has the same username/password. Use the username:password specified in the URL after receiving a 401 response from the server. Do not send it preemptively. R=eroman BUG=b/1473850 Review URL: http://codereview.chromium.org/10668 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5421 0039d316-1c4b-4281-b951-d872f2087c98
* A minor tweak of r5245. I'm more confident that WinHTTPwtc@google.com2008-11-141-1/+1
| | | | | | | | | | | | | | | | knows a transaction is complete when WinHttpReadData returns a zero byte count. So it's safer to NOT notify the request throttle when WinHttpReadData returns a nonzero byte count, even if we have read the number of bytes specified in the Content-Length response header. I verified that this is still enough to fix the bug (unresponsiveness). R=darin BUG=4302 Review URL: http://codereview.chromium.org/10867 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5415 0039d316-1c4b-4281-b951-d872f2087c98
* Add more info to the comment about www.yahoo.com's padding ofwtc@google.com2008-11-143-8/+13
| | | | | | | | | | | | | | | | the chunk-size field. Fix miscellaneous nits reported by cpplint.py. Use ASCIItoWide instead of UTF8ToWide to convert the username and password specified in a URL. Those two components of the URL have to be ASCII. Carry over a TODO comment about unescaping username/password from http_transaction_winhttp.cc. R=eroman Review URL: http://codereview.chromium.org/10864 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5410 0039d316-1c4b-4281-b951-d872f2087c98
* Notify the WinHttpRequestThrottle of the completion of awtc@google.com2008-11-122-2/+11
| | | | | | | | | | | | | | | | | | | request when we have read the entire response, rather than waiting until the destructor. This is what we do in the new HTTP stack (see HttpNetworkTransaction::DoReadBodyComplete). This allows us to unblock the queued requests in the WinHttpRequestThrottle sooner. After this change, the name of the request_submitted_ member is no longer accurate. Since we'll replace the WinHTTP code soon, I just update the comment rather than renaming the member. R=darin BUG=4302 Review URL: http://codereview.chromium.org/10613 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5245 0039d316-1c4b-4281-b951-d872f2087c98
* Add unittests for eviction of http auth cache entries.ericroman@google.com2008-11-113-8/+106
| | | | | | Review URL: http://codereview.chromium.org/9734 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5161 0039d316-1c4b-4281-b951-d872f2087c98
* - Add preemptive authorization (new http stack only)ericroman@google.com2008-11-0823-164/+1375
| | | | | | | | | | | | - Check for auth identity in URL (new http stack only) - Move auth cache logic out of url request job, and hide it in the url request ftp job and http transaction classes. Note: Somehow the original codereview thread got corrupted so it was recreated. The real review comments should be under (http://codereview.chromium.org/6481) Review URL: http://codereview.chromium.org/8231 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5064 0039d316-1c4b-4281-b951-d872f2087c98
* Adaptively identify URL subresources and pre-resolve hosts via DNSjar@google.com2008-11-062-2/+5
| | | | | | | | | | | | | | | | | | | | Use the HTTP "referer" header to identify subresources used during a page load. Store that info, and use it when next visiting the referenced hosts to pre-resolve the (probably) needed subresources. This set of changes will surely evolve as we see how it plays out on broader distribution (via histogram measurments), but this should be the foundation of the change. In design specs, this was previously referred to as "adaptive correlated DNS prefetching." r=mbelshe Review URL: http://codereview.chromium.org/9168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4929 0039d316-1c4b-4281-b951-d872f2087c98
* Add histogram to show network latency (first byte to last byte)jar@google.com2008-11-062-0/+16
| | | | | | | | | Also added a histogram to show effective bandwidth of the download. r=darin,wtc Review URL: http://codereview.chromium.org/9625 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4898 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the UploadDataStream::Reset method. Instead,wtc@google.com2008-11-052-6/+101
| | | | | | | | | | | | | | | | rewind an UploadDataStream by recreating the object. Fix a bug in MockTCPClientSocket::Write. It needs to increment write_index_. Add two DCHECKs to simulate the DCHECKS in SSLClientSocketWin::DoPayloadEncrypt. Add a unit test. R=darin,eroman BUG=4062 Review URL: http://codereview.chromium.org/9384 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4819 0039d316-1c4b-4281-b951-d872f2087c98
* Wrap forward declarations in their relevant namespaceagl@chromium.org2008-11-051-0/+1
| | | | | | | | | | Forward declarations can't simply use "class $namespace::$class;" syntax. Instead one needs to use "namespace $namespace { class $class; }" syntax. Review URL: http://codereview.chromium.org/8722 Patch from James Vega. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4723 0039d316-1c4b-4281-b951-d872f2087c98
* Add a unit-test for r4624 (tcpclientsocket recycling on CONNECT).ericroman@google.com2008-11-052-3/+73
| | | | | | | | Also corrects a style problem in r4624 (comment order does not match expression order). Review URL: http://codereview.chromium.org/9369 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4714 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent recycling TCPClientSocket in the case of https, so as not to crash.ericroman@google.com2008-11-041-2/+2
| | | | | | | | | | The situation this protects against is better explained in comment 13: http://code.google.com/p/chromium/issues/detail?id=3772#c13 Review URL: http://codereview.chromium.org/9088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4624 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the debugging instrumentation.ericroman@google.com2008-11-042-62/+0
| | | | | | Review URL: http://codereview.chromium.org/9304 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4623 0039d316-1c4b-4281-b951-d872f2087c98
* More instrumentation.ericroman@google.com2008-11-032-25/+64
| | | | | | Review URL: http://codereview.chromium.org/9064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4520 0039d316-1c4b-4281-b951-d872f2087c98
* More no-op instrumentation code for bug 3772.ericroman@google.com2008-11-012-49/+23
| | | | | | | | TBR=wtc Review URL: http://codereview.chromium.org/9201 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4356 0039d316-1c4b-4281-b951-d872f2087c98
* Add some debugging instrumentation for 3772. This replaces the previous ↵ericroman@google.com2008-10-312-30/+49
| | | | | | | | instrumentation. Goal is to push preserve some member variables in the mini-dump, and to check if |this| is a valid pointer. Review URL: http://codereview.chromium.org/8211 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4298 0039d316-1c4b-4281-b951-d872f2087c98
* Relanding of r4221, initial proxy support for the Macavi@google.com2008-10-311-0/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4293 0039d316-1c4b-4281-b951-d872f2087c98
* oops; will reland once tree is openavi@google.com2008-10-301-4/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4223 0039d316-1c4b-4281-b951-d872f2087c98
* Initial Mac proxy implementationavi@google.com2008-10-301-0/+4
| | | | | | Review URL: http://codereview.chromium.org/8671 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4221 0039d316-1c4b-4281-b951-d872f2087c98
* Temporary code instrumentation to gather info on a crash.ericroman@google.com2008-10-292-3/+32
| | | | | | | | | | | | The idea is to see where in DidReadResponseHeaders() things blow up (if at all). This hack adds a value at ebp+8 (parent's frame) which indicates where we were. TBR=wtc Review URL: http://codereview.chromium.org/8890 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4174 0039d316-1c4b-4281-b951-d872f2087c98