fix: compat pre 4.05

This commit is contained in:
Simon Cruanes 2019-11-17 10:30:23 -06:00
parent f6efa9b703
commit 2e66a92e68

View file

@ -9,11 +9,12 @@ exception Bad_req of int * string
let bad_reqf c fmt = Printf.ksprintf (fun s ->raise (Bad_req (c,s))) fmt let bad_reqf c fmt = Printf.ksprintf (fun s ->raise (Bad_req (c,s))) fmt
let debug_ k = let debug_ k =
if None<>Sys.getenv_opt "HTTP_DBG" then ( match Sys.getenv "HTTP_DBG" with
k (fun fmt -> | _ ->
Printf.fprintf stdout "[thread %d]: " Thread.(id @@ self()); k (fun fmt->
Printf.kfprintf (fun oc -> Printf.fprintf oc "\n%!") stdout fmt) Printf.fprintf stdout "[thread %d]: " Thread.(id @@ self());
) Printf.kfprintf (fun oc -> Printf.fprintf oc "\n%!") stdout fmt)
| exception _ -> ()
module Response_code = struct module Response_code = struct
type t = int type t = int