From fcfad50543a7702ad29728ab542552c2c8af89d3 Mon Sep 17 00:00:00 2001 From: Lev Stipakov Date: Mon, 17 Apr 2023 21:41:16 +0300 Subject: [PATCH] Bring back delay before management is ready Commit 2b1e586 "Replace Sleep by a Wait function that pumps messages" replaced Sleep() with a wait function which also processes messages. However WM_MANAGEMENT message in some cases requires actual delay to be processed. To achieve that, bring back original Sleep(). Signed-off-by: Lev Stipakov --- manage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manage.c b/manage.c index a3e1896..afa5e0c 100644 --- a/manage.c +++ b/manage.c @@ -345,7 +345,8 @@ OnManagement(SOCKET sk, LPARAM lParam) else if (strncmp(pos, "INFO:", 5) == 0) { /* delay until management interface accepts input */ - OVPNMsgWait(100, c->hwndStatus); + /* use real sleep here, since WM_MANAGEMENT might arrive before management is ready */ + Sleep(100); c->manage.connected = 2; if (rtmsg_handler[ready_]) rtmsg_handler[ready_](c, pos + 5);