Differences From Artifact [723a0ca5c9]:
- File src/OFHTTPClient.m — part of check-in [d0ae3bfd6c] at 2020-10-25 23:33:09 on branch trunk — Add of_{malloc,calloc,realloc,free} (user: js, size: 30283) [annotate] [blame] [check-ins using]
To Artifact [62848f22ab]:
- File
src/OFHTTPClient.m
— part of check-in
[7f102e8c95]
at
2020-10-31 19:16:46
on branch trunk
— OFHTTPClient: Remove didFailWithException
Instead, add an exception to didPerformRequest, to make it more
consistent with other places. (user: js, size: 30336) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
294 295 296 297 298 299 300 | - (void)raiseException: (id)exception { [_client close]; _client->_inProgress = false; [_client->_delegate client: _client | > > | < > | 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 | - (void)raiseException: (id)exception { [_client close]; _client->_inProgress = false; [_client->_delegate client: _client didPerformRequest: _request response: nil exception: exception]; } - (void)createResponseWithSocketOrThrow: (OFTCPSocket *)sock { OFURL *URL = _request.URL; OFHTTPClientResponse *response; OFString *connectionHeader; bool keepAlive; OFString *location; id exception; response = [[[OFHTTPClientResponse alloc] initWithSocket: sock] autorelease]; response.protocolVersionString = _version; response.statusCode = _status; response.headers = _serverHeaders; |
︙ | ︙ | |||
418 419 420 421 422 423 424 | return; } } _client->_inProgress = false; if (_status / 100 != 2) | | > > | > | 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | return; } } _client->_inProgress = false; if (_status / 100 != 2) exception = [OFHTTPRequestFailedException exceptionWithRequest: _request response: response]; else exception = nil; [_client->_delegate performSelector: @selector(client:didPerformRequest: response:exception:) withObject: _client withObject: _request withObject: response withObject: exception afterDelay: 0]; } - (void)createResponseWithSocket: (OFTCPSocket *)sock { @try { [self createResponseWithSocketOrThrow: sock]; |
︙ | ︙ | |||
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 | return _response; } - (void)client: (OFHTTPClient *)client didPerformRequest: (OFHTTPRequest *)request response: (OFHTTPResponse *)response { [[OFRunLoop currentRunLoop] stop]; [_response release]; _response = [response retain]; [_delegate client: client didPerformRequest: request | > > > > > > > > > > > > | < < < < < < < < < < < < < | | 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | return _response; } - (void)client: (OFHTTPClient *)client didPerformRequest: (OFHTTPRequest *)request response: (OFHTTPResponse *)response exception: (id)exception { if (exception != nil) { /* * Restore the delegate - we're giving up, but not reaching the * release of the autorelease pool that contains us, so * resetting it via -[dealloc] might be too late. */ _client.delegate = _delegate; @throw exception; } [[OFRunLoop currentRunLoop] stop]; [_response release]; _response = [response retain]; [_delegate client: client didPerformRequest: request response: response exception: nil]; } - (void)client: (OFHTTPClient *)client didCreateSocket: (OFTCPSocket *)sock request: (OFHTTPRequest *)request { if ([_delegate respondsToSelector: |
︙ | ︙ |