Skip to content

Commit

Permalink
chore: rename var for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Feb 6, 2024
1 parent 765bf91 commit dee2f88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/CommonLib/LDAPUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private static readonly ConcurrentDictionary<string, ResolvedWellKnownPrincipal>
private readonly ConcurrentDictionary<string, string> _netbiosCache = new();
private readonly PortScanner _portScanner;
private LDAPConfig _ldapConfig = new();
private readonly ManualResetEvent _manualResetEvent = new(false);
private readonly ManualResetEvent _connectionResetEvent = new(false);


/// <summary>
Expand Down Expand Up @@ -886,7 +886,7 @@ public IEnumerable<ISearchResultEntry> QueryLDAP(string ldapFilter, SearchScope
retryCount++;

//If we are the holders of the reset event, we need to do logic to reset the connection
if (_manualResetEvent.Reset())
if (_connectionResetEvent.Reset())
{
try
{
Expand All @@ -906,13 +906,13 @@ public IEnumerable<ISearchResultEntry> QueryLDAP(string ldapFilter, SearchScope
}
finally
{
_manualResetEvent.Set();
_connectionResetEvent.Set();
}
}
else
{
//If someone else is holding the reset event, we want to just wait and then pull the newly created connection out of the cache
_manualResetEvent.WaitOne();
_connectionResetEvent.WaitOne();
conn = CreateNewConnection(domainName, globalCatalog);
}

Expand Down

0 comments on commit dee2f88

Please sign in to comment.