@@ -18,11 +18,11 @@ #include #include #import "OFHTTPServer.h" -#import "OFDataArray.h" +#import "OFData.h" #import "OFDate.h" #import "OFDictionary.h" #import "OFURL.h" #import "OFHTTPRequest.h" #import "OFHTTPResponse.h" @@ -333,11 +333,11 @@ of_http_request_method_t _method; OFString *_host, *_path; uint16_t _port; OFMutableDictionary *_headers; size_t _contentLength; - OFDataArray *_body; + OFMutableData *_body; } - initWithSocket: (OFTCPSocket *)socket server: (OFHTTPServer *)server; - (bool)socket: (OFTCPSocket *)socket @@ -498,11 +498,11 @@ if (contentLength > 0) { char *buffer; buffer = [self allocMemoryWithSize: BUFFER_SIZE]; - _body = [[OFDataArray alloc] init]; + _body = [[OFMutableData alloc] init]; [_socket asyncReadIntoBuffer: buffer length: BUFFER_SIZE target: self selector: @selector(socket: @@ -586,10 +586,12 @@ * now as the async read is the only thing referencing self and * the buffer is allocated on self, it is required once * Connection: keep-alive is implemented. */ [self freeMemory: buffer]; + + [_body makeImmutable]; @try { [self createResponse]; } @catch (OFWriteFailedException *e) { return false;