Skip to content

Commit

Permalink
Merge pull request XX-net#1790 from Cat7373/master
Browse files Browse the repository at this point in the history
Fix bug XX-net#1727
  • Loading branch information
xxnet committed Jan 3, 2016
2 parents ab63889 + 498ee36 commit c614da6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python27/1.0/lib/noarch/simple_http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def send_file(self, filename, mimetype):

class HTTPServer():
def __init__(self, address, handler, args=(), use_https=False, cert=""):
self.sockets = None
self.running = True
if isinstance(address, tuple):
self.server_address = [address]
Expand All @@ -256,6 +257,9 @@ def __init__(self, address, handler, args=(), use_https=False, cert=""):
#logging.info("server %s:%d started.", address[0], address[1])

def init_socket(self):
if self.sockets is not None:
self.server_close()

self.sockets = []
for addr in self.server_address:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Expand Down

0 comments on commit c614da6

Please sign in to comment.