<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,10 +13,15 @@
 
 - init {
     if ((self = [super init])) {
-		self.urls = [[NSMutableArray alloc] init];
-		self.requests = [[NSMutableDictionary alloc] init];
-		self.receivedDatas = [[NSMutableArray alloc] init];
 		self.finishCount = 0;
+		NSMutableArray *array = [[NSMutableArray alloc] init];
+		self.receivedDatas = array;
+		[array release];
+		
+		NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
+		self.requests = dict;
+		[dict release];
+
     }
     return self;
 }
@@ -24,7 +29,7 @@
 - (void)dealloc {
 	[urls release];
 	[requests release];
-	[receivedDatas release];
+	[receivedDatas autorelease];
     [super dealloc];
 }
 
@@ -47,17 +52,21 @@
 }
 
 - (void)requestWithUrls:(NSArray *)aUrls {
-	[urls addObjectsFromArray:aUrls];
 
+	[receivedDatas removeAllObjects];
+	[requests removeAllObjects];
+	[urls autorelease];
+	urls = [aUrls copy];
+	
 	for(NSInteger i=0; i&lt; [urls count]; i++){
 		NSMutableData *aData = [[NSMutableData alloc] init];
 		[receivedDatas addObject: aData];
 		[aData release];
-
+		
 		NSURLRequest *request = [[NSURLRequest alloc] 
 								 initWithURL: [NSURL URLWithString: [urls objectAtIndex:i]]
 								 cachePolicy: NSURLRequestReloadIgnoringLocalCacheData
-								 timeoutInterval: 60
+								 timeoutInterval: 10
 								 ];
 		NSURLConnection *connection = [[NSURLConnection alloc]
 									   initWithRequest:request
@@ -77,7 +86,6 @@
 	return [[[NSString alloc] initWithData:[receivedDatas objectAtIndex:idx] encoding:NSUTF8StringEncoding] autorelease];
 }
 
-
 #pragma mark NSURLConnection Delegates
 - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
 {
@@ -98,22 +106,16 @@
 	
 	if ([delegate respondsToSelector:@selector(didFinishDownload:)])
         [delegate performSelector:@selector(didFinishDownload:) withObject: [NSNumber numberWithInt: i]];
-    else
-    { 
-        [NSException raise:NSInternalInconsistencyException
-					format:@&quot;Delegate doesn't respond to didFinishDownload&quot;];
-    }
-
+	
 	if(finishCount &gt;= [urls count]){
 		if ([delegate respondsToSelector:@selector(didFinishAllDownload)])
 			[delegate didFinishAllDownload];
-		else
-		{ 
-			[NSException raise:NSInternalInconsistencyException
-						format:@&quot;Delegate doesn't respond to didFinishAllDownload&quot;];
-		}
 	}
 }
 
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
+	if ([delegate respondsToSelector:@selector(didFailDownloadWithError:)])
+        [delegate performSelector:@selector(didFailDownloadWithError:) withObject: error];
+}
 
 @end</diff>
      <filename>MultipleDownload.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c4d72b18d89b0c4c12880f6364bd7edde5803c3a</id>
    </parent>
  </parents>
  <author>
    <name>Leon</name>
    <email>leon@leonho.com</email>
  </author>
  <url>http://github.com/leonho/iphone-libs/commit/f6ecc6c03f9d74d66ed1bd66914fc3101290a652</url>
  <id>f6ecc6c03f9d74d66ed1bd66914fc3101290a652</id>
  <committed-date>2008-11-12T10:47:09-08:00</committed-date>
  <authored-date>2008-11-12T10:47:09-08:00</authored-date>
  <message>Decreased timeout
Removed exception for both delegate calls for now
Some memory management fixes</message>
  <tree>5a8e0207ef34e63399c11dec14f0cd37cb4e457d</tree>
  <committer>
    <name>Leon</name>
    <email>leon@leonho.com</email>
  </committer>
</commit>
