mirror of
https://github.com/python/cpython.git
synced 2025-10-02 21:25:24 +00:00
[3.7] bpo-31639: Change ThreadedHTTPServer to ThreadingHTTPServer class name (GH-7195) (GH-7219)
* [3.7] bpo-31639: Change ThreadedHTTPServer to ThreadingHTTPServer class name (GH-7195). (cherry picked from commit1cee216cf3
) * Fix whatsnew entry about ThreadedHTTPServer. (GH-7220) (cherry picked from commita34e424bdb
)
This commit is contained in:
parent
d8948c5e09
commit
4f53e2ac16
3 changed files with 6 additions and 6 deletions
|
@ -33,7 +33,7 @@ handler. Code to create and run the server looks like this::
|
||||||
:attr:`server_port`. The server is accessible by the handler, typically
|
:attr:`server_port`. The server is accessible by the handler, typically
|
||||||
through the handler's :attr:`server` instance variable.
|
through the handler's :attr:`server` instance variable.
|
||||||
|
|
||||||
.. class:: ThreadedHTTPServer(server_address, RequestHandlerClass)
|
.. class:: ThreadingHTTPServer(server_address, RequestHandlerClass)
|
||||||
|
|
||||||
This class is identical to HTTPServer but uses threads to handle
|
This class is identical to HTTPServer but uses threads to handle
|
||||||
requests by using the :class:`~socketserver.ThreadingMixIn`. This
|
requests by using the :class:`~socketserver.ThreadingMixIn`. This
|
||||||
|
@ -43,7 +43,7 @@ handler. Code to create and run the server looks like this::
|
||||||
.. versionadded:: 3.7
|
.. versionadded:: 3.7
|
||||||
|
|
||||||
|
|
||||||
The :class:`HTTPServer` and :class:`ThreadedHTTPServer` must be given
|
The :class:`HTTPServer` and :class:`ThreadingHTTPServer` must be given
|
||||||
a *RequestHandlerClass* on instantiation, of which this module
|
a *RequestHandlerClass* on instantiation, of which this module
|
||||||
provides three different variants:
|
provides three different variants:
|
||||||
|
|
||||||
|
|
|
@ -929,7 +929,7 @@ With this parameter, the server serves the specified directory, by default it
|
||||||
uses the current working directory.
|
uses the current working directory.
|
||||||
(Contributed by Stéphane Wirtel and Julien Palard in :issue:`28707`.)
|
(Contributed by Stéphane Wirtel and Julien Palard in :issue:`28707`.)
|
||||||
|
|
||||||
The new :class:`ThreadedHTTPServer <http.server.ThreadedHTTPServer>` class
|
The new :class:`ThreadingHTTPServer <http.server.ThreadingHTTPServer>` class
|
||||||
uses threads to handle requests using :class:`~socketserver.ThreadingMixin`.
|
uses threads to handle requests using :class:`~socketserver.ThreadingMixin`.
|
||||||
It is used when ``http.server`` is run with ``-m``.
|
It is used when ``http.server`` is run with ``-m``.
|
||||||
(Contributed by Julien Palard in :issue:`31639`.)
|
(Contributed by Julien Palard in :issue:`31639`.)
|
||||||
|
|
|
@ -83,7 +83,7 @@ XXX To do:
|
||||||
__version__ = "0.6"
|
__version__ = "0.6"
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"HTTPServer", "ThreadedHTTPServer", "BaseHTTPRequestHandler",
|
"HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler",
|
||||||
"SimpleHTTPRequestHandler", "CGIHTTPRequestHandler",
|
"SimpleHTTPRequestHandler", "CGIHTTPRequestHandler",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ class HTTPServer(socketserver.TCPServer):
|
||||||
self.server_port = port
|
self.server_port = port
|
||||||
|
|
||||||
|
|
||||||
class ThreadedHTTPServer(socketserver.ThreadingMixIn, HTTPServer):
|
class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer):
|
||||||
daemon_threads = True
|
daemon_threads = True
|
||||||
|
|
||||||
|
|
||||||
|
@ -1217,7 +1217,7 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
|
||||||
|
|
||||||
|
|
||||||
def test(HandlerClass=BaseHTTPRequestHandler,
|
def test(HandlerClass=BaseHTTPRequestHandler,
|
||||||
ServerClass=ThreadedHTTPServer,
|
ServerClass=ThreadingHTTPServer,
|
||||||
protocol="HTTP/1.0", port=8000, bind=""):
|
protocol="HTTP/1.0", port=8000, bind=""):
|
||||||
"""Test the HTTP request handler class.
|
"""Test the HTTP request handler class.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue