summaryrefslogtreecommitdiffstats
path: root/pki/base/common
diff options
context:
space:
mode:
authorawnuk <awnuk@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-05-31 02:21:56 +0000
committerawnuk <awnuk@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-05-31 02:21:56 +0000
commit7033eb5123fa95804edad9f4d2136597fe959e5d (patch)
tree6fc5831b9e65a5b48069516ebcc6aecc9cb8fb9c /pki/base/common
parentf05a61b11c1270155c6531d2af5982c56700520b (diff)
downloadpki-7033eb5123fa95804edad9f4d2136597fe959e5d.tar.gz
pki-7033eb5123fa95804edad9f4d2136597fe959e5d.tar.xz
pki-7033eb5123fa95804edad9f4d2136597fe959e5d.zip
Fixed bugzilla bug #482935.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@527 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/common')
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java28
1 files changed, 25 insertions, 3 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java b/pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java
index 38fb050c9..451f4d498 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java
@@ -69,6 +69,7 @@ public class SearchReqs extends CMSServlet {
private IReqParser mParser = null;
private String mFormPath = null;
private int mMaxReturns = 100;
+ private int mTimeLimits = 30; /* in seconds */
/**
* Constructs query key servlet.
@@ -106,6 +107,20 @@ public class SearchReqs extends CMSServlet {
mFormPath = "/" + mAuthority.getId() + "/" + TPL_FILE;
+ /* Server-Side time limit */
+ try {
+ int maxResults = Integer.parseInt(sc.getInitParameter("maxResults"));
+ if (maxResults < mMaxReturns)
+ mMaxReturns = maxResults;
+ } catch (Exception e) {
+ /* do nothing, just use the default if integer parsing failed */
+ }
+ try {
+ mTimeLimits = Integer.parseInt(sc.getInitParameter("timeLimits"));
+ } catch (Exception e) {
+ /* do nothing, just use the default if integer parsing failed */
+ }
+
String tmp = sc.getInitParameter(PROP_PARSER);
if (tmp != null) {
@@ -249,10 +264,17 @@ public class SearchReqs extends CMSServlet {
}
String newfilter = "(&"+requestowner_filter+filter.substring(2);
// xxx the filter includes serial number range???
- int mr = (maxResults > 0) ? maxResults : mMaxReturns;
+ if (maxResults == -1 || maxResults > mMaxReturns) {
+ CMS.debug("Resetting maximum of returned results from " + maxResults + " to " + mMaxReturns);
+ maxResults = mMaxReturns;
+ }
+ if (timeLimit == -1 || timeLimit > mTimeLimits) {
+ CMS.debug("Resetting timelimit from " + timeLimit + " to " + mTimeLimits);
+ timeLimit = mTimeLimits;
+ }
IRequestList list = (timeLimit > 0) ?
- mQueue.listRequestsByFilter(newfilter, mr, timeLimit) :
- mQueue.listRequestsByFilter(newfilter, mr);
+ mQueue.listRequestsByFilter(newfilter, maxResults, timeLimit) :
+ mQueue.listRequestsByFilter(newfilter, maxResults);
int count = 0;