Fix bug when reloading squid
This commit is contained in:
parent
acaa217314
commit
e499cb87a0
@ -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
|
Loading…
Reference in New Issue
Block a user