494
495
496
497
498
499
500
501
502
503
504
505
506
507
|
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
|
+
+
+
+
+
+
+
+
+
|
if (_quiet && _verbose) {
[of_stderr writeLine: OF_LOCALIZED(@"quiet_xor_verbose",
@"%[prog]: -q / --quiet and -v / --verbose are mutually "
@"exclusive!",
@"prog", [OFApplication programName])];
[OFApplication terminateWithStatus: 1];
}
if (_outputPath != nil && _detectFileName) {
[of_stderr writeLine: OF_LOCALIZED(
@"output_xor_detect_filename",
@"%[prog]: -o / --output and -O / --detect-filename are "
@"mutually exclusive!",
@"prog", [OFApplication programName])];
[OFApplication terminateWithStatus: 1];
}
if (_outputPath != nil && _URLs.count > 1) {
[of_stderr writeLine:
OF_LOCALIZED(@"output_only_with_one_url",
@"%[prog]: Cannot use -o / --output when more than one URL "
@"has been specified!",
@"prog", [OFApplication programName])];
|
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
|
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
|
+
-
-
-
+
+
+
+
-
-
-
+
-
|
request.method = OF_HTTP_REQUEST_METHOD_HEAD;
_detectFileNameRequest = true;
[_HTTPClient asyncPerformRequest: request];
return;
}
if (!_detectedFileName) {
[_currentFileName release];
_currentFileName = nil;
_detectedFileName = false;
[_currentFileName release];
_currentFileName = nil;
} else
_detectedFileName = false;
if (!_quiet)
[of_stdout writeFormat: @"⇣ %@", URL.string];
if (_currentFileName == nil)
if (_outputPath != nil)
_currentFileName = [_outputPath copy];
if (_currentFileName == nil)
_currentFileName = [URL.path.lastPathComponent copy];
if (_continue) {
@try {
|
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
|
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
|
+
+
+
|
_resumedFrom];
[clientHeaders setObject: range
forKey: @"Range"];
} @catch (OFRetrieveItemAttributesFailedException *e) {
}
}
if (!_quiet)
[of_stdout writeFormat: @"⇣ %@", URL.string];
request = [OFHTTPRequest requestWithURL: URL];
request.headers = clientHeaders;
request.method = _method;
_detectFileNameRequest = false;
[_HTTPClient asyncPerformRequest: request];
return;
next:
[self performSelector: @selector(downloadNextURL)
afterDelay: 0];
}
@end
|