Differences From Artifact [42b4813df4]:
- File utils/ofhttp/OFHTTP.m — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 28116) [annotate] [blame] [check-ins using] [more...]
To Artifact [fb786804a8]:
- File
utils/ofhttp/OFHTTP.m
— part of check-in
[283aece9e8]
at
2020-02-27 23:53:04
on branch trunk
— ofhttp: Properly reset _length on redirect
Additionally, only use _length for progress. (user: js, size: 28064) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
601 602 603 604 605 606 607 608 609 610 611 612 613 614 | objc_autoreleasePoolPop(pool); } if (!_quiet) [of_stdout writeFormat: @"☇ %@", URL.string]; return true; } - (void)client: (OFHTTPClient *)client didFailWithException: (id)e request: (OFHTTPRequest *)request { | > > | 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | objc_autoreleasePoolPop(pool); } if (!_quiet) [of_stdout writeFormat: @"☇ %@", URL.string]; _length = 0; return true; } - (void)client: (OFHTTPClient *)client didFailWithException: (id)e request: (OFHTTPRequest *)request { |
︙ | ︙ | |||
725 726 727 728 729 730 731 | _received += length; [_output writeBuffer: buffer length: length]; _progressBar.received = _received; | | | 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 | _received += length; [_output writeBuffer: buffer length: length]; _progressBar.received = _received; if (response.atEndOfStream) { [_progressBar stop]; [_progressBar draw]; [_progressBar release]; _progressBar = nil; if (!_quiet) { [of_stdout writeString: @"\n "]; |
︙ | ︙ | |||
763 764 765 766 767 768 769 | OFString *type = [headers objectForKey: @"Content-Type"]; [of_stdout writeFormat: @" ➜ %d\n", statusCode]; if (type == nil) type = OF_LOCALIZED(@"type_unknown", @"unknown"); | | < | 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 | OFString *type = [headers objectForKey: @"Content-Type"]; [of_stdout writeFormat: @" ➜ %d\n", statusCode]; if (type == nil) type = OF_LOCALIZED(@"type_unknown", @"unknown"); if (lengthString != nil) { _length = lengthString.decimalValue; if (_resumedFrom + _length >= GIBIBYTE) { lengthString = [OFString stringWithFormat: @"%,.2f", (float)(_resumedFrom + _length) / GIBIBYTE]; lengthString = OF_LOCALIZED(@"size_gib", @"%[num] GiB", @"num", lengthString); |
︙ | ︙ | |||
921 922 923 924 925 926 927 | - (void)downloadNextURL { OFString *URLString = nil; OFURL *URL; OFMutableDictionary *clientHeaders; OFHTTPRequest *request; | | < | 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 | - (void)downloadNextURL { OFString *URLString = nil; OFURL *URL; OFMutableDictionary *clientHeaders; OFHTTPRequest *request; _received = _length = _resumedFrom = 0; if (_output != of_stdout) [_output release]; _output = nil; if (_URLIndex >= _URLs.count) [OFApplication terminateWithStatus: _errorCode]; |
︙ | ︙ |