@@ -233,17 +233,16 @@ if (!_chunked) return [_socket writeBuffer: buffer length: length]; pool = objc_autoreleasePoolPush(); - [_socket writeString: [OFString stringWithFormat: @"%zx\r\n", length]]; + [_socket writeString: [OFString stringWithFormat: @"%zX\r\n", length]]; objc_autoreleasePoolPop(pool); [_socket writeBuffer: buffer length: length]; - [_socket writeBuffer: "\r\n" - length: 2]; + [_socket writeString: @"\r\n"]; return length; } - (void)close @@ -708,12 +707,12 @@ line = [line substringWithRange: of_range(0, range.location)]; if (line.length < 1) { /* - * We read the empty string because the socket is at - * end of stream. + * We have read the empty string because the socket is + * at end of stream. */ if (_socket.atEndOfStream && range.location == OF_NOT_FOUND) @throw [OFTruncatedDataException exception]; else