Fixed <rdar://problem/
3962401> Don't load multipart/x-mixed-replace content to prevent memory leak
Since we're not going to fix <rdar://problem/
3087535> for Tiger, we should not load multipart/x-mixed-replace content. Pages with such content contain what is essentially an infinite load and therefore may leak.
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient connection:didReceiveResponse:]): Disabled loading of multipart/x-mixed-replace content until we fully implement server side push.
* WebCoreSupport.subproj/WebSubresourceClient.m:
(-[WebSubresourceClient didReceiveResponse:]): Ditto. Same exact thing for sub resources.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8685
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-02-24 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by John.
+
+ Fixed <rdar://problem/3962401> Don't load multipart/x-mixed-replace content to prevent memory leak
+
+ Since we're not going to fix <rdar://problem/3087535> for Tiger, we should not load multipart/x-mixed-replace content. Pages with such content contain what is essentially an infinite load and therefore may leak.
+
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient connection:didReceiveResponse:]): Disabled loading of multipart/x-mixed-replace content until we fully implement server side push.
+ * WebCoreSupport.subproj/WebSubresourceClient.m:
+ (-[WebSubresourceClient didReceiveResponse:]): Ditto. Same exact thing for sub resources.
+
+
2005-02-23 John Sullivan <sullivan@apple.com>
Reviewed by Ken.
- (void)didReceiveResponse:(NSURLResponse *)r
{
ASSERT(r);
+
+ // FIXME: Since we're not going to fix <rdar://problem/3087535> for Tiger, we should not
+ // load multipart/x-mixed-replace content. Pages with such content contain what is
+ // essentially an infinite load and therefore a memory leak. Both this code and code in
+ // WebMainRecoureClient must be removed once multipart/x-mixed-replace is fully implemented.
+ if ([[r MIMEType] isEqualToString:@"multipart/x-mixed-replace"]) {
+ [self cancelWithError:[NSError _webKitErrorWithDomain:NSURLErrorDomain
+ code:NSURLErrorUnsupportedURL
+ URL:[r URL]]];
+ return;
+ }
+
// retain/release self in this delegate method since the additional processing can do
// anything including possibly releasing self; one example of this is 3266216
[self retain];
- (void)didReceiveResponse:(NSURLResponse *)r
{
ASSERT(r);
+
+ // FIXME: Since we're not going to fix <rdar://problem/3087535> for Tiger, we should not
+ // load multipart/x-mixed-replace content. Pages with such content contain what is
+ // essentially an infinite load and therefore a memory leak. Both this code and code in
+ // WebMainRecoureClient must be removed once multipart/x-mixed-replace is fully implemented.
+ if ([[r MIMEType] isEqualToString:@"multipart/x-mixed-replace"]) {
+ [self cancelWithError:[NSError _webKitErrorWithDomain:NSURLErrorDomain
+ code:NSURLErrorUnsupportedURL
+ URL:[r URL]]];
+ return;
+ }
+
// retain/release self in this delegate method since the additional processing can do
// anything including possibly releasing self; one example of this is 3266216
[self retain];
ASSERT([[r URL] _webkit_shouldLoadAsEmptyDocument] || ![[dataSource _webView] defersCallbacks]);
LOG(Loading, "main content type: %@", [r MIMEType]);
-
+
+ // FIXME: Since we're not going to fix <rdar://problem/3087535> for Tiger, we should not
+ // load multipart/x-mixed-replace content. Pages with such content contain what is
+ // essentially an infinite load and therefore a memory leak. Both this code and code in
+ // SubresourceClient must be removed once multipart/x-mixed-replace is fully implemented.
+ if ([[r MIMEType] isEqualToString:@"multipart/x-mixed-replace"]) {
+ [self cancelWithError:[NSError _webKitErrorWithDomain:NSURLErrorDomain
+ code:NSURLErrorUnsupportedURL
+ URL:[r URL]]];
+ return;
+ }
+
// FIXME: This is a workaround to make web archive files work with Foundations that
// are too old to know about web archive files. We should remove this before we ship.
NSURL *URL = [r URL];
ASSERT([[r URL] _webkit_shouldLoadAsEmptyDocument] || ![[dataSource _webView] defersCallbacks]);
LOG(Loading, "main content type: %@", [r MIMEType]);
-
+
+ // FIXME: Since we're not going to fix <rdar://problem/3087535> for Tiger, we should not
+ // load multipart/x-mixed-replace content. Pages with such content contain what is
+ // essentially an infinite load and therefore a memory leak. Both this code and code in
+ // SubresourceClient must be removed once multipart/x-mixed-replace is fully implemented.
+ if ([[r MIMEType] isEqualToString:@"multipart/x-mixed-replace"]) {
+ [self cancelWithError:[NSError _webKitErrorWithDomain:NSURLErrorDomain
+ code:NSURLErrorUnsupportedURL
+ URL:[r URL]]];
+ return;
+ }
+
// FIXME: This is a workaround to make web archive files work with Foundations that
// are too old to know about web archive files. We should remove this before we ship.
NSURL *URL = [r URL];