Fix bug when reloading squid

This commit is contained in:
Paul 2016-02-20 15:41:30 +01:00
parent acaa217314
commit e499cb87a0

View File

@ -3,6 +3,7 @@
import sys import sys
import os import os
import re import re
import time
from urlparse import urlparse from urlparse import urlparse
try: try:
@ -78,11 +79,13 @@ bl = PySquidBlacklists(config)
while True: while True:
try: try:
line = sys.stdin.readline().strip() line = sys.stdin.readline().strip()
if line == "":
exit()
outline = urlparse(line).netloc outline = urlparse(line).netloc
if line: if line:
if bl.compare(outline): if bl.compare(outline):
bl.response("OK") bl.response("OK")
else: else:
bl.response("ERR") bl.response("ERR")
except KeyboardInterrupt: except IOError:
break pass