Skip to content

Commit

Permalink
fix error for ipv4 bind addr
Browse files Browse the repository at this point in the history
  • Loading branch information
fuktommy committed Feb 14, 2024
1 parent 0436419 commit 43b4611
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions shingetsu/LightCGIHTTPServer.py
Expand Up @@ -29,7 +29,6 @@
import copy
import os
import re
import socket
import sys
import urllib.parse
import http.server
Expand Down Expand Up @@ -269,4 +268,4 @@ def copyfile(self, source, outputfile):


class HTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
address_family = socket.AF_INET6
pass
9 changes: 4 additions & 5 deletions shingetsu/httpd.py
@@ -1,7 +1,7 @@
'''Tiny HTTP server running in another thread.
'''
#
# Copyright (c) 2005-2023 shinGETsu Project.
# Copyright (c) 2005-2024 shinGETsu Project.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand All @@ -25,17 +25,14 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Id$
#

import os
import socket
import threading

from . import config
from . import LightCGIHTTPServer

__version__ = "$Revision$"


class Httpd(threading.Thread):

Expand All @@ -48,6 +45,8 @@ def __init__(self):
HandlerClass = LightCGIHTTPServer.HTTPRequestHandler

ServerClass = LightCGIHTTPServer.HTTPServer
if not config.bind_addr or ':' in config.bind_addr:
ServerClass.address_family = socket.AF_INET6
server_address = (config.bind_addr, config.port)
HandlerClass.server_version = config.version
HandlerClass.root_index = config.root_index
Expand Down

0 comments on commit 43b4611

Please sign in to comment.