Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix a bug when setting a timeout in the HTTP client

  • Loading branch information...
commit 637258880afacb00c9daeca4566d4c58a960c608 1 parent 148221b
Sami Samhuri authored December 19, 2011

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  Marshmallows/MMHTTPClient.m
6  Marshmallows/MMHTTPClient.m
@@ -220,15 +220,15 @@ - (MMHTTPRequest *) delete: (NSString *)url then: (MMHTTPCallback)callback
220 220
 - (MMHTTPRequest *) request: (NSDictionary *)options then: (MMHTTPCallback)callback
221 221
 {
222 222
     NSString *url = [options objectForKey: @"url"];
  223
+    NSMutableDictionary *mutableOptions = [options mutableCopy];
223 224
     if (_baseURL && !([url hasPrefix: @"http:"] || [url hasPrefix: @"https:"])) {
224  
-        NSMutableDictionary *mutableOptions = [options mutableCopy];
225 225
         [mutableOptions setObject: [self urlWithPath: url] forKey: @"url"];
226  
-        options = [NSDictionary dictionaryWithDictionary: mutableOptions];
227 226
     }
228 227
     NSUInteger timeout = [[options objectForKey: @"timeout"] unsignedIntValue];
229 228
     if (timeout == 0) {
230  
-        [options setValue: [NSNumber numberWithUnsignedInt: self.timeout] forKey: @"timeout"];
  229
+        [mutableOptions setValue: [NSNumber numberWithUnsignedInt: self.timeout] forKey: @"timeout"];
231 230
     }
  231
+    options = [NSDictionary dictionaryWithDictionary: mutableOptions];
232 232
     return [MMHTTPRequest requestWithOptions: options callback: callback];
233 233
 }
234 234
 

0 notes on commit 6372588

Please sign in to comment.
Something went wrong with that request. Please try again.