From fd761cc618fa94fede3d7a1a6aebd3b5c586648e Mon Sep 17 00:00:00 2001 From: Stefan Podskubka Date: Mon, 29 May 2017 14:43:29 +0200 Subject: [PATCH 1/5] Fix private key authentication threading issue App.Current.Resources, where the private keys are cached, can only be accessed from the UI thread. Fixes #22 --- RemoteTerminal/Terminals/AbstractTerminal.cs | 40 ++++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/RemoteTerminal/Terminals/AbstractTerminal.cs b/RemoteTerminal/Terminals/AbstractTerminal.cs index 31f101d..ca1437c 100644 --- a/RemoteTerminal/Terminals/AbstractTerminal.cs +++ b/RemoteTerminal/Terminals/AbstractTerminal.cs @@ -316,30 +316,30 @@ public bool ScreenHasFocus /// public void PowerOn() { - Task.Factory.StartNew(async () => + switch (connectionData.Type) { - switch (connectionData.Type) - { - case ConnectionType.Telnet: - this.connection = new TelnetConnection(); - break; - case ConnectionType.Ssh: - this.connection = new SshConnection(); - break; - default: - break; - } + case ConnectionType.Telnet: + this.connection = new TelnetConnection(); + break; + case ConnectionType.Ssh: + this.connection = new SshConnection(); + break; + default: + break; + } - this.connection.Initialize(connectionData); - this.IsConnected = true; - this.ScreenHasFocus = true; + this.connection.Initialize(connectionData); + this.IsConnected = true; + this.ScreenHasFocus = true; - var connected = this.Connected; - if (connected != null) - { - connected.Invoke(this, new EventArgs()); - } + var connected = this.Connected; + if (connected != null) + { + connected.Invoke(this, new EventArgs()); + } + Task.Factory.StartNew(async () => + { this.screenInitWaiter.Wait(); bool successful = await this.connection.ConnectAsync(this); if (successful) From 935d07f99d390b3539aabb8425ff41d8b4d79be7 Mon Sep 17 00:00:00 2001 From: Stefan Podskubka Date: Mon, 29 May 2017 15:11:41 +0200 Subject: [PATCH 2/5] Fix terminal list immediately after active terminal is closed --- RemoteTerminal/TerminalPage.xaml.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RemoteTerminal/TerminalPage.xaml.cs b/RemoteTerminal/TerminalPage.xaml.cs index 5d3ab35..40c9601 100644 --- a/RemoteTerminal/TerminalPage.xaml.cs +++ b/RemoteTerminal/TerminalPage.xaml.cs @@ -252,6 +252,7 @@ private void PreviewGrid_ItemClick(object sender, ItemClickEventArgs e) private void PreviewGrid_ItemCloseButtonClick(object sender, RoutedEventArgs e) { ITerminal terminal = ((Button)sender).Tag as ITerminal; + TerminalManager.Remove(terminal); if (this.Terminal == terminal) { var switchToTerminal = TerminalManager.Terminals.Where(t => t != terminal).FirstOrDefault(); @@ -264,8 +265,6 @@ private void PreviewGrid_ItemCloseButtonClick(object sender, RoutedEventArgs e) this.Terminal = switchToTerminal; } } - - TerminalManager.Remove(terminal); } /// From 3a22430254adf6c2bbab41b6b8936c3e6b1d4a48 Mon Sep 17 00:00:00 2001 From: Stefan Podskubka Date: Mon, 29 May 2017 15:14:31 +0200 Subject: [PATCH 3/5] Bump version number --- RemoteTerminal/Package.appxmanifest | 2 +- RemoteTerminal/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RemoteTerminal/Package.appxmanifest b/RemoteTerminal/Package.appxmanifest index 8d480b4..4f79763 100644 --- a/RemoteTerminal/Package.appxmanifest +++ b/RemoteTerminal/Package.appxmanifest @@ -1,6 +1,6 @@  - + Remote Terminal Stefan Podskubka diff --git a/RemoteTerminal/Properties/AssemblyInfo.cs b/RemoteTerminal/Properties/AssemblyInfo.cs index 0871453..7662c9a 100644 --- a/RemoteTerminal/Properties/AssemblyInfo.cs +++ b/RemoteTerminal/Properties/AssemblyInfo.cs @@ -23,6 +23,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.9.0.22")] -[assembly: AssemblyFileVersion("1.9.0.22")] +[assembly: AssemblyVersion("1.9.1.23")] +[assembly: AssemblyFileVersion("1.9.1.23")] [assembly: ComVisible(false)] \ No newline at end of file From fdd8e5edc3782c8cf1ab14e5aff778b607a1df0a Mon Sep 17 00:00:00 2001 From: Stefan Podskubka Date: Mon, 29 May 2017 15:27:59 +0200 Subject: [PATCH 4/5] Update changelog --- RemoteTerminal/ChangelogManager.cs | 3 ++- RemoteTerminal/Changelogs/1.9.1.htm | 9 +++++++++ RemoteTerminal/RemoteTerminal.csproj | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 RemoteTerminal/Changelogs/1.9.1.htm diff --git a/RemoteTerminal/ChangelogManager.cs b/RemoteTerminal/ChangelogManager.cs index 50ad173..78380ec 100644 --- a/RemoteTerminal/ChangelogManager.cs +++ b/RemoteTerminal/ChangelogManager.cs @@ -26,7 +26,7 @@ public static class ChangelogManager /// /// The version of the most current changelog. /// - private const string CurrentVersion = "1.9.0"; + private const string CurrentVersion = "1.9.1"; /// /// The name of the setting containing the last read changelog version. @@ -40,6 +40,7 @@ public static class ChangelogManager private static readonly string[] Versions = new[] { CurrentVersion, + "1.9.0", "1.8.2", }; diff --git a/RemoteTerminal/Changelogs/1.9.1.htm b/RemoteTerminal/Changelogs/1.9.1.htm new file mode 100644 index 0000000..2f0656d --- /dev/null +++ b/RemoteTerminal/Changelogs/1.9.1.htm @@ -0,0 +1,9 @@ +

