From d6ef45d7d952364aa37592a77f2439d0bf479079 Mon Sep 17 00:00:00 2001 From: Aidan Lee Date: Sat, 23 Nov 2024 22:16:05 +0000 Subject: [PATCH] give output buffers meaningful names --- src/hx/libs/ssl/windows/SSL.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/hx/libs/ssl/windows/SSL.cpp b/src/hx/libs/ssl/windows/SSL.cpp index f83a17cbd..3c25ecd1c 100644 --- a/src/hx/libs/ssl/windows/SSL.cpp +++ b/src/hx/libs/ssl/windows/SSL.cpp @@ -23,8 +23,6 @@ namespace { - const int TLS_MAX_PACKET_SIZE = std::numeric_limits::max() + 512; - struct SocketWrapper : public hx::Object { HX_IS_INSTANCE_OF enum { _hx_ClassId = hx::clsIdSocket }; @@ -262,10 +260,9 @@ void _hx_ssl_handshake(Dynamic handle) hx::strbuf hostBuffer; - auto hostString = const_cast(ctx->host.utf8_str(&hostBuffer)); - auto outputBuffer0 = std::vector(TLS_MAX_PACKET_SIZE); - auto outputBuffer1 = std::vector(1024); - auto outputBuffer2 = std::vector(1024); + auto hostString = const_cast(ctx->host.utf8_str(&hostBuffer)); + auto tokenBuffer = std::array::max()>(); + auto alertBuffer = std::array(); auto initial = true; auto staging = std::array::max()>(); @@ -285,8 +282,8 @@ void _hx_ssl_handshake(Dynamic handle) init_sec_buffer_desc(&inputBufferDescription, inputBuffers.data(), inputBuffers.size()); // Output Buffers - init_sec_buffer(&outputBuffers[0], SECBUFFER_TOKEN, outputBuffer0.data(), outputBuffer0.size()); - init_sec_buffer(&outputBuffers[1], SECBUFFER_ALERT, outputBuffer1.data(), outputBuffer1.size()); + init_sec_buffer(&outputBuffers[0], SECBUFFER_TOKEN, tokenBuffer.data(), tokenBuffer.size()); + init_sec_buffer(&outputBuffers[1], SECBUFFER_ALERT, alertBuffer.data(), alertBuffer.size()); init_sec_buffer(&outputBuffers[2], SECBUFFER_EMPTY, nullptr, 0); init_sec_buffer_desc(&outputBufferDescription, outputBuffers.data(), outputBuffers.size());