diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index dcb1bc18757..72f07279209 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -2787,7 +2787,7 @@ management_io (struct management *man) net_event_win32_clear_selected_events (&man->connection.ne32, FD_ACCEPT); } } - else if (man->connection.state == MS_CC_WAIT_READ || man->connection.state == MS_CC_WAIT_WRITE) + else if (man->connection.state == MS_CC_WAIT_READ) { if (net_events & FD_READ) { @@ -2796,6 +2796,8 @@ management_io (struct management *man) net_event_win32_clear_selected_events (&man->connection.ne32, FD_READ); } + if (man->connection.state == MS_CC_WAIT_WRITE) + { if (net_events & FD_WRITE) { int status; @@ -2805,6 +2807,7 @@ management_io (struct management *man) net_event_win32_clear_selected_events (&man->connection.ne32, FD_WRITE); } } + } } } }