Skip to content

Commit

Permalink
Comment out debug logging
Browse files Browse the repository at this point in the history
Correct urls used in tests
  • Loading branch information
pokeb committed Aug 11, 2009
1 parent a7d73a6 commit 859cb73
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Classes/ASIHTTPRequest.m
Expand Up @@ -2376,7 +2376,7 @@ + (void)recordBandwidthUsage
interval++;
}
}
NSLog(@"Used: %qi",bandwidthUsedInLastSecond);
//NSLog(@"Used: %qi",bandwidthUsedInLastSecond);
[bandwidthUsageTracker addObject:[NSNumber numberWithUnsignedLong:bandwidthUsedInLastSecond]];
[bandwidthMeasurementDate release];
bandwidthMeasurementDate = [[NSDate dateWithTimeIntervalSinceNow:1] retain];
Expand Down Expand Up @@ -2479,7 +2479,7 @@ + (unsigned long)maxUploadReadLength
}

if (toRead == 0 || !bandwidthMeasurementDate || [bandwidthMeasurementDate timeIntervalSinceNow] < -0) {
NSLog(@"sleep");
//NSLog(@"sleep");
[NSThread sleepUntilDate:bandwidthMeasurementDate];
[self recordBandwidthUsage];
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/ASIInputStream.m
Expand Up @@ -78,9 +78,9 @@ - (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len
} else if (toRead == 0) {
toRead = 1;
}
NSLog(@"Throttled read %u",toRead);
//NSLog(@"Throttled read %u",toRead);
} else {
NSLog(@"Unthrottled read %u",toRead);
//NSLog(@"Unthrottled read %u",toRead);
}
[ASIHTTPRequest incrementBandwidthUsedInLastSecond:toRead];
[readLock unlock];
Expand Down
12 changes: 6 additions & 6 deletions Classes/Tests/ASIHTTPRequestTests.m
Expand Up @@ -762,7 +762,7 @@ - (void)testCompression

// Test compressed body
// Body is deflated by ASIHTTPRequest, sent, inflated by the server, printed, deflated by mod_deflate, response is inflated by ASIHTTPRequest
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/ASIHTTPRequest/tests/compressed_post_body"]];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/compressed_post_body"]];
[request setRequestMethod:@"PUT"];
[request setShouldCompressRequestBody:YES];
[request appendPostData:data];
Expand All @@ -772,7 +772,7 @@ - (void)testCompression
success = [[request responseString] isEqualToString:content];
GHAssertTrue(success,@"Failed to compress the body, or server failed to decompress it");

request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/ASIHTTPRequest/tests/compressed_post_body"]];
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/compressed_post_body"]];
[request setRequestMethod:@"PUT"];
[request setShouldCompressRequestBody:YES];
[request setShouldStreamPostDataFromDisk:YES];
Expand Down Expand Up @@ -801,7 +801,7 @@ - (void)testThrottlingDownloadBandwidth

// This content is around 128KB in size, and it won't be gzipped, so it should take more than 8 seconds to download at 14.5KB / second
// We'll test first without throttling
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/ASIHTTPRequest/tests/the_great_american_novel_%28abridged%29.txt"]];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/the_great_american_novel_%28abridged%29.txt"]];
NSDate *date = [NSDate date];
[request start];

Expand All @@ -811,7 +811,7 @@ - (void)testThrottlingDownloadBandwidth

// Now we'll test with throttling
[ASIHTTPRequest setMaxBandwidthPerSecond:ASIWWANBandwidthThrottleAmount];
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/ASIHTTPRequest/tests/the_great_american_novel_%28abridged%29.txt"]];
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/the_great_american_novel_%28abridged%29.txt"]];
date = [NSDate date];
[request start];

Expand All @@ -832,7 +832,7 @@ - (void)testThrottlingUploadBandwidth
NSData *data = [[[NSMutableData alloc] initWithLength:64*1024] autorelease];

