Index: src/OFHTTPClient.h ================================================================== --- src/OFHTTPClient.h +++ src/OFHTTPClient.h @@ -66,11 +66,11 @@ didReceiveHeaders: (OFDictionary*)headers statusCode: (int)statusCode request: (OFHTTPRequest*)request; /*! - * @brief A callback which is called when an OFHTTPClient will follow a + * @brief A callback which is called when an OFHTTPClient wants to follow a * redirect. * * If you want to get the headers and data for each redirect, set the number of * redirects to 0 and perform a new OFHTTPClient for each redirect. However, * this callback will not be called then and you have to look at the status code Index: utils/ofhttp/OFHTTP.m ================================================================== --- utils/ofhttp/OFHTTP.m +++ utils/ofhttp/OFHTTP.m @@ -80,10 +80,12 @@ { self = [super init]; @try { _HTTPClient = [[OFHTTPClient alloc] init]; + [_HTTPClient setDelegate: self]; + _buffer = [self allocMemoryWithSize: [OFSystemInfo pageSize]]; } @catch (id e) { [self release]; @throw e; } @@ -136,10 +138,22 @@ } [self performSelector: @selector(downloadNextURL) afterDelay: 0]; } + +- (bool)client: (OFHTTPClient*)client + shouldFollowRedirect: (OFURL*)URL + statusCode: (int)statusCode + request: (OFHTTPRequest*)request +{ + if (!_quiet) + [of_stdout writeFormat: @" ➜ %d\n↻ %@", + statusCode, [URL string]]; + + return true; +} - (bool)stream: (OFHTTPResponse*)response didReadIntoBuffer: (void*)buffer length: (size_t)length exception: (OFException*)e