Fixing broken merge

This commit is contained in:
Mattt Thompson 2012-09-25 10:19:15 -07:00
parent b43aba49fc
commit 37524696e3

View file

@ -697,7 +697,7 @@ static NSString * AFMultipartTemporaryFileDirectoryPath() {
NSError *error = nil; NSError *error = nil;
if(![[NSFileManager defaultManager] createDirectoryAtPath:multipartTemporaryFilePath withIntermediateDirectories:YES attributes:nil error:&error]) { if(![[NSFileManager defaultManager] createDirectoryAtPath:multipartTemporaryFilePath withIntermediateDirectories:YES attributes:nil error:&error]) {
NSLog(@"Failed to create multipart temporary file directory at %@", multipartTemporaryFilePath); NSLog(@"Failed to create multipary temporary file directory at %@", multipartTemporaryFilePath);
} }
}); });
@ -824,6 +824,7 @@ static inline NSString * AFContentTypeForPathExtension(NSString *extension) {
[self.bodyStream.HTTPBodyParts addObject:bodyPart]; [self.bodyStream.HTTPBodyParts addObject:bodyPart];
} }
- (void)appendPartWithFileData:(NSData *)data - (void)appendPartWithFileData:(NSData *)data
name:(NSString *)name name:(NSString *)name
fileName:(NSString *)fileName fileName:(NSString *)fileName
@ -1074,44 +1075,17 @@ typedef enum {
return self; return self;
} }
- (void)appendPartWithFormData:(NSData *)data - (void)dealloc {
name:(NSString *)name if (_inputStream) {
{ [_inputStream close];
NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; _inputStream = nil;
[mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"", name] forKey:@"Content-Disposition"]; }
}
- (void)appendPartWithFileData:(NSData *)data
name:(NSString *)name
fileName:(NSString *)fileName
mimeType:(NSString *)mimeType
{
NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
[mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
[mutableHeaders setValue:mimeType forKey:@"Content-Type"];
} }
- (BOOL)transitionToNextPhase { - (BOOL)transitionToNextPhase {
if (![[NSThread currentThread] isMainThread]) { if (![[NSThread currentThread] isMainThread]) {
[self performSelectorOnMainThread:@selector(transitionToNextPhase) withObject:nil waitUntilDone:YES]; [self performSelectorOnMainThread:@selector(transitionToNextPhase) withObject:nil waitUntilDone:YES];
} return YES;
return YES;
}
- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
name:(NSString *)name
error:(NSError **)error
{
if (![fileURL isFileURL]) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
[userInfo setValue:fileURL forKey:NSURLErrorFailingURLErrorKey];
[userInfo setValue:NSLocalizedString(@"Expected URL to be a file URL", nil) forKey:NSLocalizedFailureReasonErrorKey];
if (error != NULL) {
*error = [[NSError alloc] initWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:userInfo];
}
return NO;
} }
switch (_phase) { switch (_phase) {