Skip to content

Commit

Permalink
catch socket.error and gevent.error as well
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekziade committed Aug 2, 2017
1 parent 9e94285 commit 59be75e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vaurien/proxy.py
@@ -1,10 +1,11 @@
import gevent
import random
from uuid import uuid4
from socket import error

from gevent.server import StreamServer
from gevent.socket import create_connection
from gevent.select import select, error
from gevent.select import select, error as gerror

from vaurien.util import parse_address, get_prefixed_sections, extract_settings
from vaurien.protocols import get_protocols
Expand Down Expand Up @@ -104,7 +105,7 @@ def handle(self, client_sock, address):
res = select([client_sock, backend_sock], [], [],
timeout=self.timeout)
rlist = res[0]
except error:
except (error, gerror):
backend_sock.close()
backend_sock._closed = True
break
Expand Down

0 comments on commit 59be75e

Please sign in to comment.