Send the proxy header and handshake response in a single write.
If the client uses two separate send() calls, the server's error message
"Proxy header not accepted from host" may be lost. This occurs because
the server sends a TCP RST (reset) instead of a FIN if it closes the socket
while the client is still sending data.
As a result, the client may receive ECONNRESET or EPIPE, without seeing
the actual error from the server.
SET_CLIENT_ERROR and return 1;
because jumping to the error label is not viable in this case as pos is
not initialized and it could raise more errors, this way we still handle
the error while not clashing with the original error handling
implementation
at 252 if the strdup at 248 fails and thus returns NULL by
setting a client error signalling that the client ran out of
memory for easier communication of what exactly failed during the
loading of the plugins and why. Returning from the function just after
open by adding a simple condition that checks whether one of them opens
while the other fails and closing it
and added the extra prentheses for the assignment inside the if statement
for easier debugging and to avoid static analysis flagging it as a wrong
statement inside the if clause
rpl->filename being NULL by setting an error signalling that we ran out
of memory to ease the debugging of the mariadb_rpl_options function and make
it clearer if it ever fails because of this. Also added va_end in this case to
avoid the va_list (ap) leaking when we return from this function and
then returning 1 from the fucntion.
Windows Server 2022 uses version number 10.0.20348, which is less than 10.0.22000.
Therefore, instead of checking for build numbers >= 22000 (which would exclude Server 2022),
we must check for build numbers >= 20348 to correctly include both Windows Server 2022
and Windows 11.
This is safe because TLSv1.3 was first supported in:
- Windows 11 (starting with build 22000)
- Windows Server 2022 (starting with build 20348)
Earlier versions did not support TLSv1.3:
- Windows 10 (up to build 19044)
- Windows Server 2019 (latest build 17763)
Its possible for the net extensions allocation to
succeed but the other extensions to fail to allocate.
In this later case free the net alternatives explicitly
if we where going to free the entire allocation.