Overview
Comment: | OFHTTPRequest: Rename entity to body |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c8877fd278e34062394ea3fd8ffd87d8 |
User & Date: | js on 2015-05-23 11:21:43 |
Other Links: | manifest | tags |
Context
2015-05-24
| ||
10:58 | utils/ofhttp: Add verbose mode check-in: 33760dee1a user: js tags: trunk | |
2015-05-23
| ||
11:21 | OFHTTPRequest: Rename entity to body check-in: c8877fd278 user: js tags: trunk | |
2015-05-21
| ||
21:10 | OFHTTPClient: Better keep-alive detection logic check-in: 03f10291e6 user: js tags: trunk | |
Changes
Modified src/OFHTTPClient.m from [e745036a39] to [d946419431].
︙ | |||
327 328 329 330 331 332 333 | 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | - + | void *pool = objc_autoreleasePoolPush(); OFURL *URL = [request URL]; OFString *scheme = [URL scheme]; of_http_request_method_t method = [request method]; OFMutableString *requestString; OFString *user, *password; OFDictionary *headers = [request headers]; |
︙ | |||
420 421 422 423 424 425 426 | 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | - + - + | } if ([headers objectForKey: @"User-Agent"] == nil) [requestString appendString: @"User-Agent: Something using ObjFW " @"<https://webkeks.org/objfw>\r\n"]; |
︙ | |||
456 457 458 459 460 461 462 | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 | - - - + + + - - - - + + + + | @throw e; /* Reconnect in case a keep-alive connection timed out */ socket = [self OF_closeAndCreateSocketForRequest: request]; [socket writeString: requestString]; } |
︙ | |||
630 631 632 633 634 635 636 | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | - + | if (follow) { OFHTTPRequest *newRequest; newRequest = [OFHTTPRequest requestWithURL: newURL]; [newRequest setMethod: method]; [newRequest setHeaders: headers]; |
︙ | |||
656 657 658 659 660 661 662 | 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 | - + | if (![key hasPrefix: @"Content-"]) [newHeaders setObject: object forKey: key]; [newRequest setMethod: OF_HTTP_REQUEST_METHOD_GET]; [newRequest setHeaders: newHeaders]; |
︙ |
Modified src/OFHTTPRequest.h from [9935b8277c] to [2ca5d029e3].
︙ | |||
70 71 72 73 74 75 76 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + - + | */ @interface OFHTTPRequest: OFObject <OFCopying> { OFURL *_URL; of_http_request_method_t _method; of_http_request_protocol_version_t _protocolVersion; OFDictionary *_headers; |
︙ | |||
180 181 182 183 184 185 186 | 180 181 182 183 184 185 186 187 188 189 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 | - + - + - + - - + + - + | * @return A dictionary with headers for the HTTP request. */ - (OFDictionary*)headers; /*! * @brief Sets the entity body of the HTTP request. * |
︙ |
Modified src/OFHTTPRequest.m from [b4e7571ab2] to [e92c282719].
︙ | |||
113 114 115 116 117 118 119 | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | - + - + | return self; } - (void)dealloc { [_URL release]; [_headers release]; |
︙ | |||
152 153 154 155 156 157 158 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | - + - + | request = object; if (request->_method != _method || request->_protocolVersion.major != _protocolVersion.major || request->_protocolVersion.minor != _protocolVersion.minor || ![request->_URL isEqual: _URL] || ![request->_headers isEqual: _headers] || |
︙ | |||
254 255 256 257 258 259 260 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | - + - + - + - - + + - - + + - + - - - + + + - + - + - + - + - + - + | } - (OFDictionary*)headers { OF_GETTER(_headers, true) } |
Modified src/OFHTTPServer.m from [c3a8a62614] to [0ddfcecf31].
︙ | |||
299 300 301 302 303 304 305 | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | - + | } _state; uint8_t _HTTPMinorVersion; of_http_request_method_t _method; OFString *_host, *_path; uint16_t _port; OFMutableDictionary *_headers; size_t _contentLength; |
︙ | |||
352 353 354 355 356 357 358 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | - + | [_timer invalidate]; [_timer release]; [_host release]; [_path release]; [_headers release]; |
︙ | |||
466 467 468 469 470 471 472 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | - + | return [self sendErrorAndClose: 400]; } if (contentLength > 0) { char *buffer; buffer = [self allocMemoryWithSize: BUFFER_SIZE]; |
︙ | |||
539 540 541 542 543 544 545 | 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 | - - + + - + | didReadIntoBuffer: (char*)buffer length: (size_t)length exception: (OFException*)exception { if ([socket isAtEndOfStream] || exception != nil) return false; |
︙ | |||
624 625 626 627 628 629 630 | 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | - + | [URL setPath: _path]; request = [OFHTTPRequest requestWithURL: URL]; [request setMethod: _method]; [request setProtocolVersion: (of_http_request_protocol_version_t){ 1, _HTTPMinorVersion }]; [request setHeaders: _headers]; |
︙ |
Modified utils/ofhttp/OFHTTP.m from [d09ed2ac2f] to [84d9105a37].
︙ | |||
51 52 53 54 55 56 57 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + | @interface OFHTTP: OFObject { OFArray *_URLs; size_t _URLIndex; int _errorCode; OFString *_outputPath; bool _continue, _detectFileName, _quiet; |
︙ | |||
74 75 76 77 78 79 80 81 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | + - | [of_stderr writeFormat: @"Usage: %@ -[cehHmoOPq] url1 [url2 ...]\n", [OFApplication programName]]; if (full) [stream writeString: @"\nOptions:\n" @" -b Specify the file to send as body\n" @" -c Continue download of existing file\n" |
︙ | |||
134 135 136 137 138 139 140 | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + - - + + | of_range(pos + 1, [header length] - pos - 1)]; value = [value stringByDeletingEnclosingWhitespaces]; [_clientHeaders setObject: value forKey: name]; } |
︙ | |||
200 201 202 203 204 205 206 | 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 | - + + + + - - - | [OFApplication terminateWithStatus: 1]; } } - (void)applicationDidFinishLaunching { OFOptionsParser *optionsParser = |
︙ | |||
608 609 610 611 612 613 614 | 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | - + | } @catch (OFStatItemFailedException *e) { } } request = [OFHTTPRequest requestWithURL: URL]; [request setHeaders: clientHeaders]; [request setMethod: _method]; |
︙ |