ObjFW  Diff

Differences From Artifact [42b4813df4]:

To Artifact [fb786804a8]:


601
602
603
604
605
606
607


608
609
610
611
612
613
614
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
732

733
734
735
736
737
738
739
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 || (_length >= 0 && _received >= _length)) {
	if (response.atEndOfStream) {
		[_progressBar stop];
		[_progressBar draw];
		[_progressBar release];
		_progressBar = nil;

		if (!_quiet) {
			[of_stdout writeString: @"\n  "];
763
764
765
766
767
768
769
770

771
772
773
774
775
776
777
778
779
780
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)
		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",
				    @"%[num] GiB",
				    @"num", lengthString);
921
922
923
924
925
926
927
928

929
930
931
932
933
934
935
936
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;

	_length = -1;
	_received = _length = _resumedFrom = 0;
	_received = _resumedFrom = 0;

	if (_output != of_stdout)
		[_output release];
	_output = nil;

	if (_URLIndex >= _URLs.count)
		[OFApplication terminateWithStatus: _errorCode];