Clear g_exit_mainloop before new connection

Reuse of g_exit_mainloop can occur at various situations
such as on redirection, when a new connection is initialized.

If you call rdp_loop with this flag set, things will not work as
you'd expect.

Fixes issue #228

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
This commit is contained in:
Cendio 2018-01-29 13:55:25 +01:00
parent da5153c578
commit 2491a3c436

4
rdp.c
View File

@ -1810,9 +1810,6 @@ rdp_main_loop(RD_BOOL * deactivated, uint32 * ext_disc_reason)
g_exit_mainloop = True; g_exit_mainloop = True;
} }
} while(g_exit_mainloop == False); } while(g_exit_mainloop == False);
/* clear the exit main loop flag */
g_exit_mainloop = False;
} }
/* used in uiports and rdp_main_loop, processes the RDP packets waiting */ /* used in uiports and rdp_main_loop, processes the RDP packets waiting */
@ -1901,6 +1898,7 @@ rdp_reset_state(void)
{ {
g_next_packet = NULL; /* reset the packet information */ g_next_packet = NULL; /* reset the packet information */
g_rdp_shareid = 0; g_rdp_shareid = 0;
g_exit_mainloop = False;
sec_reset_state(); sec_reset_state();
} }