update to threading server

This commit is contained in:
Skillet 2023-09-07 20:00:12 -04:00
parent 1191154d5a
commit 1747e55549

View File

@ -46,7 +46,7 @@ class serveRA(http.server.SimpleHTTPRequestHandler):
for congrp in confgrps:
responsetext = re.sub(rf"^Group=({congrp[0]}):(.+)", rf"Group=\1:{congrp[1]}", responsetext, flags=re.M)
self.wfile.write(responsetext.encode('utf-8'))
backupfile = open(f"./wlgrps/backup-{grpName}.cfg", 'wb')
with open(f"./wlgrps/backup-{grpName}.cfg", 'wb') as backupfile:
backupfile.write(responsetext.encode('utf-8'))
backupfile.close()
else:
@ -70,7 +70,7 @@ def startServer():
while True:
print("trying to start...")
try:
with socketserver.TCPServer(("", PORT), handler) as httpd:
with socketserver.ThreadingTCPServer(("", PORT), handler) as httpd:
print('starting server!')
httpd.serve_forever()
except: