You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@vcl.apache.org by "Hartl, Gerhard L." <GH...@odu.edu> on 2011/04/01 20:58:13 UTC

"Get RDP File" Doesn't work first try if too fast

(disregard previous, forgot to retitle)

Since upgrading to 2.2, when a user browses to the 'connect' page, I've noticed that the clients ip is captured and the management node then ssh's to the vm and opens up the port for the clients ip on 3389.   While I understand this is best practice, I have noticed that if they user is to quick clicking through the page that they sometimes have to click the "Get RDP File" twice since the first time tries to connect prior to the port being opened up.  Is there any way around this?

- Gerhard Hartl
Old Dominion University
Norfolk, VA

Re: "Get RDP File" Doesn't work first try if too fast

Posted by Josh Thompson <jo...@ncsu.edu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gerhard,

I created a JIRA issue https://issues.apache.org/jira/browse/VCL-444 and 
attached your code to it so that this feature will be in future releases.

Josh

On Thursday April 07, 2011, Hartl, Gerhard L. wrote:
> For anyone that has this issue, I came up with a temporary solution that is
> easy to implement. This will show a count down of 5 seconds then show the
> Get RDP File button.  This allows enough time for the VCL client to be
> configured.  Tested with IE and Firefox.  Use at own risk!
> 
> 
> Roughly around line 2217 (v2.2.1) on requests.php replace the Get RDP File
> form section with:
> 
> print "<style type=\"text/css\">\n";
> print " .off {\n";
> print " visibility: hidden;\n";
> print " } .on {\n";
> print " visibility: visible;\n";
> print " }\n";
> print "</style>\n";
> print "<script type=\"text/javascript\">\n";
> print " window.onload = function() {\n";
> print " var timeInterval = 5;\n";
> print " if (typeof timeInterval === 'undefined' || parseInt(timeInterval)
> <= 0) {\n"; print "         timeInterval = 1\n";
> print " }\n";
> print "document.getElementById('counter').innerHTML = \" Ready to connect
> in \" + timeInterval + \" seconds\";\n"; print "var si =
> setInterval(function() {\n";
> print "if (timeInterval === 0) {\n";
> print "         clearInterval(si);\n";
> print " } else {\n";
> print "--timeInterval;\n";
> print "if (timeInterval !== 0) {\n";
> print "         document.getElementById('counter').innerHTML = \" Ready to
> connect in \" + timeInterval + \" seconds\";\n"; print "} else {\n";
> print "         document.getElementById('counter').className = 'off';
> //Hiding the counter area.\n"; print "        
> document.getElementById('submit').className = 'on'; //Unhide the Submit
> button\n"; print "}\n";
> print "}\n";
> print "}, 1000);\n";
> print "setTimeout(function() {\n";
> print "}, timeInterval * 1000);\n";
> print "}\n";
> print "</script>\n";
> 
> print "For automatic connection, you can download an RDP file that can ";
> print "be opened by the Remote Desktop Connection program.<br><br>\n";
> print "<b id=counter></b>";
> print "<table summary=\"\">\n";
> print "  <TR>\n";
> print "    <TD>\n";
> print "      <FORM action=\"" . BASEURL . SCRIPT . "\" method=post 
> id=\"connect\">\n"; $cdata = array('requestid' => $requestid,
> 	'resid' => $requestData['reservations'][0]['reservationid']);
> 	$expire = datetimeToUnix($requestData['end']) -
> 	datetimeToUnix($requestData['start']) + 1800; # reservation time plus 
30
> min $cont = addContinuationsEntry('sendRDPfile', $cdata, $expire);
> print "      <INPUT type=hidden name=continuation value=\"$cont\">\n";
> print "      <INPUT type=submit value=\"Get RDP File\" class=\"off\"
> id=\"submit\">\n"; print "      </FORM>\n";
> print "    </TD>\n";
> print "  </TR>\n";
> print "</table>\n";
> 
> 
> 
> 
> - Gerhard Hartl
> Old Dominion University
> Norfolk, VA
> 
> -----Original Message-----
> From: Andy Kurth [mailto:andy_kurth@ncsu.edu]
> Sent: Monday, April 04, 2011 1:33 PM
> To: vcl-user@incubator.apache.org
> Subject: Re: "Get RDP File" Doesn't work first try if too fast
> 
> I have seen the same issue myself.  It's a timing issue related to the
> 'reserved' state.  During this state, the vcld process loops until it
> detects a value in reservation.remoteIP which gets set when the user
> clicks 'Connect'.  There is a 5 second wait in between attempts.  This
> could be reduced but the downside would be a little more processing on the
> management node.
> 
> Once it detects the remote IP has been set, it can take 3-9 seconds for the
> firewall-opening commands to be executed.
> 
> Quickly looking at the code, I think some improvements can be made to
> reduce the lag time.  I created an issue for this:
> https://issues.apache.org/jira/browse/VCL-442
> 
> -Andy
> 
> On 4/1/2011 2:58 PM, Hartl, Gerhard L. wrote:
> > (disregard previous, forgot to retitle)
> > 
> > Since upgrading to 2.2, when a user browses to the 'connect' page, I've
> > noticed that the clients ip is captured and the management node then
> > ssh's to the vm and opens up the port for the clients ip on 3389.  
> > While I understand this is best practice, I have noticed that if they
> > user is to quick clicking through the page that they sometimes have to
> > click the "Get RDP File" twice since the first time tries to connect
> > prior to the port being opened up.  Is there any way around this?
> > 
> > - Gerhard Hartl
> > Old Dominion University
> > Norfolk, VA
> 
> --
> BEGIN-ANTISPAM-VOTING-LINKS
> ------------------------------------------------------
> 
> Teach CanIt if this mail (ID 465117226) is spam:
> Spam:       
> https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c
> =s Not spam:   
> https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c
> =n Forget vote:
> https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c
> =f ------------------------------------------------------
> END-ANTISPAM-VOTING-LINKS
- -- 
- -------------------------------
Josh Thompson
VCL Developer
North Carolina State University

my GPG/PGP key can be found at pgp.mit.edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iEYEARECAAYFAk2fWYsACgkQV/LQcNdtPQNCNgCfTWOaSww+iPEmZJTpifVxVUIG
d5wAn18aOsldKBwOynVSOZnzykcf80iO
=Yl6m
-----END PGP SIGNATURE-----

RE: "Get RDP File" Doesn't work first try if too fast

Posted by "Hartl, Gerhard L." <GH...@odu.edu>.
For anyone that has this issue, I came up with a temporary solution that is easy to implement. This will show a count down of 5 seconds then show the Get RDP File button.  This allows enough time for the VCL client to be configured.  Tested with IE and Firefox.  Use at own risk!


Roughly around line 2217 (v2.2.1) on requests.php replace the Get RDP File form section with:

print "<style type=\"text/css\">\n";
print " .off {\n";
print " visibility: hidden;\n";
print " } .on {\n";
print " visibility: visible;\n";
print " }\n";
print "</style>\n";
print "<script type=\"text/javascript\">\n";
print " window.onload = function() {\n";
print " var timeInterval = 5;\n";
print " if (typeof timeInterval === 'undefined' || parseInt(timeInterval) <= 0) {\n";
print "         timeInterval = 1\n";
print " }\n";
print "document.getElementById('counter').innerHTML = \" Ready to connect in \" + timeInterval + \" seconds\";\n";
print "var si = setInterval(function() {\n";
print "if (timeInterval === 0) {\n";
print "         clearInterval(si);\n";
print " } else {\n";
print "--timeInterval;\n";
print "if (timeInterval !== 0) {\n";
print "         document.getElementById('counter').innerHTML = \" Ready to connect in \" + timeInterval + \" seconds\";\n";
print "} else {\n";
print "         document.getElementById('counter').className = 'off'; //Hiding the counter area.\n";
print "         document.getElementById('submit').className = 'on'; //Unhide the Submit button\n";
print "}\n";
print "}\n";
print "}, 1000);\n";
print "setTimeout(function() {\n";
print "}, timeInterval * 1000);\n";
print "}\n";
print "</script>\n";

print "For automatic connection, you can download an RDP file that can ";
print "be opened by the Remote Desktop Connection program.<br><br>\n";
print "<b id=counter></b>";
print "<table summary=\"\">\n";
print "  <TR>\n";
print "    <TD>\n";
print "      <FORM action=\"" . BASEURL . SCRIPT . "\" method=post  id=\"connect\">\n";
	$cdata = array('requestid' => $requestid,
	'resid' => $requestData['reservations'][0]['reservationid']);
	$expire = datetimeToUnix($requestData['end']) -
	datetimeToUnix($requestData['start']) + 1800; # reservation time plus 30 min
	$cont = addContinuationsEntry('sendRDPfile', $cdata, $expire);
print "      <INPUT type=hidden name=continuation value=\"$cont\">\n";
print "      <INPUT type=submit value=\"Get RDP File\" class=\"off\" id=\"submit\">\n";
print "      </FORM>\n";
print "    </TD>\n";
print "  </TR>\n";
print "</table>\n";




- Gerhard Hartl
Old Dominion University
Norfolk, VA

-----Original Message-----
From: Andy Kurth [mailto:andy_kurth@ncsu.edu] 
Sent: Monday, April 04, 2011 1:33 PM
To: vcl-user@incubator.apache.org
Subject: Re: "Get RDP File" Doesn't work first try if too fast

I have seen the same issue myself.  It's a timing issue related to the 'reserved' state.  During this state, the vcld process loops until it detects a value in reservation.remoteIP which gets set when the user clicks 'Connect'.  There is a 5 second wait in between attempts.  This could be reduced but the downside would be a little more processing on the management node.

Once it detects the remote IP has been set, it can take 3-9 seconds for the firewall-opening commands to be executed.

Quickly looking at the code, I think some improvements can be made to reduce the lag time.  I created an issue for this:
https://issues.apache.org/jira/browse/VCL-442

-Andy

On 4/1/2011 2:58 PM, Hartl, Gerhard L. wrote:
> (disregard previous, forgot to retitle)
>
> Since upgrading to 2.2, when a user browses to the 'connect' page, I've noticed that the clients ip is captured and the management node then ssh's to the vm and opens up the port for the clients ip on 3389.   While I understand this is best practice, I have noticed that if they user is to quick clicking through the page that they sometimes have to click the "Get RDP File" twice since the first time tries to connect prior to the port being opened up.  Is there any way around this?
>
> - Gerhard Hartl
> Old Dominion University
> Norfolk, VA


--
BEGIN-ANTISPAM-VOTING-LINKS
------------------------------------------------------

Teach CanIt if this mail (ID 465117226) is spam:
Spam:        https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c=s
Not spam:    https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c=n
Forget vote: https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c=f
------------------------------------------------------
END-ANTISPAM-VOTING-LINKS


Re: "Get RDP File" Doesn't work first try if too fast

Posted by Andy Kurth <an...@ncsu.edu>.
I have seen the same issue myself.  It's a timing issue related to the 
'reserved' state.  During this state, the vcld process loops until it 
detects a value in reservation.remoteIP which gets set when the user 
clicks 'Connect'.  There is a 5 second wait in between attempts.  This 
could be reduced but the downside would be a little more processing on 
the management node.

Once it detects the remote IP has been set, it can take 3-9 seconds for 
the firewall-opening commands to be executed.

Quickly looking at the code, I think some improvements can be made to 
reduce the lag time.  I created an issue for this:
https://issues.apache.org/jira/browse/VCL-442

-Andy

On 4/1/2011 2:58 PM, Hartl, Gerhard L. wrote:
> (disregard previous, forgot to retitle)
>
> Since upgrading to 2.2, when a user browses to the 'connect' page, I've noticed that the clients ip is captured and the management node then ssh's to the vm and opens up the port for the clients ip on 3389.   While I understand this is best practice, I have noticed that if they user is to quick clicking through the page that they sometimes have to click the "Get RDP File" twice since the first time tries to connect prior to the port being opened up.  Is there any way around this?
>
> - Gerhard Hartl
> Old Dominion University
> Norfolk, VA