]> git.ipfire.org Git - thirdparty/bind9.git/commit
Run isc__nm_http_stoplistening() synchronously in netmgr
authorOndřej Surý <ondrej@sury.org>
Thu, 6 May 2021 07:03:33 +0000 (09:03 +0200)
committerEvan Hunt <each@isc.org>
Fri, 7 May 2021 21:28:32 +0000 (14:28 -0700)
commit2eae7813b608cd174cf3b9976cbd4f651e68a194
tree1a5b99e23efa354910324ca7aaf0844586fd57b4
parent5c08f977913cc41bface5c52808c96ee142e6953
Run isc__nm_http_stoplistening() synchronously in netmgr

When isc__nm_http_stoplistening() is run from inside the netmgr, we need
to make sure it's run synchronously.  This commit is just a band-aid
though, as the desired behvaior for isc_nm_stoplistening() is not always
the same:

  1. When run from outside user of the interface, the call must be
     synchronous, e.g. the calling code expects the call to really stop
     listening on the interfaces.

  2. But if there's a call from listen<proto> when listening fails,
     that needs to be scheduled to run asynchronously, because
     isc_nm_listen<proto> is being run in a paused (interlocked)
     netmgr thread and we could get stuck.

The proper solution would be to make isc_nm_stoplistening()
behave like uv_close(), i.e., to have a proper callback.
lib/isc/netmgr/http.c
lib/isc/netmgr/tlsstream.c