Differences From Artifact [e92c282719]:
- File src/OFHTTPRequest.m — part of check-in [c8877fd278] at 2015-05-23 11:21:43 on branch trunk — OFHTTPRequest: Rename entity to body (user: js, size: 7229) [annotate] [blame] [check-ins using]
To Artifact [7383d317b4]:
- File
src/OFHTTPRequest.m
— part of check-in
[48980f2297]
at
2015-11-29 11:43:05
on branch trunk
— Make properties a requirement and clean up code
This increases the required GCC version from 4.0 to 4.6 (exception:
Apple GCC, which already supports this with >= 4.0 starting with OS X
10.5). Since even GCC 4.6 is really old by now, there is no point in
still supporting something even older and making the code ugly because
of that. While some hardware and OS support was dropped from GCC 4.6
compared to GCC 4.0, there is nothing in there that would be an
interesting target with the exception of BeOS maybe - but a port to BeOS
can also be achieved using the Haiku support. The other dropped OSes are
mostly old versions of OSes while newer ones are still being supported
(and those newer versions of those OSes still support the same
hardware). (user: js, size: 6671) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
74 75 76 77 78 79 80 81 82 83 84 85 86 87 | if (strcmp(string, "CONNECT") == 0) return OF_HTTP_REQUEST_METHOD_CONNECT; @throw [OFInvalidFormatException exception]; } @implementation OFHTTPRequest + (instancetype)request { return [[[self alloc] init] autorelease]; } + (instancetype)requestWithURL: (OFURL*)URL { | > > > | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | if (strcmp(string, "CONNECT") == 0) return OF_HTTP_REQUEST_METHOD_CONNECT; @throw [OFInvalidFormatException exception]; } @implementation OFHTTPRequest @synthesize URL = _URL, method = _method, headers = _headers, body = _body; @synthesize remoteAddress = _remoteAddress; + (instancetype)request { return [[[self alloc] init] autorelease]; } + (instancetype)requestWithURL: (OFURL*)URL { |
︙ | ︙ | |||
178 179 180 181 182 183 184 | OF_HASH_ADD_HASH(hash, [_remoteAddress hash]); OF_HASH_FINALIZE(hash); return hash; } | < < < < < < < < < < < < < < < < < < < < | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | OF_HASH_ADD_HASH(hash, [_remoteAddress hash]); OF_HASH_FINALIZE(hash); return hash; } - (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion { if (protocolVersion.major != 1 || protocolVersion.minor > 1) @throw [OFUnsupportedVersionException exceptionWithVersion: [OFString stringWithFormat: @"%u.%u", protocolVersion.major, protocolVersion.minor]]; |
︙ | ︙ | |||
244 245 246 247 248 249 250 | - (OFString*)protocolVersionString { return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major, _protocolVersion.minor]; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | - (OFString*)protocolVersionString { return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major, _protocolVersion.minor]; } - (void)setBodyFromString: (OFString*)string { [self setBodyFromString: string encoding: OF_STRING_ENCODING_UTF_8]; } - (void)setBodyFromString: (OFString*)string encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFDataArray *body = [OFDataArray dataArray]; [body addItems: [string cStringWithEncoding: encoding] count: [string cStringLengthWithEncoding: encoding]]; [self setBody: body]; objc_autoreleasePoolPop(pool); } - (OFString*)description { void *pool = objc_autoreleasePoolPush(); const char *method = of_http_request_method_to_string(_method); OFString *indentedHeaders, *indentedBody, *ret; indentedHeaders = [[_headers description] |
︙ | ︙ |