Skip to content
Browse files

Merge pull request #245 from mbelshe/master

Small fix to the bandwidth throttler.
  • Loading branch information...
2 parents a879b8e + 8783cbc commit 1a7ae8109d4d495c1ae4e40b714d44c7769300c3 @pokeb pokeb committed Aug 20, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 Classes/ASIInputStream.m
View
6 Classes/ASIInputStream.m
@@ -58,9 +58,11 @@ - (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len
}
[request performThrottling];
}
- [ASIHTTPRequest incrementBandwidthUsedInLastSecond:toRead];
[readLock unlock];
- return [stream read:buffer maxLength:toRead];
+ NSInteger rv = [stream read:buffer maxLength:toRead];
+ if (rv > 0)
+ [ASIHTTPRequest incrementBandwidthUsedInLastSecond:rv];
+ return rv;
}
/*

0 comments on commit 1a7ae81

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