1.9.1 (2017-05-29)

+

+ Fixed a regression with private key authentication +

+

+ Since 1.9.0 private key authentication did not work because of a threading issue.
+ The terminal just got stuck at a blank screen with a red border.
+ Password and Private Key Agent authentication was not affected by this bug. +

diff --git a/RemoteTerminal/RemoteTerminal.csproj b/RemoteTerminal/RemoteTerminal.csproj index 2bcaffa..f86cce3 100644 --- a/RemoteTerminal/RemoteTerminal.csproj +++ b/RemoteTerminal/RemoteTerminal.csproj @@ -199,6 +199,7 @@ + Designer From 50368cf9f9c3266c74bdda3564b5905b130b4328 Mon Sep 17 00:00:00 2001 From: Stefan Podskubka Date: Mon, 29 May 2017 15:34:09 +0200 Subject: [PATCH 5/5] Fix changelog construction --- RemoteTerminal/ChangelogManager.cs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/RemoteTerminal/ChangelogManager.cs b/RemoteTerminal/ChangelogManager.cs index 78380ec..2e9ba21 100644 --- a/RemoteTerminal/ChangelogManager.cs +++ b/RemoteTerminal/ChangelogManager.cs @@ -34,12 +34,11 @@ public static class ChangelogManager private const string LastReadChangelogSettingName = "LastReadChangelog"; /// - /// This array contains, in reverse order, all versions of the app for which a changelog is available. + /// This array contains, in reverse order, all previous versions of the app for which a changelog is available. /// - /// The first entry should always be . - private static readonly string[] Versions = new[] + /// must not be included in this list. + private static readonly string[] PreviousVersions = new[] { - CurrentVersion, "1.9.0", "1.8.2", }; @@ -71,14 +70,18 @@ public static string ProduceChangelog() changelog.Append(ReadHtmlFile("head") .Replace("{CurrentVersion}", CurrentVersion)); - foreach (string version in Versions) + changelog.Append(ReadHtmlFile(CurrentVersion)); + if (CurrentVersion != lastReadChangelog) { - if (version == lastReadChangelog) + foreach (string version in PreviousVersions) { - break; - } + if (version == lastReadChangelog) + { + break; + } - changelog.Append(ReadHtmlFile(version)); + changelog.Append(ReadHtmlFile(version)); + } } changelog.Append(ReadHtmlFile("tail"));