Skip to content

Commit

Permalink
fix: move setting no sigpipe to right place (#7313)
Browse files Browse the repository at this point in the history
It should be done on the client, rather than server fd

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg authored Mar 14, 2023
1 parent 7e27809 commit 736279c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/csexp_rpc/csexp_rpc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ module Server = struct
if inter then None
else if accept then (
let fd, _ = Unix.accept ~cloexec:true t.fd in
Socket.maybe_set_nosigpipe fd;
Unix.clear_nonblock fd;
Some fd)
else assert false
Expand Down Expand Up @@ -332,7 +333,6 @@ module Server = struct
Worker.task async ~f:(fun () ->
Transport.accept transport
|> Option.map ~f:(fun client ->
Socket.maybe_set_nosigpipe fd;
let in_ = Unix.in_channel_of_descr client in
let out = Unix.out_channel_of_descr client in
(in_, out)))
Expand Down

0 comments on commit 736279c

Please sign in to comment.