Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File descriptor in a signal message containing destination is closed #29

Open
kyotsumoto-sun-denshi opened this issue Aug 3, 2022 · 0 comments · May be fixed by #30
Open

File descriptor in a signal message containing destination is closed #29

kyotsumoto-sun-denshi opened this issue Aug 3, 2022 · 0 comments · May be fixed by #30

Comments

@kyotsumoto-sun-denshi
Copy link

If a D-Bus server sends a signal message containing destination and file descriptor,
OBus closes the file descriptor in the message.

https://github.com/ocaml-community/obus/blob/master/src/protocol/oBus_connection.ml#L459

match apply_filters "incoming" message active.incoming_filters with
   | None -> ...
   | Some message ->
       (* The internal dispatcher accepts only messages destined to
          the current connection: *)
       if active.name = "" || OBus_message.destination message = active.name then ignore (
         (try%lwt
           dispatch_message active message
         with exn ->
           Lwt_log.error ~section ~exn "message dispatching failed with")
         [%lwt.finally
           OBus_value.V.sequence_close (OBus_message.body message)]
       );

If a signal message doesn't contain destination, " OBus_value.V.sequence_close" is not called.
But If a signal message contains destination, " OBus_value.V.sequence_close" is called, file descriptor is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant