fix: use sslWriteAll

This commit is contained in:
2026-05-13 11:43:06 -03:00
parent 36b0ead76c
commit d21bbaa281
+3 -2
View File
@@ -530,8 +530,9 @@ void TinyMITMProxy::handleClient(SOCKET clientSocket)
headers.insert(headers.size() - 2, headers.insert(headers.size() - 2,
"Content-Length: " + std::to_string(fullBody.size()) + "\r\n"); "Content-Length: " + std::to_string(fullBody.size()) + "\r\n");
if (wolfSSL_write(remoteSSL.get(), headers.data(), (int)headers.size()) <= 0) break; std::string packet = headers + fullBody;
if (wolfSSL_write(remoteSSL.get(), fullBody.data(), (int)fullBody.size()) <= 0) break; if (!sslWriteAll(remoteSSL.get(), packet.data(), (int)packet.size(), remoteGuard))
break;
} }
clientStream.buffer.erase(0, totalRequestSize); clientStream.buffer.erase(0, totalRequestSize);