@@ -554,11 +554,12 @@ return ret; } - (OFData *)stream: (OF_KINDOF(OFStream *))stream - didWriteData: (OFData *)data + didWriteString: (OFString *)string + encoding: (of_string_encoding_t)encoding bytesWritten: (size_t)bytesWritten exception: (id)exception { if (exception != nil) { if ([exception isKindOfClass: [OFWriteFailedException class]] && @@ -605,16 +606,11 @@ * We do not use the socket's write buffer in case we need to resend * the entire request (e.g. in case a keep-alive connection timed out). */ @try { - OFString *requestString = constructRequestString(_request); - OFData *requestData = [OFData - dataWithItems: [requestString UTF8String] - count: [requestString UTF8StringLength]]; - - [sock asyncWriteData: requestData]; + [sock asyncWriteString: constructRequestString(_request)]; } @catch (id e) { [self raiseException: e]; return; } }