Made HTTP server multithreaded.

pull/7/head
Ferry Boender 10 years ago
parent 85a4f019c8
commit 56d4d12d1f
  1. 7
      src/scriptform.py

@ -7,6 +7,7 @@ import stat
import json import json
import BaseHTTPServer import BaseHTTPServer
from BaseHTTPServer import BaseHTTPRequestHandler from BaseHTTPServer import BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import cgi import cgi
import re import re
import datetime import datetime
@ -197,13 +198,15 @@ class FormDefinition:
return value return value
class ThreadedHTTPServer(ThreadingMixIn, BaseHTTPServer.HTTPServer):
pass
class WebSrv: class WebSrv:
""" """
Very basic web server. Very basic web server.
""" """
def __init__(self, request_handler, listen_addr='', listen_port=80): def __init__(self, request_handler, listen_addr='', listen_port=80):
httpd = BaseHTTPServer.HTTPServer((listen_addr, listen_port), httpd = ThreadedHTTPServer((listen_addr, listen_port), request_handler)
request_handler)
httpd.serve_forever() httpd.serve_forever()

Loading…
Cancel
Save