Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #871: v6only.diff

  • cherrypy/wsgiserver/__init__.py

    old new  
    14341434            ctx.use_certificate_file(self.ssl_certificate) 
    14351435            self.socket = SSLConnection(ctx, self.socket) 
    14361436            self.populate_ssl_environ() 
     1437        if hasattr(socket, "IPV6_V6ONLY") and \ 
     1438           family == socket.AF_INET6 and \ 
     1439           self.bind_addr[0] == '::': 
     1440            # If the app is listening on the V6 any address, 
     1441            # activate dual-stack. 
     1442            try: 
     1443                self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0) 
     1444            except socket.error: 
     1445                # Apparently, the socket option is not available in 
     1446                # this machine's TCP stack 
     1447                pass 
    14371448        self.socket.bind(self.bind_addr) 
    14381449     
    14391450    def tick(self): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets