Skip to content

Commit

Permalink
code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
LSJoranVC committed Nov 24, 2023
1 parent fed4ed1 commit c67a5d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SharpPcap/LibPcap/PcapDeviceCaptureLoop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ protected virtual void CaptureThread(CancellationToken cancellationToken)
continue;
}

#pragma warning disable S3869 // "SafeHandle.DangerousGetHandle" should not be called
int res = LibPcapSafeNativeMethods.pcap_dispatch(handle, m_pcapPacketCount, Callback, handle.DangerousGetHandle());
#pragma warning restore S3869 // "SafeHandle.DangerousGetHandle" should not be called

// pcap_dispatch() returns the number of packets read or, a status value if the value
// is negative
Expand All @@ -192,7 +194,9 @@ protected virtual void CaptureThread(CancellationToken cancellationToken)
// from causing premature exiting from the capture loop we only consider
// exhausted events to cause an escape from the loop when they are from
// offline devices, ie. files read from disk
#pragma warning disable S3060
if (this is CaptureReaderDevice)
#pragma warning restore S3060
{
SendCaptureStoppedEvent(CaptureStoppedEventStatus.CompletedWithoutError);
return;
Expand Down

0 comments on commit c67a5d5

Please sign in to comment.