mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
validate: Make the HTTP server multi-threaded
Avoids having one test blocking all other tests
This commit is contained in:
parent
49271bc721
commit
99cade5ba4
1 changed files with 5 additions and 1 deletions
|
@ -35,6 +35,8 @@ __all__ = ["RangeHTTPRequestHandler"]
|
|||
import os
|
||||
import sys
|
||||
|
||||
from socketserver import ThreadingMixIn
|
||||
|
||||
import posixpath
|
||||
import http.server
|
||||
import urllib.parse
|
||||
|
@ -47,6 +49,8 @@ import time
|
|||
|
||||
_bandwidth = 0
|
||||
|
||||
class ThreadingSimpleServer(ThreadingMixIn, http.server.HTTPServer):
|
||||
pass
|
||||
|
||||
class RangeHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
|
||||
|
||||
|
@ -280,5 +284,5 @@ def test(handler_class = RangeHTTPRequestHandler,server_class = http.server.HTTP
|
|||
http.server.test(handler_class, server_class)
|
||||
|
||||
if __name__ == "__main__":
|
||||
httpd = http.server.HTTPServer(("0.0.0.0", int(sys.argv[1])), RangeHTTPRequestHandler)
|
||||
httpd = ThreadingSimpleServer(("0.0.0.0", int(sys.argv[1])), RangeHTTPRequestHandler)
|
||||
httpd.serve_forever()
|
||||
|
|
Loading…
Reference in a new issue