"Martin v. L?wis" <loewis@users.sourceforge.net> writes: > Update of /cvsroot/python/python/dist/src/Lib > In directory usw-pr-cvs1:/tmp/cvs-serv11791 > > Modified Files: > BaseHTTPServer.py SocketServer.py ftplib.py httplib.py > poplib.py smtplib.py telnetlib.py > Log Message: > Patch #401196: Use getaddrinfo and AF_INET6 in TCP servers and clients. > ! for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): > ! af, socktype, proto, canonname, sa = res > ! try: > ! self.sock = socket.socket(af, socktype, proto) > ! self.sock.connect(sa) > ! except socket.error, msg: > ! self.sock.close() > ! self.sock = None > ! continue > ! break > ! if not self.sock: > ! raise socket.error, msg > ! for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE): > ! af, socktype, proto, canonname, sa = res > ! try: > ! sock = socket.socket(af, socktype, proto) > ! sock.bind(sa) > ! except socket.error, msg: > ! sock.close() > ! sock = None > ! continue > ! break > ! if not sock: > ! raise socket.error, msg > ! for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): > ! af, socktype, proto, canonname, sa = res > ! try: > ! self.sock = socket.socket(af, socktype, proto) > ! if self.debuglevel > 0: > ! print "connect: (%s, %s)" % (self.host, self.port) > ! self.sock.connect(sa) > ! except socket.error, msg: > ! if self.debuglevel > 0: > ! print 'connect fail:', (self.host, self.port) > ! self.sock.close() > ! self.sock = None > ! continue > ! break > ! if not self.sock: > ! raise socket.error, msg > ! for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): > ! af, socktype, proto, canonname, sa = res > ! try: > ! self.sock = socket.socket(af, socktype, proto) > ! self.sock.connect(sa) > ! except socket.error, msg: > ! self.sock.close() > ! self.sock = None > ! continue > ! break > ! if not self.sock: > ! raise socket.error, msg > ! for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): > ! af, socktype, proto, canonname, sa = res > ! try: > ! self.sock = socket.socket(af, socktype, proto) > ! if self.debuglevel > 0: print 'connect:', (host, port) > ! self.sock.connect(sa) > ! except socket.error, msg: > ! if self.debuglevel > 0: print 'connect fail:', (host, port) > ! self.sock.close() > ! self.sock = None > ! continue > ! break > ! if not self.sock: > ! raise socket.error, msg > ! for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): > ! af, socktype, proto, canonname, sa = res > ! try: > ! self.sock = socket.socket(af, socktype, proto) > ! self.sock.connect(sa) > ! except socket.error, msg: > ! self.sock.close() > ! self.sock = None > ! continue > ! break > ! if not self.sock: > ! raise socket.error, msg Excuse my ignorance, but: A case for refactoring? Also this patch introduced some hard tabs, but I guess Tim'll beat these to death with reindent.py at some point... Cheers, M.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4