From af94a84f71dfc5dcec134e33c6184de57a132b8c Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Thu, 18 Feb 2021 14:47:28 -0500 Subject: [PATCH] Fix Threading Stuff --- proxy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy.py b/proxy.py index 572beda..2f0301d 100755 --- a/proxy.py +++ b/proxy.py @@ -46,6 +46,10 @@ def get_options(self): return self.__options; def run(self): + self.__running_lock.acquire(); + self.__running += 1; + self.__running_lock.release(); + dst_addr = ("0.0.0.0", self.__options["dst_port"]); try: proc_addr = socket.gethostbyname_ex(self.__options["src_addr"])[2][0] @@ -55,10 +59,6 @@ def run(self): src_addr = (proc_addr, self.__options["src_port"]); client_addr = None; - self.__running_lock.acquire(); - self.__running += 1; - self.__running_lock.release(); - self.__socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP); self.__socket.bind(dst_addr); self.__socket.setblocking(False);