mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-13 14:30:31 -05:00
add stdlibshims + catch EBADF
This commit is contained in:
parent
91ca51ea42
commit
47d9ace8fd
3 changed files with 7 additions and 2 deletions
|
|
@ -39,8 +39,12 @@ let rec write_out ({buf;fd;_} as oc) i len =
|
|||
with Sys_blocked_io
|
||||
| Unix.Unix_error((EAGAIN|EWOULDBLOCK),_,_) ->
|
||||
write_out oc i len
|
||||
| Unix.Unix_error(EPIPE,_,_) ->
|
||||
| Unix.Unix_error((EPIPE|EBADF),_,_) ->
|
||||
raise (Sys_error "broken pipe")
|
||||
| e ->
|
||||
Printf.eprintf "unexpected exception in write_out: %s\n%!"
|
||||
(Printexc.to_string e);
|
||||
assert false
|
||||
|
||||
let rec output ({buf;pos;_} as oc) s i len =
|
||||
let buf_len = Bytes.length buf in
|
||||
|
|
|
|||
2
src/dune
2
src/dune
|
|
@ -2,6 +2,6 @@
|
|||
(library
|
||||
(name tiny_httpd)
|
||||
(public_name tiny_httpd)
|
||||
(libraries threads)
|
||||
(libraries threads stdlib-shims)
|
||||
(flags :standard -safe-string -warn-error -a+8)
|
||||
(wrapped false))
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ build: [
|
|||
]
|
||||
depends: [
|
||||
"dune" { >= "2.0" }
|
||||
"stdlib-shims"
|
||||
"base-threads"
|
||||
"ocaml" { >= "4.04.0" }
|
||||
"odoc" {with-doc}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue