From b03d83ef57fbc650f774159f9fe224abc897f418 Mon Sep 17 00:00:00 2001 From: Mayuki Sawatari Date: Fri, 13 Dec 2024 20:08:39 +0900 Subject: [PATCH] Cleanup --- src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs b/src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs index bb8b54a..a477fbd 100644 --- a/src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs +++ b/src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs @@ -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; @@ -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); @@ -418,7 +415,7 @@ private static unsafe bool OnServerCertificateVerification(IntPtr callbackState, var certificateDer = new ReadOnlySpan(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) {