From e2e8010589204aa937ca4059fc0273c37a5d8bcf Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Thu, 3 Feb 2005 22:25:16 +0000 Subject: [PATCH] uniformed default values handling, now they are all in this module and consistent with optional arguments of start functions --- helm/DEVEL/ocaml-http/http_constants.ml | 12 ++++++++---- helm/DEVEL/ocaml-http/http_constants.mli | 14 ++++++++------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/helm/DEVEL/ocaml-http/http_constants.ml b/helm/DEVEL/ocaml-http/http_constants.ml index 674e2a863..3e61e0b61 100644 --- a/helm/DEVEL/ocaml-http/http_constants.ml +++ b/helm/DEVEL/ocaml-http/http_constants.ml @@ -23,8 +23,12 @@ let version = `HTTP_1_1 ;; let server_string = "OCaml HTTP Daemon" ;; let crlf = "\r\n" ;; -let default_addr = "0.0.0.0" ;; -let default_port = 80 ;; -let default_timeout = 300 ;; -let default_mode = `Fork ;; +let default_addr = "0.0.0.0" +let default_auth = None +let default_callback = fun _ _ -> () +let default_mode = `Fork +let default_port = 80 +let default_root_dir = None +let default_exn_handler = Some (fun exn outchan -> ()) +let default_timeout = Some 300 diff --git a/helm/DEVEL/ocaml-http/http_constants.mli b/helm/DEVEL/ocaml-http/http_constants.mli index c00edebb6..bf7072a1a 100644 --- a/helm/DEVEL/ocaml-http/http_constants.mli +++ b/helm/DEVEL/ocaml-http/http_constants.mli @@ -21,8 +21,6 @@ (** Constants *) -open Http_types - (** default HTTP version *) val version: Http_types.version @@ -34,8 +32,12 @@ val crlf: string (** {2 daemon default values} *) -val default_addr: string (** default listen address *) -val default_port: int (** default listen port *) -val default_timeout: int (** default callbacks timeout *) -val default_mode: daemon_mode (** default request handling mode *) +val default_addr: string +val default_auth: (string * Http_types.auth_info) option +val default_callback: Http_types.request -> out_channel -> unit +val default_mode: Http_types.daemon_mode +val default_port: int +val default_root_dir: string option +val default_exn_handler: (exn -> out_channel -> unit) option +val default_timeout: int option -- 2.39.2