Skip to content

Commit

Permalink
CA-289145: close socket if error occurs when using lwt connect
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Qian <yang.qian@citrix.com>
  • Loading branch information
krizex committed May 21, 2018
1 parent d48fe35 commit 9801af1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lwt/protocol_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ module M = struct
| Unix.Unix_error((Unix.ECONNREFUSED | Unix.ECONNABORTED | Unix.ENOENT), _, _) ->
Lwt_unix.sleep 5. >>= fun () ->
loop ()
| e -> fail e
| e ->
Lwt_unix.close fd;
fail e
) in
loop ()

Expand Down

0 comments on commit 9801af1

Please sign in to comment.