From aaa35dbdebda39fb9cac66fb3dee705b6701bd9f Mon Sep 17 00:00:00 2001 From: awnuk Date: Fri, 8 Aug 2008 23:24:30 +0000 Subject: Fix for bug #453834. git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@106 c9f7a03b-bd48-0410-a16d-cbbf54688b0b --- .../src/com/netscape/ca/CertificateAuthority.java | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java b/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java index e78d2607a..151b15ccf 100644 --- a/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java +++ b/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java @@ -221,6 +221,27 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori return mPolicy.getPolicyProcessor(); } + private int getMaxNumberOfPublishingThreads() { + int maxNumberOfPublishingThreads = 0; + + if (mPublisherProcessor != null && mPublisherProcessor.enabled()) { + ILdapConnModule ldapConnModule = ldapConnModule = mPublisherProcessor.getLdapConnModule(); + if (ldapConnModule != null) { + ILdapConnFactory ldapConnFactory = ldapConnModule.getLdapConnFactory(); + if (ldapConnFactory != null) { + int maxNumberOfPublishingConnections = ldapConnFactory.maxConn(); + if (mCRLIssuePoints != null && mCRLIssuePoints.size() > 1) { + maxNumberOfPublishingThreads = maxNumberOfPublishingConnections - mCRLIssuePoints.size(); + } else { + maxNumberOfPublishingThreads = maxNumberOfPublishingConnections - 1; + } + CMS.debug("Maximum number of publishing threads = " + maxNumberOfPublishingThreads); + } + } + } + return maxNumberOfPublishingThreads; + } + /** * Initializes this CA subsystem. *

@@ -299,6 +320,8 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori // note CRL framework depends on DBS, CRYPTO and PUBLISHING // being functional. initCRL(); + + mNotify.setMaxNumberOfPublishingThreads(getMaxNumberOfPublishingThreads()); } catch (EBaseException e) { if (CMS.isPreOpMode()) return; @@ -1502,7 +1525,7 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori } } CMS.debug("CA Publishing Queue Enabled: "+enablePublishingQueue+" Priority Level: "+publishingQueuePriorityLevel); - mNotify = new ARequestNotifier(this, enablePublishingQueue, publishingQueuePriorityLevel); + mNotify = new ARequestNotifier(enablePublishingQueue, publishingQueuePriorityLevel); CMS.debug("CA notifier inited"); mPNotify = new ARequestNotifier(); CMS.debug("CA pending notifier inited"); -- cgit