Tornado update

This commit is contained in:
Ruud
2013-08-31 15:59:47 +02:00
parent 1b03c7e474
commit 9c98a38604
13 changed files with 3651 additions and 3581 deletions
+4
View File
@@ -159,6 +159,10 @@ def is_valid_ip(ip):
Supports IPv4 and IPv6.
"""
if not ip or '\x00' in ip:
# getaddrinfo resolves empty strings to localhost, and truncates
# on zero bytes.
return False
try:
res = socket.getaddrinfo(ip, 0, socket.AF_UNSPEC,
socket.SOCK_STREAM,