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

Changeset 1571

Show
Ignore:
Timestamp:
12/28/06 14:01:51
Author:
fumanchu
Message:

2.x backport of [1533] (Fixed serious buglet in SizeCheckWrapper? which allowed unmonitored read.)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/_cpwsgiserver.py

    r1527 r1571  
    324324            # Get the correct address family for our host (allows IPv6 addresses) 
    325325            host, port = self.bind_addr 
     326            flags = 0 
     327            if host == '': 
     328                # Despite the socket module docs, using '' does not 
     329                # allow AI_PASSIVE to work. Passing None instead 
     330                # returns '0.0.0.0' like we want. 
     331                host = None 
     332                flags = socket.AI_PASSIVE 
    326333            try: 
    327334                info = socket.getaddrinfo(host, port, socket.AF_UNSPEC, 
    328                                           socket.SOCK_STREAM
     335                                          socket.SOCK_STREAM, 0, flags
    329336            except socket.gaierror: 
    330337                # Probably a DNS issue. Assume IPv4. 
  • branches/cherrypy-2.x/cherrypy/lib/httptools.py

    r1569 r1571  
    561561     
    562562    def __iter__(self): 
    563         return self.rfile 
     563        return self 
    564564     
    565565    def next(self): 
     
    567567        self.bytes_read += len(data) 
    568568        self._check_length() 
    569 ##      Normally the next method must raise StopIteration when it 
    570 ##      fails but CP expects MaxSizeExceeded  
    571 ##        try: 
    572 ##            self._check_length() 
    573 ##        except: 
    574 ##            raise StopIteration() 
    575569        return data 
    576570 

Hosted by WebFaction

Log in as guest/cpguest to create tickets