48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#import "OFInvalidFormatException.h"
#import "OFInvalidServerResponseException.h"
#import "OFOpenItemFailedException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"
#import "OFResolveHostFailedException.h"
#import "OFSetItemAttributesFailedException.h"
#import "OFUnsupportedProtocolException.h"
#import "OFWriteFailedException.h"
#import "ProgressBar.h"
#define GIBIBYTE (1024 * 1024 * 1024)
#define MEBIBYTE (1024 * 1024)
|
>
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#import "OFInvalidFormatException.h"
#import "OFInvalidServerResponseException.h"
#import "OFOpenItemFailedException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"
#import "OFResolveHostFailedException.h"
#import "OFSetItemAttributesFailedException.h"
#import "OFTLSHandshakeFailedException.h"
#import "OFUnsupportedProtocolException.h"
#import "OFWriteFailedException.h"
#import "ProgressBar.h"
#define GIBIBYTE (1024 * 1024 * 1024)
#define MEBIBYTE (1024 * 1024)
|
856
857
858
859
860
861
862
863
864
865
866
867
868
869
|
[OFStdErr writeLine: OF_LOCALIZED(@"no_tls_support",
@"%[prog]: No TLS support in ObjFW!\n"
@" In order to download via HTTPS, you need to "
@"either build ObjFW with TLS\n"
@" support or preload a library adding TLS "
@"support to ObjFW!",
@"prog", [OFApplication programName])];
} else if ([exception isKindOfClass:
[OFReadOrWriteFailedException class]]) {
OFString *error = OF_LOCALIZED(
@"download_failed_read_or_write_failed_any",
@"Read or write failed");
if (!_quiet)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
|
[OFStdErr writeLine: OF_LOCALIZED(@"no_tls_support",
@"%[prog]: No TLS support in ObjFW!\n"
@" In order to download via HTTPS, you need to "
@"either build ObjFW with TLS\n"
@" support or preload a library adding TLS "
@"support to ObjFW!",
@"prog", [OFApplication programName])];
} else if ([exception isKindOfClass:
[OFTLSHandshakeFailedException class]]) {
OFString *error = OFTLSStreamErrorCodeDescription(
((OFTLSHandshakeFailedException *)exception)
.errorCode);
if (!_quiet)
[OFStdOut writeString: @"\n"];
[OFStdErr writeLine: OF_LOCALIZED(
@"download_failed_tls_handshake_failed",
@"%[prog]: Failed to download <%[iri]>!\n"
@" TLS handshake failed: %[error]",
@"prog", [OFApplication programName],
@"iri", request.IRI.string,
@"error", error)];
} else if ([exception isKindOfClass:
[OFReadOrWriteFailedException class]]) {
OFString *error = OF_LOCALIZED(
@"download_failed_read_or_write_failed_any",
@"Read or write failed");
if (!_quiet)
|
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
|
if (_currentFileName == nil)
_currentFileName = [_outputPath copy];
if (_currentFileName == nil)
_currentFileName = [IRI.path.lastPathComponent copy];
if ([_currentFileName isEqual: @"/"]) {
[_currentFileName release];
_currentFileName = nil;
}
if (_currentFileName == nil)
_currentFileName = @"unnamed";
|
|
|
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
|
if (_currentFileName == nil)
_currentFileName = [_outputPath copy];
if (_currentFileName == nil)
_currentFileName = [IRI.path.lastPathComponent copy];
if ([_currentFileName isEqual: @"/"] || _currentFileName.length == 0) {
[_currentFileName release];
_currentFileName = nil;
}
if (_currentFileName == nil)
_currentFileName = @"unnamed";
|