Adjust to ObjFW changes
FossilOrigin-Name: 6b6fe6d802020bb3d3569e43c6a0ca08ca9f7792a5b3499953a7095abe824a19
This commit is contained in:
parent
f984171b15
commit
96f6425bfc
1 changed files with 26 additions and 43 deletions
|
@ -124,11 +124,17 @@
|
|||
- (void)client: (OFHTTPClient *)client
|
||||
didPerformRequest: (OFHTTPRequest *)request
|
||||
response: (OFHTTPResponse *)response
|
||||
exception: (id)exception
|
||||
{
|
||||
if (response != nil &&
|
||||
[exception isKindOfClass: [OFHTTPRequestFailedException class]])
|
||||
exception = nil;
|
||||
|
||||
/* Reset to nil first, so that another one can be performed. */
|
||||
mtx_request_block_t block = _block;
|
||||
_block = nil;
|
||||
|
||||
if (exception == nil) {
|
||||
@try {
|
||||
OFMutableData *responseData = [OFMutableData data];
|
||||
while (!response.atEndOfStream) {
|
||||
|
@ -149,30 +155,7 @@
|
|||
} @catch (id e) {
|
||||
block(nil, response.statusCode, e);
|
||||
}
|
||||
|
||||
[block release];
|
||||
[self release];
|
||||
}
|
||||
|
||||
- (void)client: (OFHTTPClient *)client
|
||||
didFailWithException: (id)exception
|
||||
request: (OFHTTPRequest *)request
|
||||
{
|
||||
/*
|
||||
* Convert OFHTTPRequestFailedException into a response, so that we
|
||||
* still get the JSON for the failed request.
|
||||
*/
|
||||
if ([exception isKindOfClass: OFHTTPRequestFailedException.class]) {
|
||||
[self client: client
|
||||
didPerformRequest: request
|
||||
response: [exception response]];
|
||||
return;
|
||||
}
|
||||
|
||||
/* Reset to nil first, so that another one can be performed. */
|
||||
mtx_request_block_t block = _block;
|
||||
_block = nil;
|
||||
|
||||
} else
|
||||
block(nil, 0, exception);
|
||||
|
||||
[block release];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue