Differences From Artifact [46acc91009]:
- File utils/ofhttp/OFHTTP.m — part of check-in [a06354b42a] at 2017-10-22 15:05:39 on branch trunk — Make Apple GCC with -Wshadow happy (user: js, size: 26271) [annotate] [blame] [check-ins using]
To Artifact [e43d76979b]:
- File
utils/ofhttp/OFHTTP.m
— part of check-in
[34fe205b84]
at
2017-11-12 18:27:56
on branch trunk
— OFFileManager: Major API redesign
This removes all query methods and replaces them by a single one that
returns a dictionary. Not only does this allow querying multiple
attributes at once, it is also more extensible, as the previous
attributes were specific to file URLs. (user: js, size: 26314) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
38 39 40 41 42 43 44 | #import "OFConnectionFailedException.h" #import "OFHTTPRequestFailedException.h" #import "OFInvalidFormatException.h" #import "OFInvalidServerReplyException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" | | | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #import "OFConnectionFailedException.h" #import "OFHTTPRequestFailedException.h" #import "OFInvalidFormatException.h" #import "OFInvalidServerReplyException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFRetrieveItemAttributesFailedException.h" #import "OFUnsupportedProtocolException.h" #import "OFWriteFailedException.h" #import "ProgressBar.h" #define GIBIBYTE (1024 * 1024 * 1024) #define MEBIBYTE (1024 * 1024) |
| ︙ | ︙ | |||
930 931 932 933 934 935 936 |
}
if (_currentFileName == nil)
_currentFileName = [[[URL path] lastPathComponent] copy];
if (_continue) {
@try {
| | | | | 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 |
}
if (_currentFileName == nil)
_currentFileName = [[[URL path] lastPathComponent] copy];
if (_continue) {
@try {
uintmax_t size = [[[OFFileManager defaultManager]
attributesOfItemAtPath: _currentFileName] fileSize];
OFString *range;
if (size > INTMAX_MAX)
@throw [OFOutOfRangeException exception];
_resumedFrom = (intmax_t)size;
range = [OFString stringWithFormat: @"bytes=%jd-",
_resumedFrom];
[clientHeaders setObject: range
forKey: @"Range"];
} @catch (OFRetrieveItemAttributesFailedException *e) {
}
}
request = [OFHTTPRequest requestWithURL: URL];
[request setHeaders: clientHeaders];
[request setMethod: _method];
[request setBody: _body];
|
| ︙ | ︙ |