@@ -68,29 +68,27 @@ OFTCPSocket *_socket; bool _hasContentLength, _chunked, _keepAlive, _atEndOfStream; size_t _toRead; } +@property (nonatomic, setter=of_setKeepAlive:) bool of_keepAlive; + - initWithSocket: (OFTCPSocket *)socket; -- (void)OF_setKeepAlive: (bool)keepAlive; @end @implementation OFHTTPClientResponse +@synthesize of_keepAlive = _keepAlive; + - initWithSocket: (OFTCPSocket *)socket { self = [super init]; _socket = [socket retain]; return self; } -- (void)OF_setKeepAlive: (bool)keepAlive -{ - _keepAlive = keepAlive; -} - - (void)dealloc { [_socket release]; [super dealloc]; @@ -281,11 +279,11 @@ { return [self performRequest: request redirects: 10]; } -- (OFTCPSocket *)OF_closeAndCreateSocketForRequest: (OFHTTPRequest *)request +- (OFTCPSocket *)of_closeAndCreateSocketForRequest: (OFHTTPRequest *)request { OFURL *URL = [request URL]; OFTCPSocket *socket; [self close]; @@ -367,11 +365,11 @@ } @finally { [_lastResponse release]; _lastResponse = nil; } } else - socket = [self OF_closeAndCreateSocketForRequest: request]; + socket = [self of_closeAndCreateSocketForRequest: request]; /* * As a work around for a bug with split packets in lighttpd when using * HTTPS, we construct the complete request in a buffer string and then * send it all at once. @@ -474,11 +472,11 @@ } @catch (OFWriteFailedException *e) { if ([e errNo] != ECONNRESET && [e errNo] != EPIPE) @throw e; /* Reconnect in case a keep-alive connection timed out */ - socket = [self OF_closeAndCreateSocketForRequest: request]; + socket = [self of_closeAndCreateSocketForRequest: request]; [socket writeString: requestString]; } if (body != nil) [socket writeBuffer: [body items] @@ -494,11 +492,11 @@ * It's possible that the write succeeds on a connection that is * keep-alive, but the connection has already been closed by the remote * end due to a timeout. In this case, we need to reconnect. */ if (line == nil) { - socket = [self OF_closeAndCreateSocketForRequest: request]; + socket = [self of_closeAndCreateSocketForRequest: request]; [socket writeString: requestString]; if (body != nil) [socket writeBuffer: [body items] length: [body count] * @@ -605,11 +603,11 @@ else keepAlive = false; } if (keepAlive) { - [response OF_setKeepAlive: true]; + [response of_setKeepAlive: true]; _socket = [socket retain]; _lastURL = [URL copy]; _lastWasHEAD = (method == OF_HTTP_REQUEST_METHOD_HEAD); _lastResponse = [response retain];