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 1abf10a4f6
commit 1cc9b6d90b

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: