Skip to content

Commit

Permalink
不缓存cdn列表里的域名
Browse files Browse the repository at this point in the history
  • Loading branch information
bieberg0n committed Mar 6, 2016
1 parent 0d93b3d commit f8f602a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions bjdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,22 @@ def eva(data, client, server):
print('cache', name, ip)
server.sendto(make_data(data, ip), client)

else:
if [ 1 for i in cdn_list if name.endswith(i) or name == i[1:] ]:
print('cdn', name)
# server.sendto(get_data(data,cdn=1), client)
res = get_data(data,cdn=1)
server.sendto(res, client)
elif [ 1 for i in cdn_list if name.endswith(i) or name == i[1:] ]:
print('cdn', name)
# server.sendto(get_data(data,cdn=1), client)
res = get_data(data,cdn=1)
server.sendto(res, client)
if name == 'rss.bjgong.tk':
ip = get_ip(res, len(data))
cache[name] = ip

else:

# res = get_data_by_tcp(data)
else:
# else:
# res = get_data(data)
ip = get_ip_by_openshift(name)
server.sendto(make_data(data,ip), client)
ip = get_ip_by_openshift(name)
server.sendto(make_data(data,ip), client)

# ip = unpack('BBBB',data[32+len(name):36+len(name)])
# ip = '.'.join( [ str(i) for i in ip ] )
Expand Down

0 comments on commit f8f602a

Please sign in to comment.