Skip to content
Snippets Groups Projects
Commit 53d43676 authored by David Bühler's avatar David Bühler
Browse files

[server] Removes some constraints on request naming.

parent 4da839f5
No related branches found
No related tags found
No related merge requests found
...@@ -51,10 +51,7 @@ type 'a output = (module Output with type t = 'a) ...@@ -51,10 +51,7 @@ type 'a output = (module Output with type t = 'a)
(* --- Sanity Checks --- *) (* --- Sanity Checks --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
let re_set = Str.regexp_string_case_fold "SET" let re_name = Str.regexp_case_fold "[a-zA-Z0-9._]+$"
let re_get = Str.regexp_case_fold "\\(GET\\|PRINT\\)"
let re_exec = Str.regexp_case_fold "\\(EXEC\\|COMPUTE\\)"
let re_name = Str.regexp_case_fold "[a-zA-Z0-9.]+$"
let wpage = Senv.register_warn_category "inconsistent-page" let wpage = Senv.register_warn_category "inconsistent-page"
let wkind = Senv.register_warn_category "inconsistent-kind" let wkind = Senv.register_warn_category "inconsistent-kind"
...@@ -84,15 +81,6 @@ let check_page page name = ...@@ -84,15 +81,6 @@ let check_page page name =
Senv.warning ~wkey:wkind Senv.warning ~wkey:wkind
"Request '%s' shall not be published in protocol pages" name "Request '%s' shall not be published in protocol pages" name
let check_kind kind name =
let re,key = match kind with
| `GET -> re_get , "get|print"
| `SET -> re_set , "set"
| `EXEC -> re_exec , "exec|compute"
in try ignore (Str.search_forward re name 0) with Not_found ->
Senv.warning "Request '%s' shall be named with « %s »"
name key
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
(* --- Multiple Fields Requests --- *) (* --- Multiple Fields Requests --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
...@@ -256,7 +244,6 @@ let signature ...@@ -256,7 +244,6 @@ let signature
~page ~kind ~name ~descr ?(details=[]) ?input ?output () = ~page ~kind ~name ~descr ?(details=[]) ?input ?output () =
check_name name ; check_name name ;
check_page page name ; check_page page name ;
check_kind kind name ;
let input = match input with None -> Pnone | Some d -> Pdata d in let input = match input with None -> Pnone | Some d -> Pdata d in
let output = match output with None -> Rnone | Some d -> Rdata d in let output = match output with None -> Rnone | Some d -> Rdata d in
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment