Expose request timeout conditions as properties on BBHTTPRequest
biasedbit opened this issue · 1 comments
biasedbit commented
I'm thinking about exposing both CURLOPT_LOW_SPEED_LIMIT
and CURLOPT_LOW_SPEED_TIME
as a single property:
struct BBTransferRate {
unsigned long bytesPerSecond;
NSTimeInterval duration;
};
typedef struct BBTransferRate BBTransferRate;
BBTransferRate BBTransferRateMake(unsigned long bytesPerSecond, NSTimeInterval duration)
{
BBTransferRate threshold;
threshold.bytesPerSecond = bytesPerSecond;
threshold.duration = duration;
return threshold;
}
NSString* NSStringFromBBTransferRate(BBTransferRate transferRate)
{
return [NSString stringWithFormat:@"%lu/s for %.0f seconds", transferRate.bytesPerSecond, transferRate.duration];
}
I think it's way more meaningful than two separate properties.
The property on BBHTTPRequest
should probably be named requestTimeoutThreshold
.
jasperblues commented
Sounds good to me. . .