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

Changeset 1766

Show
Ignore:
Timestamp:
10/26/07 02:04:33
Author:
fumanchu
Message:

Possible fix for #707 (EINTR errors on Ctrl-C)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/wsgiserver/__init__.py

    r1734 r1766  
    536536                    return "" 
    537537                 
    538                 errno = e.args[0] 
    539                 if is_reader and errno in socket_errors_to_ignore: 
     538                errnum = e.args[0] 
     539                if is_reader and errnum in socket_errors_to_ignore: 
    540540                    return "" 
    541                 raise socket.error(errno
     541                raise socket.error(errnum
    542542            except SSL.Error, e: 
    543543                if is_reader and e.args == (-1, 'Unexpected EOF'): 
     
    633633                    return 
    634634        except socket.error, e: 
    635             errno = e.args[0] 
    636             if errno not in socket_errors_to_ignore: 
     635            errnum = e.args[0] 
     636            if errnum not in socket_errors_to_ignore: 
    637637                if req: 
    638638                    req.simple_response("500 Internal Server Error", 
     
    10611061            return 
    10621062        except socket.error, x: 
     1063            if hasattr(errno, "EINTR") and x.args[0] == errno.EINTR: 
     1064                # I *think* this is right. EINTR should occur when a signal 
     1065                # is received during the accept() call; all docs say retry 
     1066                # the call, and I *think* I'm reading it right that Python 
     1067                # will then go ahead and poll for and handle the signal 
     1068                # elsewhere. See http://www.cherrypy.org/ticket/707. 
     1069                return 
    10631070            msg = x.args[1] 
    10641071            if msg in ("Bad file descriptor", "Socket operation on non-socket"): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets