From dea07785113b6d6e87bfac0722d4b59b0a8a0a3c Mon Sep 17 00:00:00 2001 From: "Bora M. Alper" Date: Tue, 13 Jun 2017 15:16:48 +0300 Subject: [PATCH] fixed checking errno in dht.py --- magneticod/magneticod/dht.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magneticod/magneticod/dht.py b/magneticod/magneticod/dht.py index 0e9ae97..199806d 100644 --- a/magneticod/magneticod/dht.py +++ b/magneticod/magneticod/dht.py @@ -80,7 +80,7 @@ class SybilNode(asyncio.DatagramProtocol): self._transport.sendto(data, addr) def error_received(self, exc: Exception) -> None: - if isinstance(exc, PermissionError) or (isinstance(exc, OSError) and errno.ENOBUFS): + if isinstance(exc, PermissionError) or (isinstance(exc, OSError) and exc.errno == errno.ENOBUFS): # This exception (EPERM errno: 1) is kernel's way of saying that "you are far too fast, chill". # It is also likely that we have received a ICMP source quench packet (meaning, that we really need to # slow down.