Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuki committed Dec 13, 2024
1 parent a1e72e6 commit b03d83e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ internal class NativeHttpHandlerCore : IDisposable

//private unsafe YahaNativeContext* _ctx;
private readonly YahaContextSafeHandle _handle;
private readonly NativeClientSettings _settings;
private GCHandle? _onVerifyServerCertificateHandle; // The handle must be released in Dispose if it is allocated.
private bool _disposed = false;

Expand All @@ -34,8 +33,6 @@ internal class NativeHttpHandlerCore : IDisposable

public unsafe NativeHttpHandlerCore(NativeClientSettings settings)
{
_settings = settings;

var runtimeHandle = NativeRuntime.Instance.Acquire(); // NOTE: We need to call Release on finalizer.
var instanceId = Interlocked.Increment(ref _instanceId);

Expand Down Expand Up @@ -418,7 +415,7 @@ private static unsafe bool OnServerCertificateVerification(IntPtr callbackState,
var certificateDer = new ReadOnlySpan<byte>(certificateDerPtr, (int)certificateDerLength);
if (YahaEventSource.Log.IsEnabled()) YahaEventSource.Log.Trace($"OnServerCertificateVerification: State=0x{callbackState:X}; ServerName={serverName}; CertificateDer.Length={certificateDer.Length}; Now={now}");

var onServerCertificateVerification = (ServerCertificateVerificationHandler)GCHandle.FromIntPtr(callbackState).Target;
var onServerCertificateVerification = (ServerCertificateVerificationHandler?)GCHandle.FromIntPtr(callbackState).Target;
Debug.Assert(onServerCertificateVerification != null);
if (onServerCertificateVerification == null)
{
Expand Down

0 comments on commit b03d83e

Please sign in to comment.