From 782862bd6f948a58d813194aabf45e01cec5652c Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Sun, 12 Aug 2012 19:08:58 -0400 Subject: [PATCH] [Issue #449] Fixing bug where tempfiles for multipart form message bodies could collide, specifically for requests with the same URL --- AFNetworking/AFHTTPClient.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index 62416dc..03a9e5f 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -725,7 +725,7 @@ static inline NSString * AFMultipartFormFinalBoundary() { self.request = request; self.stringEncoding = encoding; - self.temporaryFilePath = [AFMultipartTemporaryFileDirectoryPath() stringByAppendingPathComponent:[NSString stringWithFormat:@"%lu", (long)[[self.request URL] hash]]]; + self.temporaryFilePath = [AFMultipartTemporaryFileDirectoryPath() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]; self.outputStream = [NSOutputStream outputStreamToFileAtPath:self.temporaryFilePath append:NO]; NSRunLoop *runLoop = [NSRunLoop currentRunLoop];