Break out of loop for sockets in wait_for when there's no data to read

This commit is contained in:
James Cammarata 2014-07-14 14:14:13 -05:00
parent d80f4cee9d
commit eb80bd1a56

View file

@ -213,7 +213,9 @@ def main():
matched = False
while 1:
data += s.recv(1024)
if re.search(search_regex, data, re.MULTILINE):
if not data:
break
elif re.search(search_regex, data, re.MULTILINE):
matched = True
break
if matched: