diff --git a/collects/web-server/configuration/configuration-table.ss b/collects/web-server/configuration/configuration-table.ss index 852c74fcae..fbf5652e7c 100644 --- a/collects/web-server/configuration/configuration-table.ss +++ b/collects/web-server/configuration/configuration-table.ss @@ -8,7 +8,11 @@ [read-configuration-table (path-string? . -> . configuration-table?)] [write-configuration-table (configuration-table? path-string? . -> . void)] [configuration-table->sexpr (configuration-table? . -> . list?)] - [sexpr->configuration-table (list? . -> . configuration-table?)]) + [sexpr->configuration-table (list? . -> . configuration-table?)] + [default-configuration-table-path path?]) + + (define default-configuration-table-path + (build-path (collection-path "web-server") "default-web-root" "configuration-table.ss")) (define (get-binding key bindings default) (first (get-binding* key bindings (list default)))) @@ -85,13 +89,13 @@ (define (configuration-table->sexpr new) `((port ,(configuration-table-port new)) - (max-waiting ,(configuration-table-max-waiting new)) - (initial-connection-timeout ,(configuration-table-initial-connection-timeout new)) - (default-host-table - ,(host-table->sexpr (configuration-table-default-host new))) - (virtual-host-table - . ,(map (lambda (h) (list (car h) (host-table->sexpr (cdr h)))) - (configuration-table-virtual-hosts new))))) + (max-waiting ,(configuration-table-max-waiting new)) + (initial-connection-timeout ,(configuration-table-initial-connection-timeout new)) + (default-host-table + ,(host-table->sexpr (configuration-table-default-host new))) + (virtual-host-table + . ,(map (lambda (h) (list (car h) (host-table->sexpr (cdr h)))) + (configuration-table-virtual-hosts new))))) ; write-configuration-table : configuration-table path -> void ; writes out the new configuration file diff --git a/collects/web-server/docs/reference/configuration.scrbl b/collects/web-server/docs/reference/configuration.scrbl index c2f3fc7493..577a89e680 100644 --- a/collects/web-server/docs/reference/configuration.scrbl +++ b/collects/web-server/docs/reference/configuration.scrbl @@ -83,6 +83,8 @@ the configuration table S-expression file format described in reading, writing, parsing, and printing @scheme[configuration-table] structures. +@defthing[default-configuration-table-path path?]{The default configuration table S-expression file.} + @defproc[(sexpr->configuration-table (sexpr list?)) configuration-table?]{ This function converts a @scheme[configuration-table] from an S-expression. @@ -152,7 +154,6 @@ This function writes a @scheme[configuration-table] to @scheme[path]. of @file{dispatchers/dispatch-servlets.ss} and @file{dispatchers/dispatch-lang.ss}. @; XXX Define make-servlet-namespace? - @; XXX Use actual keyword argument syntax @defproc[(make-make-servlet-namespace (#:to-be-copied-module-specs to-be-copied-module-specs (listof module-spec?))) diff --git a/collects/web-server/docs/reference/web-config-unit.scrbl b/collects/web-server/docs/reference/web-config-unit.scrbl index db63f16b0f..f0f11155ba 100644 --- a/collects/web-server/docs/reference/web-config-unit.scrbl +++ b/collects/web-server/docs/reference/web-config-unit.scrbl @@ -40,9 +40,6 @@ identifiers: @file{web-config-unit.ss} provides the following: -@; XXX Move to configuration/configuration-table.ss ? -@defthing[default-configuration-table-path path?]{The default configuration table.} - @defproc[(configuration-table->web-config\@ [path path?] [#:port port (or/c false/c port-number?) #f] [#:listen-ip listen-ip (or/c false/c string?) #f] diff --git a/collects/web-server/private/configure.ss b/collects/web-server/private/configure.ss index 1419ded78c..d71213e658 100644 --- a/collects/web-server/private/configure.ss +++ b/collects/web-server/private/configure.ss @@ -5,8 +5,6 @@ (lib "list.ss") (lib "pretty.ss") (lib "file.ss") - (only (lib "web-config-unit.ss" "web-server") - default-configuration-table-path) (lib "configuration-table-structs.ss" "web-server" "configuration") (lib "configuration-table.ss" "web-server" "configuration") (lib "util.ss" "web-server" "private")) diff --git a/collects/web-server/private/launch.ss b/collects/web-server/private/launch.ss index e3d2ec0ab8..3d3ad613d1 100644 --- a/collects/web-server/private/launch.ss +++ b/collects/web-server/private/launch.ss @@ -3,7 +3,7 @@ (lib "pregexp.ss") (lib "unit.ss") (lib "tcp-sig.ss" "net")) - (require "util.ss" + (require "../configuration/configuration-table.ss" "../web-config-unit.ss" "../web-config-sig.ss" "../web-server-unit.ss" diff --git a/collects/web-server/servlet-env.ss b/collects/web-server/servlet-env.ss index 904d38bd12..9253582f85 100644 --- a/collects/web-server/servlet-env.ss +++ b/collects/web-server/servlet-env.ss @@ -2,6 +2,7 @@ (require (prefix net: (lib "sendurl.ss" "net")) (lib "unit.ss")) (require "web-server.ss" + "configuration/configuration-table.ss" "web-config-unit.ss" "web-config-sig.ss" "private/util.ss" diff --git a/collects/web-server/tests/configuration/configuration-table-test.ss b/collects/web-server/tests/configuration/configuration-table-test.ss index d62e26440c..b20cd8a756 100644 --- a/collects/web-server/tests/configuration/configuration-table-test.ss +++ b/collects/web-server/tests/configuration/configuration-table-test.ss @@ -1,8 +1,7 @@ (module configuration-table-test mzscheme (require (planet "test.ss" ("schematics" "schemeunit.plt" 2)) (lib "file.ss") - (lib "configuration-table.ss" "web-server" "configuration") - (lib "web-config-unit.ss" "web-server")) + (lib "configuration-table.ss" "web-server" "configuration")) (provide configuration-table-tests) (define configuration-table-tests diff --git a/collects/web-server/web-config-unit.ss b/collects/web-server/web-config-unit.ss index 5365b1be92..edc91d00de 100644 --- a/collects/web-server/web-config-unit.ss +++ b/collects/web-server/web-config-unit.ss @@ -1,7 +1,6 @@ (module web-config-unit mzscheme (require (lib "unit.ss") - (lib "kw.ss") - (lib "contract.ss")) + (lib "kw.ss")) (require "private/util.ss" "private/cache-table.ss" "configuration/configuration-table-structs.ss" @@ -11,11 +10,6 @@ "web-config-sig.ss") (provide configuration-table->web-config@ configuration-table-sexpr->web-config@) - (provide/contract - [default-configuration-table-path path?]) - - (define default-configuration-table-path - (build-path (collection-path "web-server") "default-web-root" "configuration-table.ss")) ; configuration-table->web-config@ : path -> configuration (define/kw (configuration-table->web-config@ table-file-name