Use thread-safe collection in SynologyAuthenticationHandler.

Since the SynologyAuthenticationHandler class inherits from HttpModule,
we should ensure that access to its internal collections are
thread-safe.
This commit is contained in:
Kenneth Hsu
2018-05-11 21:57:58 -07:00
parent 3967b12e6b
commit 2653791227
@@ -15,6 +15,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@@ -60,7 +61,7 @@ namespace Duplicati.Server.WebServer
/// <summary>
/// A cache of previously authenticated logins
/// </summary>
private readonly Dictionary<string, DateTime> m_logincache = new Dictionary<string, DateTime>();
private readonly ConcurrentDictionary<string, DateTime> m_logincache = new ConcurrentDictionary<string, DateTime>();
/// <summary>
/// The loca guarding the login cache