mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-09-05 17:31:03 +00:00
Update base.py
This commit is contained in:
parent
75aec1d8bf
commit
5567325620
13
base.py
13
base.py
|
@ -198,6 +198,19 @@ class Extension:
|
||||||
return extension
|
return extension
|
||||||
return None
|
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
|
@classmethod
|
||||||
def send_accept(cls, conn, method, success=True):
|
def send_accept(cls, conn, method, success=True):
|
||||||
if "tcp" in cls.protocols:
|
if "tcp" in cls.protocols:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user