Skip to content

Commit

Permalink
Merge branch 'release/0.13.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
9swampy committed Jul 8, 2024
2 parents ee3f809 + 625a803 commit cddb783
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ 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/**/
runInParallel: true

# 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/**/
Expand Down Expand Up @@ -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
Expand Down
19 changes: 16 additions & 3 deletions PrimS.Telnet.NetStandard/Client_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public partial class Client
/// </summary>
public const string Rfc854LineFeed = "\r\n";

/// <summary>
/// Due to https://github.com/9swampy/Telnet/issues/79 allow skip SkipProactiveOptionNegotiation.
/// </summary>
public static bool SkipProactiveOptionNegotiation { get; set; } = false;

/// <summary>
/// Initialises a new instance of the <see cref="Client"/> class.
/// </summary>
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion Telnet.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</description>
<readme>docs\README.md</readme>
<releaseNotes>
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.
</releaseNotes>
<copyright>Copyright (c) 9swampy, Telnet contributors</copyright>
<tags>Telnet</tags>
Expand Down

0 comments on commit cddb783

Please sign in to comment.