irc: minimize possible response code
This commit is contained in:
@@ -79,7 +79,7 @@ class WorkerJob():
|
|||||||
try:
|
try:
|
||||||
sock = rocksock.Rocksock(host=srv, port=server_port, ssl=use_ssl, proxies=proxies, timeout=config.watchd.timeout)
|
sock = rocksock.Rocksock(host=srv, port=server_port, ssl=use_ssl, proxies=proxies, timeout=config.watchd.timeout)
|
||||||
sock.connect()
|
sock.connect()
|
||||||
sock.send('%s\n' % random.choice(['NICK', 'USER', 'JOIN', 'MODE', 'PART', 'INVITE', 'KNOCK', 'WHOIS', 'WHO', 'NOTICE', 'PRIVMSG', 'PING', 'QUIT']))
|
sock.send('NICK\n')
|
||||||
return sock, proto, duration, torhost, srvname, 0
|
return sock, proto, duration, torhost, srvname, 0
|
||||||
except rocksock.RocksockException as e:
|
except rocksock.RocksockException as e:
|
||||||
if config.watchd.debug:
|
if config.watchd.debug:
|
||||||
@@ -128,7 +128,7 @@ class WorkerJob():
|
|||||||
recv = sock.recv(6)
|
recv = sock.recv(6)
|
||||||
|
|
||||||
# good data
|
# good data
|
||||||
if re.match('^(:|ERROR|PING|PONG|NOTICE|\*\*\*)', recv, re.IGNORECASE):
|
if re.match('^(:|NOTICE)', recv, re.IGNORECASE):
|
||||||
duration = (time.time() - duration)
|
duration = (time.time() - duration)
|
||||||
|
|
||||||
#match = geolite2.lookup(proxy[0].split(':')[0])
|
#match = geolite2.lookup(proxy[0].split(':')[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user