Update base.py

This commit is contained in:
Namhyeon Go 2024-11-12 16:10:09 +09:00 committed by GitHub
parent 75aec1d8bf
commit 5567325620
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

13
base.py
View File

@ -198,6 +198,19 @@ class Extension:
return extension
return None
@classmethod
def test_connector(cls, data):
def test(prelude, data):
return data.find(prelude) == 0
for extension in cls.extensions:
if (
extension.type == "connector"
and test(extension.prelude, data)
):
return extension
return None
@classmethod
def send_accept(cls, conn, method, success=True):
if "tcp" in cls.protocols: