Testers for load balancing code wanted

Peter Åstrand <[email protected]>
Newsgroups gmane.network.rdesktop.devel
Message-ID <[email protected]>
As you can see below, I rewrote the top main loop, which might affect the 
load balancing functionality. If any of you out there are using this 
feature, please test with the latest rdesktop SVN version (revision 1547 
or later).

Best regards,
Peter Åstrand

On Wed, 13 Jan 2010, [email protected] wrote:

> Revision: 1547
>          http://rdesktop.svn.sourceforge.net/rdesktop/?rev=1547&view=rev
> Author:   astrand
> Date:     2010-01-13 16:07:29 +0000 (Wed, 13 Jan 2010)
>
> Log Message:
> -----------
> Re-wrote top main loop. The patch for session directory / load
> balancing redirection made it *way* too complicated. We shouldn't
> really need two extra state variables in addition to g_redirect. The
> current approach also does not support future features such as
> automatic reconnection in case of network problems.
>
> The new loop should be functionally equivalent to the previous one,
> though it hasn't yet been tested with a load balancing server.
>
> Modified Paths:
> --------------
>    rdesktop/trunk/rdesktop.c
>
> Modified: rdesktop/trunk/rdesktop.c
> ===================================================================
> --- rdesktop/trunk/rdesktop.c	2010-01-13 14:53:43 UTC (rev 1546)
> +++ rdesktop/trunk/rdesktop.c	2010-01-13 16:07:29 UTC (rev 1547)
> @@ -455,8 +455,6 @@
> 	char *locale = NULL;
> 	int username_option = 0;
> 	RD_BOOL geometry_option = False;
> -	int run_count = 0;	/* Session Directory support */
> -	RD_BOOL continue_connect = True;	/* Session Directory support */
> #ifdef WITH_RDPSND
> 	char *rdpsnd_optarg = NULL;
> #endif
> @@ -963,16 +961,23 @@
>
> 	rdpdr_init();
>
> -	while (run_count < 2 && continue_connect)	/* add support for Session Directory; only reconnect once */
> +	while (1)
> 	{
> -		ui_init_connection();
> +		rdesktop_reset_state();
>
> -		if (run_count == 0)
> +		if (g_redirect)
> 		{
> -			if (!rdp_connect(server, flags, domain, password, shell, directory, False))
> -				return EX_PROTOCOL;
> +			STRNCPY(domain, g_redirect_domain, sizeof(domain));
> +			xfree(g_username);
> +			g_username = (char *) xmalloc(strlen(g_redirect_username) + 1);
> +			STRNCPY(g_username, g_redirect_username, sizeof(g_username));
> +			STRNCPY(password, g_redirect_password, sizeof(password));
> +			STRNCPY(server, g_redirect_server, sizeof(server));
> +			flags |= RDP_LOGON_AUTO;
> 		}
> -		else if (!rdp_connect(server, flags, domain, password, shell, directory, True))
> +
> +		ui_init_connection();
> +		if (!rdp_connect(server, flags, domain, password, shell, directory, g_redirect))
> 			return EX_PROTOCOL;
>
> 		/* By setting encryption to False here, we have an encrypted login
> @@ -984,39 +989,20 @@
> 		DEBUG(("Connection successful.\n"));
> 		memset(password, 0, sizeof(password));
>
> -		if (run_count == 0)
> +		if (!g_redirect)
> 			if (!ui_create_window())
> 				return EX_OSERR;
>
> -		if (continue_connect)
> -			rdp_main_loop(&deactivated, &ext_disc_reason);
> +		g_redirect = False;
> +		rdp_main_loop(&deactivated, &ext_disc_reason);
>
> 		DEBUG(("Disconnecting...\n"));
> 		rdp_disconnect();
>
> -		if ((g_redirect == True) && (run_count == 0))	/* Support for Session Directory */
> -		{
> -			/* reset state of major globals */
> -			rdesktop_reset_state();
> -
> -			STRNCPY(domain, g_redirect_domain, sizeof(domain));
> -			xfree(g_username);
> -			g_username = (char *) xmalloc(strlen(g_redirect_username) + 1);
> -			STRNCPY(g_username, g_redirect_username, sizeof(g_username));
> -			STRNCPY(password, g_redirect_password, sizeof(password));
> -			STRNCPY(server, g_redirect_server, sizeof(server));
> -			flags |= RDP_LOGON_AUTO;
> -
> -			g_redirect = False;
> -		}
> -		else
> -		{
> -			continue_connect = False;
> -			ui_destroy_window();
> -			break;
> -		}
> -
> -		run_count++;
> +		if (g_redirect)
> +			continue;
> +		ui_destroy_window();
> +		break;
> 	}
>
> 	cache_save_state();
>
>
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Rdesktop-commits mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdesktop-commits
>


---
Peter Åstrand		ThinLinc Chief Developer
Cendio AB		http://www.cendio.com
Wallenbergs gata 4
583 30 Linköping	Phone: +46-13-21 46 00

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

_______________________________________________
rdesktop-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdesktop-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.