minor update regarding DNS data retrieval task

This commit is contained in:
Miroslav Stampar
2012-04-02 12:22:40 +00:00
parent f7a664b120
commit abffc39929
5 changed files with 35 additions and 11 deletions

View File

@@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
"""
import os
import re
import socket
import threading
import time
@@ -63,6 +64,16 @@ class DNSServer:
retVal = self._requests.pop(0)
return retVal
def pop(self, prefix, suffix):
retVal = None
with self._lock:
for _ in self._requests:
if re.search("%s\..+\.%s" % (prefix, suffix), _, re.I):
retVal = _
self._requests.remove(_)
break
return retVal
def run(self):
def _():
try: