Index: utils/ofhttp/OFHTTP.m ================================================================== --- utils/ofhttp/OFHTTP.m +++ utils/ofhttp/OFHTTP.m @@ -603,10 +603,12 @@ } if (!_quiet) [of_stdout writeFormat: @"☇ %@", URL.string]; + _length = 0; + return true; } - (void)client: (OFHTTPClient *)client didFailWithException: (id)e @@ -727,11 +729,11 @@ [_output writeBuffer: buffer length: length]; _progressBar.received = _received; - if (response.atEndOfStream || (_length >= 0 && _received >= _length)) { + if (response.atEndOfStream) { [_progressBar stop]; [_progressBar draw]; [_progressBar release]; _progressBar = nil; @@ -765,14 +767,13 @@ [of_stdout writeFormat: @" ➜ %d\n", statusCode]; if (type == nil) type = OF_LOCALIZED(@"type_unknown", @"unknown"); - if (lengthString != nil) + if (lengthString != nil) { _length = lengthString.decimalValue; - if (_length >= 0) { if (_resumedFrom + _length >= GIBIBYTE) { lengthString = [OFString stringWithFormat: @"%,.2f", (float)(_resumedFrom + _length) / GIBIBYTE]; lengthString = OF_LOCALIZED(@"size_gib", @@ -923,12 +924,11 @@ OFString *URLString = nil; OFURL *URL; OFMutableDictionary *clientHeaders; OFHTTPRequest *request; - _length = -1; - _received = _resumedFrom = 0; + _received = _length = _resumedFrom = 0; if (_output != of_stdout) [_output release]; _output = nil;