todvora / eet-client

Client and library for #EET communication - http://www.etrzby.cz/ , written in Java
MIT License
48 stars 26 forks source link

Crl download is not parallel #17

Closed pustypawel closed 7 years ago

pustypawel commented 7 years ago

Hello, InMemoryCRLStore is not download crl's parallel becouse of synchronization on getCRL method. Proposition of fix: private static final Map<URI, X509CRL> CACHE = new HashMap<URI, X509CRL>(); into private static final Map<URI, X509CRL> CACHE = new ConcurrentHashMap<URI, X509CRL>();

private synchronized X509CRL getCRL into private X509CRL getCRL

Should fix that.

todvora commented 7 years ago

Hi @pustypawel, You are right, the code doesn't do, what promised. Thank you for noticing that!

I just fixed this issue in release 2.1.4. The ConcurrentHashMap alone unfortunately doesn't prevent duplicate downloads in an environment with several clients accessing CRLs. To keep the net traffic low and do not download one CRL several times I made the method getCRLStore synchronized.

Let me know if everything works for you, please.

Thanks and best regards, Tomas