Differences From Artifact [76d4694db2]:
- File
src/OFHTTPResponse.m
— part of check-in
[fedbbb2344]
at
2017-05-15 21:41:13
on branch trunk
— Remove cookies from OFHTTP{Request,Response}
These can just live in the headers. (user: js, size: 6308) [annotate] [blame] [check-ins using]
To Artifact [a696a64757]:
- File src/OFHTTPResponse.m — part of check-in [c8f7b90082] at 2017-07-22 20:50:27 on branch trunk — Split OFDataArray into OFData and OFMutableData (user: js, size: 6294) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
16 17 18 19 20 21 22 | #include "config.h" #import "OFHTTPResponse.h" #import "OFString.h" #import "OFDictionary.h" #import "OFArray.h" | | | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include "config.h" #import "OFHTTPResponse.h" #import "OFString.h" #import "OFDictionary.h" #import "OFArray.h" #import "OFData.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "OFUnsupportedVersionException.h" |
︙ | ︙ | |||
207 208 209 210 211 212 213 | return [self stringWithEncoding: OF_STRING_ENCODING_AUTODETECT]; } - (OFString *)stringWithEncoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFString *contentType, *contentLength, *ret; | | | | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | return [self stringWithEncoding: OF_STRING_ENCODING_AUTODETECT]; } - (OFString *)stringWithEncoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFString *contentType, *contentLength, *ret; OFData *data; if (encoding == OF_STRING_ENCODING_AUTODETECT && (contentType = [_headers objectForKey: @"Content-Type"]) != nil) encoding = encodingForContentType(contentType); if (encoding == OF_STRING_ENCODING_AUTODETECT) encoding = OF_STRING_ENCODING_UTF_8; data = [self readDataUntilEndOfStream]; if ((contentLength = [_headers objectForKey: @"Content-Length"]) != nil) if ([data count] != (size_t)[contentLength decimalValue]) @throw [OFTruncatedDataException exception]; ret = [[OFString alloc] initWithCString: (char *)[data items] encoding: encoding |
︙ | ︙ |