46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
-
+
|
#define GIBIBYTE (1024 * 1024 * 1024)
#define MEBIBYTE (1024 * 1024)
#define KIBIBYTE (1024)
@interface OFHTTP: OFObject
{
OFArray *_URLs;
OFArray OF_GENERIC(OFString*) *_URLs;
size_t _URLIndex;
int _errorCode;
OFString *_outputPath;
bool _continue, _detectFileName, _quiet, _verbose;
OFDataArray *_body;
of_http_request_method_t _method;
OFMutableDictionary *_clientHeaders;
|
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
|
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
|
-
+
|
- (void)downloadNextURL
{
OFString *URLString = nil;
OFURL *URL;
OFMutableDictionary *clientHeaders;
OFHTTPRequest *request;
OFHTTPResponse *response;
OFDictionary *headers;
OFDictionary OF_GENERIC(OFString*, OFString*) *headers;
OFString *fileName = nil, *lengthString, *type;
_length = -1;
_received = _resumedFrom = 0;
if (_output != of_stdout)
[_output release];
|
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
|
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
|
+
-
+
|
} else
lengthString = @"unknown";
[of_stdout writeFormat: @" Name: %@\n", fileName];
if (_verbose) {
void *pool = objc_autoreleasePoolPush();
OFDictionary OF_GENERIC(OFString*, OFString*) *headers =
OFDictionary *headers = [response headers];
[response headers];
OFEnumerator *keyEnumerator = [headers keyEnumerator];
OFEnumerator *objectEnumerator =
[headers objectEnumerator];
OFString *key, *object;
while ((key = [keyEnumerator nextObject]) != nil &&
(object = [objectEnumerator nextObject]) != nil)
|