Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Limit matched node result set to prevent unbounded memory use (requir…

…es chicken-doc 0.4.4); bump to 0.10.1
  • Loading branch information...
commit f09d3471b08f8948cd1abb74de3ae4e22d2396e3 1 parent bdb9554
@ursetto authored
View
4 chickadee-config-nginx.scm
@@ -33,8 +33,8 @@
(cache-bust "chickadee-jquery.js")
(cache-bust "prettify-bundle.js")))
-(maximum-match-results 250)
-(maximum-match-signatures 100)
+(maximum-match-results 150)
+(maximum-match-signatures 150)
(incremental-search 15)
(incremental-search-delay 50)
(cache-nodes-for 600)
View
2  chickadee-config.scm
@@ -34,7 +34,7 @@
))
(maximum-match-results 250)
-(maximum-match-signatures 100)
+(maximum-match-signatures 250)
(incremental-search 15)
(incremental-search-delay 50)
(cache-nodes-for 300)
View
2  chickadee.meta
@@ -8,7 +8,7 @@
(doc-from-wiki)
(needs matchable uri-common intarweb
(spiffy 4.8) spiffy-request-vars
- (chicken-doc 0.4.0)
+ (chicken-doc 0.4.4)
sxml-transforms uri-generic (chicken-doc-admin 0.4.0)
(chicken-doc-html 0.2.5))
(files "chickadee-cmd.scm" "chickadee-config.scm" "chickadee-driver-3e8.scm" "chickadee.setup" "chickadee.release-info" "jquery.metadata.min.js" "chickadee.meta" "mag.png" "chickadee.js" "chickadee.scm" "chickadee-config-nginx.scm" "install.sh" "chickadee-jquery.js" "chickadee.css" "chickadee-driver.scm"))
View
10 chickadee.scm
@@ -109,7 +109,7 @@
(value "Regexp"))))))
(define (format-id x)
- (match (match-nodes x)
+ (match (match-nodes x (maximum-match-results))
((n1)
(redirect-to (path->href (node-path n1))))
(()
@@ -122,9 +122,11 @@
(match-page nodes x))))
(define (format-re x)
- (match-page (match-nodes (irregex x)) x))
+ (match-page (match-nodes (irregex x) (maximum-match-results))
+ x))
(define (format-path-re x)
- (match-page (match-node-paths/re (irregex x)) x))
+ (match-page (match-node-paths/re (irregex x) (maximum-match-results))
+ x))
(define (match-page nodes match-text)
(let ((max-results (maximum-match-results))
@@ -138,6 +140,8 @@
(lambda ()
(node-page
`("query " ,match-text " ("
+ ;; Exceeding match-results can't happen because we cap the
+ ;; result length now, but we keep the logic in place anyway
,(maybe (> result-length max-results)
`(,max-results " of "))
,result-length " matches)")
View
2  chickadee.setup
@@ -1,6 +1,6 @@
;; -*- scheme -*-
-(define +version+ "0.10.0")
+(define +version+ "0.10.1")
(compile -s -O2 -d1 -S chickadee.scm -j chickadee)
(compile -s -O2 -d0 chickadee.import.scm)
Please sign in to comment.
Something went wrong with that request. Please try again.