Overview
Comment: | Make HTTP status code consistently a short
It used to be a short in some places and an int in other places. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
6e42ee482ff02f76c845f6461688c20c |
User & Date: | js on 2020-10-10 10:58:30 |
Other Links: | manifest | tags |
Context
2020-10-10
| ||
11:09 | ofhttp: Add --ignore-status option check-in: 3162555b75 user: js tags: trunk | |
10:58 | Make HTTP status code consistently a short check-in: 6e42ee482f user: js tags: trunk | |
2020-10-04
| ||
14:43 | PLATFORMS.md: Restore NetBSD versions check-in: 8f17ff1ee4 user: js tags: trunk | |
Changes
Modified src/OFHTTPClient.h from [f4b177457f] to [2c21807c55].
︙ | |||
97 98 99 100 101 102 103 | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | - + | * @param headers The headers received * @param statusCode The status code received * @param request The request for which the headers and status code have been * received */ - (void)client: (OFHTTPClient *)client didReceiveHeaders: (OFDictionary OF_GENERIC(OFString *, OFString *) *)headers |
︙ | |||
126 127 128 129 130 131 132 | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | - + | * (e.g. to set the cookies for the new URL), however, keep in * mind that this will change the request you originally passed. * @param response The response indicating the redirect * @return A boolean whether the OFHTTPClient should follow the redirect */ - (bool)client: (OFHTTPClient *)client shouldFollowRedirect: (OFURL *)URL |
︙ |
Modified src/OFHTTPClient.m from [561ec71175] to [f132e311be].
︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | - + | { @public OFHTTPClient *_client; OFHTTPRequest *_request; unsigned int _redirects; bool _firstLine; OFString *_version; |
︙ | |||
237 238 239 240 241 242 243 | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | - + | firstLetter = false; str++; } } static bool |
︙ | |||
467 468 469 470 471 472 473 | 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | - + | exceptionWithVersion: _version]; status = [line substringWithRange: of_range(9, 3)].longLongValue; if (status < 0 || status > 599) @throw [OFInvalidServerReplyException exception]; |
︙ | |||
1178 1179 1180 1181 1182 1183 1184 | 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 | - + - + | [_delegate client: client wantsRequestBody: body request: request]; } - (void)client: (OFHTTPClient *)client didReceiveHeaders: (OFDictionary OF_GENERIC(OFString *, OFString *) *)headers |
︙ |
Modified src/OFHTTPResponse.m from [b38122cc28] to [2c42d95890].
︙ | |||
346 347 348 349 350 351 352 | 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | - + | indentedHeaders = [_headers.description stringByReplacingOccurrencesOfString: @"\n" withString: @"\n\t"]; ret = [[OFString alloc] initWithFormat: @"<%@:\n" |
Modified src/OFHTTPServer.m from [abf9a790cd] to [28acc739df].
︙ | |||
180 181 182 183 184 185 186 | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | - + | - (void)of_sendHeaders { void *pool = objc_autoreleasePoolPush(); OFMutableDictionary OF_GENERIC(OFString *, OFString *) *headers; OFEnumerator *keyEnumerator, *valueEnumerator; OFString *key, *value; |
︙ | |||
501 502 503 504 505 506 507 | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | - + | } - (bool)sendErrorAndClose: (short)statusCode { OFString *date = [[OFDate date] dateStringWithFormat: @"%a, %d %b %Y %H:%M:%S GMT"]; |
︙ |
Modified src/exceptions/OFHTTPRequestFailedException.m from [802233b235] to [ef8de3042e].
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 | - + | } - (OFString *)description { const char *method = of_http_request_method_to_string(_request.method); return [OFString stringWithFormat: |
Modified utils/ofhttp/OFHTTP.m from [cd147444d1] to [20466a8b30].
︙ | |||
602 603 604 605 606 607 608 | 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | - + | [body writeBuffer: buffer length: length]; } } - (bool)client: (OFHTTPClient *)client shouldFollowRedirect: (OFURL *)URL |
︙ | |||
703 704 705 706 707 708 709 | 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | - + | @" %[error]: %[exception]", @"prog", [OFApplication programName], @"url", request.URL.string, @"error", error, @"exception", e)]; } else if ([e isKindOfClass: [OFHTTPRequestFailedException class]]) { short statusCode = [[e response] statusCode]; |
︙ | |||
782 783 784 785 786 787 788 | 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 | - + - + | } return true; } - (void)client: (OFHTTPClient *)client didReceiveHeaders: (OFDictionary OF_GENERIC(OFString *, OFString *) *)headers |
︙ |