Skip to content

Commit b03d83e

Browse files
committed
Cleanup
1 parent a1e72e6 commit b03d83e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ internal class NativeHttpHandlerCore : IDisposable
2121

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

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

3534
public unsafe NativeHttpHandlerCore(NativeClientSettings settings)
3635
{
37-
_settings = settings;
38-
3936
var runtimeHandle = NativeRuntime.Instance.Acquire(); // NOTE: We need to call Release on finalizer.
4037
var instanceId = Interlocked.Increment(ref _instanceId);
4138

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

421-
var onServerCertificateVerification = (ServerCertificateVerificationHandler)GCHandle.FromIntPtr(callbackState).Target;
418+
var onServerCertificateVerification = (ServerCertificateVerificationHandler?)GCHandle.FromIntPtr(callbackState).Target;
422419
Debug.Assert(onServerCertificateVerification != null);
423420
if (onServerCertificateVerification == null)
424421
{

0 commit comments

Comments
 (0)