Commit 5ce1abfa authored by Denis Bilenko's avatar Denis Bilenko

http.py: don't use _original_socket

parent d6667ccd
...@@ -5,8 +5,7 @@ from gevent.greenlet import Greenlet ...@@ -5,8 +5,7 @@ from gevent.greenlet import Greenlet
from gevent.event import Event from gevent.event import Event
from gevent.util import wrap_errors from gevent.util import wrap_errors
from gevent.timeout import Timeout from gevent.timeout import Timeout
socket = __import__('socket') import _socket as socket
from gevent.socket import _original_socket as Socket
class HTTPServer(object): class HTTPServer(object):
...@@ -41,7 +40,7 @@ class HTTPServer(object): ...@@ -41,7 +40,7 @@ class HTTPServer(object):
def make_listener(self, address, backlog=None): def make_listener(self, address, backlog=None):
if backlog is None: if backlog is None:
backlog = self.backlog backlog = self.backlog
s = Socket() s = socket.socket()
try: try:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, s.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, s.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1)
except socket.error: except socket.error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment