[Issue #449] Fixing bug where tempfiles for multipart form message bodies could collide, specifically for requests with the same URL

This commit is contained in:
Mattt Thompson 2012-08-12 19:08:58 -04:00
parent 481033ae0c
commit 782862bd6f

View File

@ -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];