Tornado update
This commit is contained in:
1 parent
1b03c7e474
commit
9c98a38604
13 files changed
+3651
-3581
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user