Skip to content

Commit 7a1fa6b

Browse files
committed
Bugfix: CCPackageDownlod read wrong fileSize to resume a download.
1 parent aa34cab commit 7a1fa6b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cocos2d/CCPackageDownload.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ - (NSUInteger)fileSizeOfDownload
137137
{
138138
NSFileManager *fileManager = [NSFileManager defaultManager];
139139

140-
if (![fileManager fileExistsAtPath:_localURL.path])
140+
if (![fileManager fileExistsAtPath:_tempPath])
141141
{
142142
return 0;
143143
}
144144

145145
NSError *error;
146-
NSDictionary *attributes = [fileManager attributesOfItemAtPath:_localURL.path error:&error];
146+
NSDictionary *attributes = [fileManager attributesOfItemAtPath:_tempPath error:&error];
147147

148148
if (error)
149149
{
@@ -424,7 +424,6 @@ - (NSUInteger)extractTotalBytesFromResponse:(NSHTTPURLResponse *)response
424424
NSString *byteStr = [rangeValue substringWithRange:[match rangeAtIndex:1]];
425425
return (NSUInteger) [byteStr integerValue];
426426
}
427-
428427
}
429428

430429
return (NSUInteger) [response expectedContentLength];

0 commit comments

Comments
 (0)