@interface CydgetPHPURLProtocol : NSURLProtocol {
pid_t pid_;
CFHTTPMessageRef http_;
+ NSFileHandle *handle_;
}
@end
http_ = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, FALSE);
CFHTTPMessageAppendBytes(http_, (const uint8_t *) "HTTP/1.1 200 OK\r\n", 17);
- NSFileHandle *handle([[NSFileHandle alloc] initWithFileDescriptor:fds[0] closeOnDealloc:YES]);
+ _assert(handle_ == nil);
+ handle_ = [[NSFileHandle alloc] initWithFileDescriptor:fds[0] closeOnDealloc:YES];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(onRead:)
name:@"NSFileHandleReadCompletionNotification"
- object:handle
+ object:handle_
];
- [handle readInBackgroundAndNotify];
-
- [handle release];
+ [handle_ readInBackgroundAndNotify];
}
- (void) onRead:(NSNotification *)notification {
//[client URLProtocol:self didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorNetworkConnectionLost userInfo:nil]];
- (void) stopLoading {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [handle_ release];
+ handle_ = nil;
+
if (pid_ != -1) {
kill(pid_, SIGTERM);
int status;
Section: Development
Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
Architecture: iphoneos-arm
-Version: 0.9.3106-1
+Version: 0.9.3107-1
Description: framework for managing lock screen plugins
Name: Cydget
Depends: mobilesubstrate (>= 0.9.2587-1), firmware (>= 2.2), preferenceloader, apr-lib, pcre, cycript (>= 0.9.292-1)