From 56d4d12d1fc5f03a628802ac3639b01789d837f8 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 23 Mar 2015 17:27:55 +0100 Subject: [PATCH] Made HTTP server multithreaded. --- src/scriptform.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/scriptform.py b/src/scriptform.py index ddf590b..4a5ebcc 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -7,6 +7,7 @@ import stat import json import BaseHTTPServer from BaseHTTPServer import BaseHTTPRequestHandler +from SocketServer import ThreadingMixIn import cgi import re import datetime @@ -197,13 +198,15 @@ class FormDefinition: return value +class ThreadedHTTPServer(ThreadingMixIn, BaseHTTPServer.HTTPServer): + pass + class WebSrv: """ Very basic web server. """ def __init__(self, request_handler, listen_addr='', listen_port=80): - httpd = BaseHTTPServer.HTTPServer((listen_addr, listen_port), - request_handler) + httpd = ThreadedHTTPServer((listen_addr, listen_port), request_handler) httpd.serve_forever()