Differences From Artifact [ae2e00de64]:
- File
src/OFHTTPResponse.m
— part of check-in
[7c2a0dda3d]
at
2017-05-07 15:39:31
on branch trunk
— Do not include any addresses in -[description]
This makes it harder to accidentally leak addresses which could be used
to defeat ASLR. (user: js, size: 6329) [annotate] [blame] [check-ins using]
To Artifact [b039102173]:
- File
src/OFHTTPResponse.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 6335) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
166 167 168 169 170 171 172 | } - (of_http_request_protocol_version_t)protocolVersion { return _protocolVersion; } | | | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | } - (of_http_request_protocol_version_t)protocolVersion { return _protocolVersion; } - (void)setProtocolVersionFromString: (OFString *)string { void *pool = objc_autoreleasePoolPush(); OFArray *components = [string componentsSeparatedByString: @"."]; intmax_t major, minor; of_http_request_protocol_version_t protocolVersion; if ([components count] != 2) |
︙ | ︙ | |||
190 191 192 193 194 195 196 | protocolVersion.minor = (uint8_t)minor; [self setProtocolVersion: protocolVersion]; objc_autoreleasePoolPop(pool); } | | | | | | | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | protocolVersion.minor = (uint8_t)minor; [self setProtocolVersion: protocolVersion]; objc_autoreleasePoolPop(pool); } - (OFString *)protocolVersionString { return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major, _protocolVersion.minor]; } - (OFString *)string { return [self stringWithEncoding: OF_STRING_ENCODING_AUTODETECT]; } - (OFString *)stringWithEncoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFString *contentType, *contentLength, *ret; OFDataArray *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 readDataArrayTillEndOfStream]; 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 length: [data count]]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } - (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *indentedHeaders, *ret; indentedHeaders = [[_headers description] stringByReplacingOccurrencesOfString: @"\n" withString: @"\n\t"]; |
︙ | ︙ |