mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Add some diagnostics and ensure that delegates are removed from streams.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27777 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
06a26e0d28
commit
676a044f5d
2 changed files with 61 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2009-02-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSURLProtocol.m: Add some diagnostics and ensure that
|
||||||
|
delegates are removed from streams.
|
||||||
|
|
||||||
2009-02-04 David Chisnall <csdavec@swansea.ac.uk>
|
2009-02-04 David Chisnall <csdavec@swansea.ac.uk>
|
||||||
|
|
||||||
* Source/GSArray.m: Firther fast enumeration bugfixes.
|
* Source/GSArray.m: Firther fast enumeration bugfixes.
|
||||||
|
|
|
@ -364,10 +364,21 @@ static NSURLProtocol *placeholder = nil;
|
||||||
if (this != 0)
|
if (this != 0)
|
||||||
{
|
{
|
||||||
[self stopLoading];
|
[self stopLoading];
|
||||||
RELEASE(this->input);
|
if (this->input != nil)
|
||||||
RELEASE(this->output);
|
{
|
||||||
RELEASE(this->cachedResponse);
|
[this->input setDelegate: nil];
|
||||||
RELEASE(this->request);
|
[this->output setDelegate: nil];
|
||||||
|
[this->input removeFromRunLoop: [NSRunLoop currentRunLoop]
|
||||||
|
forMode: NSDefaultRunLoopMode];
|
||||||
|
[this->output removeFromRunLoop: [NSRunLoop currentRunLoop]
|
||||||
|
forMode: NSDefaultRunLoopMode];
|
||||||
|
[this->input close];
|
||||||
|
[this->output close];
|
||||||
|
DESTROY(this->input);
|
||||||
|
DESTROY(this->output);
|
||||||
|
}
|
||||||
|
DESTROY(this->cachedResponse);
|
||||||
|
DESTROY(this->request);
|
||||||
#if USE_ZLIB
|
#if USE_ZLIB
|
||||||
if (this->compressing == YES)
|
if (this->compressing == YES)
|
||||||
{
|
{
|
||||||
|
@ -377,7 +388,7 @@ static NSURLProtocol *placeholder = nil;
|
||||||
{
|
{
|
||||||
inflateEnd(&this->z);
|
inflateEnd(&this->z);
|
||||||
}
|
}
|
||||||
RELEASE(this->compressed);
|
DESTROY(this->compressed);
|
||||||
#endif
|
#endif
|
||||||
NSZoneFree([self zone], this);
|
NSZoneFree([self zone], this);
|
||||||
_NSURLProtocolInternal = 0;
|
_NSURLProtocolInternal = 0;
|
||||||
|
@ -701,6 +712,8 @@ static NSURLProtocol *placeholder = nil;
|
||||||
DESTROY(_writeData);
|
DESTROY(_writeData);
|
||||||
if (this->input != nil)
|
if (this->input != nil)
|
||||||
{
|
{
|
||||||
|
[this->input setDelegate: nil];
|
||||||
|
[this->output setDelegate: nil];
|
||||||
[self _unschedule];
|
[self _unschedule];
|
||||||
[this->input close];
|
[this->input close];
|
||||||
[this->output close];
|
[this->output close];
|
||||||
|
@ -1074,6 +1087,8 @@ static NSURLProtocol *placeholder = nil;
|
||||||
[self _unschedule];
|
[self _unschedule];
|
||||||
if (_shouldClose == YES)
|
if (_shouldClose == YES)
|
||||||
{
|
{
|
||||||
|
[this->input setDelegate: nil];
|
||||||
|
[this->output setDelegate: nil];
|
||||||
[this->input close];
|
[this->input close];
|
||||||
[this->output close];
|
[this->output close];
|
||||||
DESTROY(this->input);
|
DESTROY(this->input);
|
||||||
|
@ -1391,9 +1406,23 @@ static NSURLProtocol *placeholder = nil;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NSLog(@"An error %@ occurred on the event %08x of stream %@ of %@", [stream streamError], event, stream, self);
|
else
|
||||||
[self stopLoading];
|
{
|
||||||
[this->client URLProtocol: self didFailWithError: [stream streamError]];
|
NSLog(@"Unexpected event %d occurred on stream %@ not being used by %@",
|
||||||
|
event, stream, self);
|
||||||
|
}
|
||||||
|
if (event == NSStreamEventErrorOccurred)
|
||||||
|
{
|
||||||
|
NSLog(@"An error %@ occurred on stream %@ of %@",
|
||||||
|
[stream streamError], stream, self);
|
||||||
|
[self stopLoading];
|
||||||
|
[this->client URLProtocol: self didFailWithError: [stream streamError]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSLog(@"Unexpected event %d ignored on stream %@ of %@",
|
||||||
|
event, stream, self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) useCredential: (NSURLCredential*)credential
|
- (void) useCredential: (NSURLCredential*)credential
|
||||||
|
@ -1480,6 +1509,8 @@ static NSURLProtocol *placeholder = nil;
|
||||||
{
|
{
|
||||||
if (this->input)
|
if (this->input)
|
||||||
{
|
{
|
||||||
|
[this->input setDelegate: nil];
|
||||||
|
[this->output setDelegate: nil];
|
||||||
[this->input removeFromRunLoop: [NSRunLoop currentRunLoop]
|
[this->input removeFromRunLoop: [NSRunLoop currentRunLoop]
|
||||||
forMode: NSDefaultRunLoopMode];
|
forMode: NSDefaultRunLoopMode];
|
||||||
[this->output removeFromRunLoop: [NSRunLoop currentRunLoop]
|
[this->output removeFromRunLoop: [NSRunLoop currentRunLoop]
|
||||||
|
@ -1521,9 +1552,23 @@ static NSURLProtocol *placeholder = nil;
|
||||||
NSLog(@"An event occurred on the output stream.");
|
NSLog(@"An event occurred on the output stream.");
|
||||||
// if successfully opened, send out FTP request header
|
// if successfully opened, send out FTP request header
|
||||||
}
|
}
|
||||||
NSLog(@"An error %@ occurred on the event %08x of stream %@ of %@",
|
else
|
||||||
[stream streamError], event, stream, self);
|
{
|
||||||
[this->client URLProtocol: self didFailWithError: [stream streamError]];
|
NSLog(@"Unexpected event %d occurred on stream %@ not being used by %@",
|
||||||
|
event, stream, self);
|
||||||
|
}
|
||||||
|
if (event == NSStreamEventErrorOccurred)
|
||||||
|
{
|
||||||
|
NSLog(@"An error %@ occurred on stream %@ of %@",
|
||||||
|
[stream streamError], stream, self);
|
||||||
|
[self stopLoading];
|
||||||
|
[this->client URLProtocol: self didFailWithError: [stream streamError]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSLog(@"Unexpected event %d ignored on stream %@ of %@",
|
||||||
|
event, stream, self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue