From 103d8dacd481d3510dae83b7fd6305f450f637b0 Mon Sep 17 00:00:00 2001 From: 9swampy Date: Mon, 8 Jul 2024 22:13:29 +0100 Subject: [PATCH 1/4] Due to https://github.com/9swampy/Telnet/issues/79 allow skip SkipProactiveOptionNegotiation. --- PrimS.Telnet.NetStandard/Client_Config.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/PrimS.Telnet.NetStandard/Client_Config.cs b/PrimS.Telnet.NetStandard/Client_Config.cs index 4dedcf4..5e0103e 100644 --- a/PrimS.Telnet.NetStandard/Client_Config.cs +++ b/PrimS.Telnet.NetStandard/Client_Config.cs @@ -23,6 +23,11 @@ public partial class Client /// public const string Rfc854LineFeed = "\r\n"; + /// + /// Due to https://github.com/9swampy/Telnet/issues/79 allow skip SkipProactiveOptionNegotiation. + /// + public static bool SkipProactiveOptionNegotiation { get; set; } = false; + /// /// Initialises a new instance of the class. /// @@ -84,14 +89,22 @@ public Client(IByteStream byteStream, TimeSpan timeout, CancellationToken token, #if ASYNC #pragma warning disable VSTHRD002 // Avoid problematic synchronous waits // https://stackoverflow.com/questions/70964917/optimising-an-asynchronous-call-in-a-constructor-using-joinabletaskfactory-run - Task.Run(async () => await ProactiveOptionNegotiation().ConfigureAwait(false)).Wait(); + if (!SkipProactiveOptionNegotiation) + { + Task.Run(async () => await ProactiveOptionNegotiation().ConfigureAwait(false)).Wait(); + } + foreach (var option in options) { Task.Run(async () => await NegotiateOption(option.Command, option.Option).ConfigureAwait(false)).Wait(); } #pragma warning restore VSTHRD002 // Avoid problematic synchronous waits #else - ProactiveOptionNegotiation(); + if (!SkipProactiveOptionNegotiation) + { + ProactiveOptionNegotiation(); + } + foreach (var option in options) { NegotiateOption(option.Command, option.Option); @@ -142,7 +155,7 @@ internal static byte[] SuppressGoAheadBuffer #if ASYNC return ByteStream.WriteAsync(supressGoAhead, 0, supressGoAhead.Length, InternalCancellation.Token); #else - ByteStream.Write(supressGoAhead, 0, supressGoAhead.Length); + ByteStream.Write(supressGoAhead, 0, supressGoAhead.Length); #endif } From 7b12e0587408e2b49ef127608a49db34611ab53c Mon Sep 17 00:00:00 2001 From: 9swampy Date: Mon, 8 Jul 2024 22:21:09 +0100 Subject: [PATCH 2/4] Update release notes. --- Telnet.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telnet.nuspec b/Telnet.nuspec index e715471..ee3330b 100644 --- a/Telnet.nuspec +++ b/Telnet.nuspec @@ -17,7 +17,7 @@ docs\README.md - 0.12 adds a Net8.0 target and extends the Client ctor to additionally accept options to send during negotiation. + 0.13 extends the Client with a static flag SkipProactiveOptionNegotiation due to https://github.com/9swampy/Telnet/issues/79. Copyright (c) 9swampy, Telnet contributors Telnet From 2eb717b5a3e6687422b999cefc42b865b8c2ca86 Mon Sep 17 00:00:00 2001 From: 9swampy Date: Mon, 8 Jul 2024 22:39:38 +0100 Subject: [PATCH 3/4] Workaround for https://github.com/microsoft/vstest-action/issues/31 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 126fe79..594fd28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: run: msbuild $env:Solution_Name /p:Configuration=Debug /p:Platform="Any CPU" - name: Telnet.CiTests - uses: microsoft/vstest-action@v1.0.0 + uses: rusty-bender/vstest-action@main with: testAssembly: PrimS.Telnet.CiTests.dll searchFolder: ./**/bin/Debug/**/ @@ -50,7 +50,7 @@ jobs: # Can't apparently run both full fat and core test suites together.' - name: Telnet.*.CiTests - uses: microsoft/vstest-action@v1.0.0 + uses: rusty-bender/vstest-action@main with: testAssembly: PrimS.Telnet.*.CiTests.dll searchFolder: ./**/bin/Debug/**/ From 625a80301f1e00c30118e55b1dedda97294849af Mon Sep 17 00:00:00 2001 From: 9swampy Date: Mon, 8 Jul 2024 22:59:23 +0100 Subject: [PATCH 4/4] Update notes to update API Keys. --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 594fd28..c6b38ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,12 +89,14 @@ jobs: - name: Nuget pack run: nuget pack Telnet.nuspec -Version $Env:NuGetVersionV2ext - # Navigate to repo->Settings->Actions and check PUBLISH_TO_GITHUB_PACKAGES + # Navigate to https://github.com/settings/tokens and check to see if the old token has expired # https://github.com/settings/tokens to create a new classic token, permission write:packages, name & copy paste to PUBLISH_TO_GITHUB_PACKAGES + # Navigate to repo->Settings->Secrets and variables->Actions and check PUBLISH_TO_GITHUB_PACKAGES - name: Publish to GitHub run: dotnet nuget push "Telnet.$Env:NuGetVersionV2ext.nupkg" --api-key ${{ secrets.PUBLISH_TO_GITHUB_PACKAGES }} --source "https://nuget.pkg.github.com/9swampy/index.json" - # Login to Nuget 9swampy->Api Keys and regenerate, copy to NUGET_APIKEY + # Login to Nuget 9swampy->Api Keys and regenerate, copy to... + # GitHub navigate to repo->Settings->Secrets and variables->Actions and set NUGET_APIKEY - name: Publish to Nuget if: github.ref == 'refs/heads/master' run: nuget push "Telnet.$Env:NuGetVersionV2ext.nupkg" ${{ secrets.NUGET_APIKEY }} -source https://api.nuget.org/v3/index.json