// We'll test first without throttling
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/ignore"]];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ignore"]];
[request appendPostData:data];
NSDate *date = [NSDate date];
[request start];
Expand All @@ -843,7 +843,7 @@ - (void)testThrottlingUploadBandwidth

// Now we'll test with throttling
[ASIHTTPRequest setMaxBandwidthPerSecond:ASIWWANBandwidthThrottleAmount];
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/ignore"]];
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ignore"]];
[request appendPostData:data];
date = [NSDate date];
[request start];
Expand Down
8 changes: 4 additions & 4 deletions Classes/Tests/ASINetworkQueueTests.m
Expand Up @@ -641,7 +641,7 @@ - (void)testMultipleDownloadsThrottlingBandwidth
int i;
for (i=0; i<5; i++) {
// This image is around 18KB in size, for 90KB total download size
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/i/logo.png"]];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/i/logo.png"]];
[networkQueue addOperation:request];
}

Expand Down Expand Up @@ -671,7 +671,7 @@ - (void)testMultipleDownloadsThrottlingBandwidth
[ASIHTTPRequest setMaxBandwidthPerSecond:ASIWWANBandwidthThrottleAmount];

for (i=0; i<5; i++) {
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/i/logo.png"]];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/i/logo.png"]];
[networkQueue addOperation:request];
}

Expand Down Expand Up @@ -707,7 +707,7 @@ - (void)testMultipleUploadsThrottlingBandwidth
// We'll test first without throttling
int i;
for (i=0; i<10; i++) {
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/ignore"]];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ignore"]];
[request appendPostData:data];
[networkQueue addOperation:request];
}
Expand Down Expand Up @@ -738,7 +738,7 @@ - (void)testMultipleUploadsThrottlingBandwidth
[ASIHTTPRequest setMaxBandwidthPerSecond:ASIWWANBandwidthThrottleAmount];

for (i=0; i<10; i++) {
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://asi/ignore"]];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ignore"]];
[request appendPostData:data];
[networkQueue addOperation:request];
}
Expand Down
8 changes: 4 additions & 4 deletions Mac.xcodeproj/project.pbxproj
Expand Up @@ -15,8 +15,8 @@
B51E5F57100B83F7004A300D /* ASIS3ListRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B51E5F55100B83F7004A300D /* ASIS3ListRequest.m */; };
B522D71F103074AC009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522D71E103074AC009A2D22 /* ASIInputStream.m */; };
B522D720103074AC009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522D71E103074AC009A2D22 /* ASIInputStream.m */; };
B53FADE80FF38B2A002E2DE6 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */; };
B53FADF90FF38BA9002E2DE6 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */; };
B522DE601031BB03009A2D22 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */; };
B522DE821031BD5E009A2D22 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */; };
B55B5D200F76568E0064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D120F76568E0064029C /* ASIFormDataRequest.m */; };
B55B5D210F76568E0064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D140F76568E0064029C /* ASIHTTPRequest.m */; };
B55B5D220F76568E0064029C /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D160F76568E0064029C /* ASINetworkQueue.m */; };
Expand Down Expand Up @@ -112,7 +112,7 @@
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
B55B5EB80F7658200064029C /* libz.1.2.3.dylib in Frameworks */,
B53FADF90FF38BA9002E2DE6 /* SystemConfiguration.framework in Frameworks */,
B522DE821031BD5E009A2D22 /* SystemConfiguration.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -122,7 +122,7 @@
files = (
B55B60140F7659A30064029C /* libz.1.2.3.dylib in Frameworks */,
B5B513680FBEE435002C74D0 /* GHUnit.framework in Frameworks */,
B53FADE80FF38B2A002E2DE6 /* SystemConfiguration.framework in Frameworks */,
B522DE601031BB03009A2D22 /* SystemConfiguration.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

0 comments on commit 859cb73

Please sign in to comment.