mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-23 15:54:24 +03:00
Minor bug fix (for cases when race between thread and main thread is causing server._running to not be set to True)
This commit is contained in:
parent
cb1f17cb04
commit
36f3ab5798
|
@ -65,6 +65,7 @@ class DNSServer(object):
|
|||
self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self._socket.bind(("", 53))
|
||||
self._running = False
|
||||
self._initialized = False
|
||||
|
||||
def pop(self, prefix=None, suffix=None):
|
||||
"""
|
||||
|
@ -91,6 +92,7 @@ class DNSServer(object):
|
|||
def _():
|
||||
try:
|
||||
self._running = True
|
||||
self._initialized = True
|
||||
|
||||
while True:
|
||||
data, addr = self._socket.recvfrom(1024)
|
||||
|
@ -116,6 +118,9 @@ if __name__ == "__main__":
|
|||
server = DNSServer()
|
||||
server.run()
|
||||
|
||||
while not server._initialized:
|
||||
time.sleep(0.1)
|
||||
|
||||
while server._running:
|
||||
while True:
|
||||
_ = server.pop()
|
||||
|
|
Loading…
Reference in New Issue
Block a user