Fire callbacks on render exception too
This commit is contained in:
parent
f857f88b7b
commit
d66e4eeccc
12
httpd.ml
12
httpd.ml
|
@ -397,9 +397,15 @@ let main handle_req (s, peername) =
|
|||
Queue.add resp.completion_callbacks pending_completion_callbacks;
|
||||
ignore (Lwt_stream.peek request_stream);
|
||||
|
||||
lwt () = render_resp cout req.req_version req.verb resp in
|
||||
lwt () = discard_unread_body req in
|
||||
lwt () = Lwt_io.flush cout in
|
||||
lwt () =
|
||||
try_lwt
|
||||
lwt () = render_resp cout req.req_version req.verb resp in
|
||||
lwt () = discard_unread_body req in
|
||||
Lwt_io.flush cout
|
||||
with e ->
|
||||
lwt () = fire_pending_callbacks () in
|
||||
raise_lwt e
|
||||
in
|
||||
lwt () = fire_pending_callbacks () in
|
||||
|
||||
if connection_keepalive req then request_loop () else return ()
|
||||
|
|
Loading…
Reference in New Issue