mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
fix: compat pre 4.05
This commit is contained in:
parent
f6efa9b703
commit
2e66a92e68
1 changed files with 6 additions and 5 deletions
|
|
@ -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 debug_ k =
|
||||
if None<>Sys.getenv_opt "HTTP_DBG" then (
|
||||
k (fun fmt ->
|
||||
Printf.fprintf stdout "[thread %d]: " Thread.(id @@ self());
|
||||
Printf.kfprintf (fun oc -> Printf.fprintf oc "\n%!") stdout fmt)
|
||||
)
|
||||
match Sys.getenv "HTTP_DBG" with
|
||||
| _ ->
|
||||
k (fun fmt->
|
||||
Printf.fprintf stdout "[thread %d]: " Thread.(id @@ self());
|
||||
Printf.kfprintf (fun oc -> Printf.fprintf oc "\n%!") stdout fmt)
|
||||
| exception _ -> ()
|
||||
|
||||
module Response_code = struct
|
||||
type t = int
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue