Skip to content

Commit

Permalink
Bugfix and add :max-token-length for gxhttpd (#1260)
Browse files Browse the repository at this point in the history
Co-authored-by: Drew Crampsie <[email protected]>
  • Loading branch information
drewc and Drew Crampsie authored Aug 4, 2024
1 parent 2e4ac68 commit 3b20cdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tools/gxhttpd.ss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
;;; ensemble-supervisor-id: symbol|#f
;;; ;;; ensemble-registry: [optional] list of registry addresses
;;; ensemble-registry: (actor-address ...)
;;; ;;; max-token-length: The request handler parser buffer size
;;; max-token-length: integer
;;;----------------------------------------------------------------

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -281,8 +283,10 @@
(mux (make-mux cfg))
(request-logger (get-request-logger cfg))
(addresses (config-get! cfg listen:))
(max-token-length (: (config-get cfg max-token-length: 1024) :fixnum))
(run-httpd
(lambda ()
(set-httpd-max-token-length! max-token-length)
(parameterize ((current-http-server-config cfg))
(let (srv (apply start-http-server!
mux: mux
Expand Down Expand Up @@ -337,7 +341,7 @@
(servlets? (: (config-get cfg enable-servlets:) :boolean)))
(set! self.root root)
(set! self.cache (make-hash-table-string))
(set! self.cache-ttl (: (config-get cfg cache-ttl: 120) :real))
(set! self.cache-ttl (: (inexact (config-get cfg cache-ttl: 120)) :real))
(set! self.cache-max-size (: (config-get cfg cache-max-size: 16384) :fixnum))
(set! self.handlers (make-hash-table-string))
(when servlets?
Expand Down

0 comments on commit 3b20cdf

Please sign in to comment.