diff options
| author | Guido van Rossum <guido@python.org> | 1999-06-15 22:25:32 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1999-06-15 22:25:32 +0000 |
| commit | bec309c482ad7ff808909b57e166bc8ec4da13d4 (patch) | |
| tree | 51d7f8b1d3e9cdad9cbf22701b12354bab865203 /Lib/SocketServer.py | |
| parent | 5ff6fdbb7b6464bb71ee0c9f69a4ce809b361b9d (diff) | |
| download | cpython-bec309c482ad7ff808909b57e166bc8ec4da13d4.tar.gz | |
Laurence Tratt notes that the accept() call in get_request() can fail,
and suggests putting a try/except around the get_request() call in
handle_request(). (All in class TCPServer.)
Diffstat (limited to 'Lib/SocketServer.py')
| -rw-r--r-- | Lib/SocketServer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index fe1402e0b2..1ede68d526 100644 --- a/Lib/SocketServer.py +++ b/Lib/SocketServer.py @@ -207,7 +207,10 @@ class TCPServer: def handle_request(self): """Handle one request, possibly blocking.""" - request, client_address = self.get_request() + try: + request, client_address = self.get_request() + except socket.error: + return if self.verify_request(request, client_address): try: self.process_request(request, client_address) |
