]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Make response handlers global by default
authorMichał Kępień <michal@isc.org>
Tue, 25 Mar 2025 04:01:34 +0000 (05:01 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 25 Mar 2025 04:01:34 +0000 (05:01 +0100)
Instead of requiring each class inheriting from ResponseHandler to
define its match() method, make the latter non-abstract and default to
returning True for all queries.  This will reduce the amount of
boilerplate code in custom servers.

bin/tests/system/isctest/asyncserver.py

index b4270fa8999145726df467e77e6ee11658e8ea9d..996db22893ce9e71b1dc74d95aea1c7412aecda1 100644 (file)
@@ -360,10 +360,13 @@ class ResponseHandler(abc.ABC):
     method.
     """
 
-    @abc.abstractmethod
+    # pylint: disable=unused-argument
     def match(self, qctx: QueryContext) -> bool:
         """
-        Matching logic - query is handled when it returns True.
+        Matching logic - the first handler whose `match()` method returns True
+        is used for handling the query.
+
+        The default for each handler is to handle all queries.
         """
         return True