]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
daemon: improve session closure readability
authorOto Šťáva <oto.stava@nic.cz>
Fri, 10 Mar 2023 12:15:16 +0000 (13:15 +0100)
committerOto Šťáva <oto.stava@nic.cz>
Fri, 17 Mar 2023 07:18:43 +0000 (08:18 +0100)
commit9d6cc0bf7f8409db06ef2d0ff61c55bfb496daa8
treefb312009a66e5478cdc40aec2c2544e8ef9a16f3
parent55a7fc96ba2cd91526c4352af8e2a8046943dd29
daemon: improve session closure readability

Until now, sessions were closed by explicitly sending `_CLOSE` events
via the `session2_event()` function to them, which I think is not
signalling the intent very well. It might look as though the session
has been/is being closed by some part of the code that contains the
`session2_event()` call and a relevant event is being fired now. This
commit introduces `session2_close()` and `session2_force_close()` inline
functions, which do the same thing, but I think the intent behind
calling them is slightly clearer.
daemon/io.c
daemon/network.c
daemon/session2.c
daemon/session2.h
daemon/worker.c