[Pkg-privacy-commits] [obfsproxy] 260/353: Use inet_ntop/inet_pton from twisted.python.compat instead of the socket

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:02:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository obfsproxy.

commit e86ff88bb993dc1a927bf243a419bbdf275d71c0
Author: Yawning Angel <yawning at schwanenlied.me>
Date:   Sun Mar 9 23:59:47 2014 +0000

    Use inet_ntop/inet_pton from twisted.python.compat instead of the socket
    
    Apparently, these routines are missing on Windows.
---
 obfsproxy/network/socks5.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/obfsproxy/network/socks5.py b/obfsproxy/network/socks5.py
index ccadb48..52ac82f 100644
--- a/obfsproxy/network/socks5.py
+++ b/obfsproxy/network/socks5.py
@@ -1,4 +1,5 @@
 from twisted.internet import reactor, protocol, error
+from twisted.python import compat
 
 import obfsproxy.common.log as logging
 
@@ -89,7 +90,7 @@ class SOCKSv5Outgoing(protocol.Protocol):
         host = self.transport.getHost()
         port = host.port
         af = socket.getaddrinfo(host.host, port, 0, socket.SOCK_STREAM, socket.IPPROTO_TCP, socket.AI_NUMERICHOST | socket.AI_NUMERICSERV)[0][0]
-        raw_addr = socket.inet_pton(af, host.host)
+        raw_addr = compat.inet_pton(af, host.host)
         if af == socket.AF_INET:
             atype = _SOCKS_ATYP_IP_V4
         elif af == socket.AF_INET6:
@@ -356,7 +357,7 @@ class SOCKSv5Protocol(protocol.Protocol):
             if len(msg) < 16:
                 return
             try:
-                addr = socket.inet_ntop(socket.AF_INET6, str(msg.get(16)))
+                addr = compat.inet_ntop(socket.AF_INET6, str(msg.get(16)))
             except:
                 log.error("Failed to parse IPv6 address")
                 self.sendReply(SOCKSv5Reply.AddressTypeNotSupported)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git



More information about the Pkg-privacy-commits mailing list