Initialize deactivate variable and make sure we check it to

control reconnection logic.

When hitting cancel at the logon dialog, server will send a
deactivate PDU and close the socket the hard way. This behaviour
introduce a problem when using SSL connection were rdesktop
detected a network error and entered reconnection loop.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1748 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Henrik Andersson 2013-09-27 08:18:34 +00:00
parent 2ea8e8e5d7
commit 697c0f190d

View File

@ -1153,6 +1153,7 @@ main(int argc, char *argv[])
rd_create_ui(); rd_create_ui();
tcp_run_ui(True); tcp_run_ui(True);
deactivated = False;
g_redirect = False; g_redirect = False;
g_reconnect_loop = False; g_reconnect_loop = False;
rdp_main_loop(&deactivated, &ext_disc_reason); rdp_main_loop(&deactivated, &ext_disc_reason);
@ -1166,7 +1167,7 @@ main(int argc, char *argv[])
continue; continue;
/* handle network error and start autoreconnect */ /* handle network error and start autoreconnect */
if (g_network_error) if (g_network_error && !deactivated)
{ {
fprintf(stderr, fprintf(stderr,
"Disconnected due to network error, retrying to reconnect for %d minutes.\n", "Disconnected due to network error, retrying to reconnect for %d minutes.\n",