Differences From Artifact [561ec71175]:
- File
src/OFHTTPClient.m
— part of check-in
[25c985fec1]
at
2020-08-25 00:11:24
on branch trunk
— OFNumber: Remove (u)int{8,16,32,64} methods
Since C guarantees minimum sizes for char, short, int, long and long
long, these can be used instead. (user: js, size: 30364) [annotate] [blame] [check-ins using] [more...]
To Artifact [f132e311be]:
- File
src/OFHTTPClient.m
— part of check-in
[6e42ee482f]
at
2020-10-10 10:58:30
on branch trunk
— Make HTTP status code consistently a short
It used to be a short in some places and an int in other places. (user: js, size: 30374) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
58 59 60 61 62 63 64 | { @public OFHTTPClient *_client; OFHTTPRequest *_request; unsigned int _redirects; bool _firstLine; OFString *_version; | | | 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; short _status; OFMutableDictionary OF_GENERIC(OFString *, OFString *) *_serverHeaders; } - (instancetype)initWithClient: (OFHTTPClient *)client request: (OFHTTPRequest *)request redirects: (unsigned int)redirects; - (void)start; |
︙ | ︙ | |||
237 238 239 240 241 242 243 | firstLetter = false; str++; } } static bool | | | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | firstLetter = false; str++; } } static bool defaultShouldFollow(of_http_request_method_t method, short statusCode) { bool follow; /* * 301, 302 and 307 should only redirect with user confirmation if the * request method is not GET or HEAD. Asking the delegate and getting * true returned is considered user confirmation. |
︙ | ︙ | |||
467 468 469 470 471 472 473 | exceptionWithVersion: _version]; status = [line substringWithRange: of_range(9, 3)].longLongValue; if (status < 0 || status > 599) @throw [OFInvalidServerReplyException exception]; | | | 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]; _status = (short)status; return true; } - (bool)handleServerHeader: (OFString *)line socket: (OFTCPSocket *)sock { |
︙ | ︙ | |||
1178 1179 1180 1181 1182 1183 1184 | [_delegate client: client wantsRequestBody: body request: request]; } - (void)client: (OFHTTPClient *)client didReceiveHeaders: (OFDictionary OF_GENERIC(OFString *, OFString *) *)headers | | | | 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 statusCode: (short)statusCode request: (OFHTTPRequest *)request { if ([_delegate respondsToSelector: @selector(client:didReceiveHeaders:statusCode:request:)]) [_delegate client: client didReceiveHeaders: headers statusCode: statusCode request: request]; } - (bool)client: (OFHTTPClient *)client shouldFollowRedirect: (OFURL *)URL statusCode: (short)statusCode request: (OFHTTPRequest *)request response: (OFHTTPResponse *)response { if ([_delegate respondsToSelector: @selector(client: shouldFollowRedirect:statusCode:request:response:)]) return [_delegate client: client shouldFollowRedirect: URL |
︙ | ︙ |