Skip to content

Commit

Permalink
Fix Threading Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBrokenRail committed Feb 18, 2021
1 parent 5e625ba commit af94a84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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);
Expand Down

0 comments on commit af94a84

Please sign in to comment.