Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -469,14 +469,13 @@ @throw [OFTruncatedDataException exceptionWithClass: [self class]]; [serverHeaders makeImmutable]; - result = [[OFHTTPRequestResult alloc] - OF_initWithStatusCode: status - headers: serverHeaders - data: data]; + result = [[OFHTTPRequestResult alloc] initWithStatusCode: status + headers: serverHeaders + data: data]; objc_autoreleasePoolPop(pool); [result autorelease]; Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -155,13 +155,33 @@ @property (readonly) short statusCode; @property (readonly, copy) OFDictionary *headers; @property (readonly, retain) OFDataArray *data; #endif -- OF_initWithStatusCode: (short)status - headers: (OFDictionary*)headers - data: (OFDataArray*)data; +/*! + * @brief Creates a new OFHTTPRequestResult. + * + * @param status The HTTP status code replied to the request + * @param headers The headers replied to the request + * @param data The data replied to the request + * @return A new OFHTTPRequestResult + */ ++ resultWithStatusCode: (short)status + headers: (OFDictionary*)headers + data: (OFDataArray*)data; + +/*! + * @brief Initializes an already allocated OFHTTPRequestResult. + * + * @param status The HTTP status code replied to the request + * @param headers The headers replied to the request + * @param data The data replied to the request + * @return An initialized OFHTTPRequestResult + */ +- initWithStatusCode: (short)status + headers: (OFDictionary*)headers + data: (OFDataArray*)data; /*! * @brief Returns the state code of the result of the HTTP request. * * @return The status code of the result of the HTTP request Index: src/OFHTTPRequest.m ================================================================== --- src/OFHTTPRequest.m +++ src/OFHTTPRequest.m @@ -118,13 +118,22 @@ OF_GETTER(MIMEType, YES) } @end @implementation OFHTTPRequestResult -- OF_initWithStatusCode: (short)status - headers: (OFDictionary*)headers_ - data: (OFDataArray*)data_ ++ resultWithStatusCode: (short)status + headers: (OFDictionary*)headers + data: (OFDataArray*)data +{ + return [[[self alloc] initWithStatusCode: status + headers: headers + data: data] autorelease]; +} + +- initWithStatusCode: (short)status + headers: (OFDictionary*)headers_ + data: (OFDataArray*)data_ { self = [super init]; statusCode = status; data = [data_ retain];