Skip to content

Commit

Permalink
Update shared code (dotnet#32779)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotalik authored Feb 27, 2020
1 parent e22cf55 commit 40e44e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ private static bool EncodeHeaderBlockPrefix(Span<byte> destination, out int byte
return true;
}

// TODO these are fairly hard coded for the first two bytes to be zero.
public bool BeginEncode(IEnumerable<KeyValuePair<string, string>> headers, Span<byte> buffer, out int length)
{
_enumerator = headers.GetEnumerator();
Expand All @@ -351,7 +350,11 @@ public bool BeginEncode(IEnumerable<KeyValuePair<string, string>> headers, Span<
buffer[0] = 0;
buffer[1] = 0;

return Encode(buffer.Slice(2), out length);
bool doneEncode = Encode(buffer.Slice(2), out length);

// Add two for the first two bytes.
length += 2;
return doneEncode;
}

public bool BeginEncode(int statusCode, IEnumerable<KeyValuePair<string, string>> headers, Span<byte> buffer, out int length)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

Expand Down Expand Up @@ -143,12 +143,6 @@ static MsQuicApi()

OperatingSystem ver = Environment.OSVersion;

if (ver.Platform == PlatformID.Win32NT && ver.Version < new Version(10, 0, 19041, 0))
{
IsQuicSupported = false;
return;
}

// TODO: try to initialize TLS 1.3 in SslStream.

try
Expand Down

0 comments on commit 40e44e7

Please sign in to comment.