From 39c8537e2007171f1ff52c34ed212b004daf72cc Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Wed, 13 May 2020 02:39:37 +0200 Subject: [PATCH] [0.4.14][MSAFD] Workaround regression CORE-15804 To fix 'MSTSC fails to connect with error "ERROR: Bad packet header"' which regressed by 0.4.12-dev-752-g 6bc61f63f1e0ad20ab09f881d6968558eba9a8e6 In 0.4.12 and 0.4.13 releases I totally reverted Pierre Schweitzer's work instead. Thanks to Doug Lyons, author of this new workaround, we can keep Pierre's work. We think MSAFD is a better place to workaround than our MSTSC binary, because our MSTSC runs fine on W2K3SP2. fix cherry picked from commit 0.4.15-dev-211-g 666fe66fe97d3d0f602fd30d5f3987f980f2c934 --- dll/win32/msafd/misc/dllmain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c index 4f8e76c10a3..52d71e702fe 100644 --- a/dll/win32/msafd/misc/dllmain.c +++ b/dll/win32/msafd/misc/dllmain.c @@ -2890,6 +2890,10 @@ WSPSetSockOpt( return SOCKET_ERROR; } + /* FIXME: We should not have to limit the packet receive buffer size like this. workaround for CORE-15804 */ + if (*(PULONG)optval > 0x2000) + *(PULONG)optval = 0x2000; + SetSocketInformation(Socket, AFD_INFO_RECEIVE_WINDOW_SIZE, NULL,