summaryrefslogtreecommitdiffstats
path: root/Lib/SocketServer.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35017, socketserver: don't accept request after shutdown (GH-9952) ↵Denis Ledoux2018-10-261-0/+3
| | | | | | | | | | | | | | | | | | (GH-10129) Prior to this revision, after the shutdown of a `BaseServer`, the server accepted a last single request if it was sent between the server socket polling and the polling timeout. This can be problematic for instance for a server restart for which you do not want to interrupt the service, by not closing the listening socket during the restart. One request failed because of this behavior. Note that only one request failed, following requests were not accepted, as expected. (cherry picked from commit 10cb3760e8631a27f5db1e51b05494e29306c671)
* Issue #26778: Fixed "a/an/and" typos in code comment and documentation.Serhiy Storchaka2016-04-171-1/+1
|
* Issue #5824: Fix DatagramRequestHandler tests by binding the client socketMartin Panter2016-02-241-8/+0
|
* Issue #26309: Shut down SocketServer request if verify_request() is falseMartin Panter2016-02-181-0/+2
| | | | Based on patch by Aviv Palivoda.
* Issues #26310, #26311: Fix typos in the documentationMartin Panter2016-02-101-1/+1
|
* Issue #22435: Fix a file descriptor leak when SocketServer bind fails.Charles-François Natali2014-10-131-2/+6
|
* Issue #21491: SocketServer: Fix a race condition in child processes reaping.Charles-François Natali2014-06-201-28/+30
|
* Issue #14574: Ignore socket errors raised when flushing a connection on close.Kristján Valur Jónsson2012-12-251-1/+6
|
* Fix the patch for issue #7978: select() raises select.error before 3.3, not ↵Antoine Pitrou2012-04-081-2/+2
| | | | OSError.
* Issue #7978: socketserver now restarts the select() call when EINTR is returned.Antoine Pitrou2012-04-081-2/+13
| | | | | This avoids crashing the server loop when a signal is received. Patch by Jerzy Kozera.
* Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn.Florent Xicluna2011-11-041-2/+1
|
* #13289: fix typo.Ezio Melotti2011-10-291-1/+1
|
* #11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-151-1/+1
|
* Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown,Antoine Pitrou2010-04-251-12/+14
| | | | | | where the method could block indefinitely if called just before the event loop started running. This also fixes the occasional freezes witnessed in test_httpservers.
* http://bugs.python.org/issue6382Kristján Valur Jónsson2009-07-071-9/+23
| | | | added the shutdown_request() which can perform shutdown before calling close. This is needed for the ForkingMixIn because different close semantics are required for child and parent process. shutdown_request(), for TCP servers, calls socket.shutdown() and then calls close_request(). Therefore, this is not an backwards incompatible change, since subclasses that continue to override close_request() continue to work.
* http://bugs.python.org/issue6382Kristján Valur Jónsson2009-07-051-1/+3
| | | | close_request() (which can send a socket.shutdown()) must be called by the child process in a forking server. The parent must merely close the socket handle.
* http://bugs.python.org/issue6381Kristján Valur Jónsson2009-07-031-1/+6
| | | | some platforms may raise ENOTCONN if the stack has disconnected the socket on behalf of the peer.
* http://bugs.python.org/issue6267Kristján Valur Jónsson2009-06-281-3/+8
| | | | Cumulative patch to http and xmlrpc
* http://bugs.python.org/issue6192Kristján Valur Jónsson2009-06-241-7/+8
| | | | Move the newly introduced disable_nagle_algorithm flag into the StreamRequestHandler, where it is more appropriate.
* http://bugs.python.org/issue6192Kristján Valur Jónsson2009-06-071-1/+7
| | | | Add a feature to disable the Nagle algorithm on sockets in TCPServer
* Fix call to os.waitpid, it does not take keyword args.Neil Schemenauer2009-02-241-1/+1
|
* socketserver renaming reversal part 3: move the module into the rightGeorg Brandl2008-05-241-0/+681
| | | | place and fix all references to it. Closes #2926.
* Renamed SocketServer to 'socketserver'.Alexandre Vassalotti2008-05-121-681/+0
| | | | Deprecated old name.
* Progress on issue #1193577 by adding a polling .shutdown() method toJeffrey Yasskin2008-03-071-27/+66
| | | | | | SocketServers. The core of the patch was written by Pedro Werneck, but any bugs are mine. I've also rearranged the code for timeouts in order to avoid interfering with the shutdown poll.
* Prevent SocketServer.ForkingMixIn from waiting on child processes that itJeffrey Yasskin2008-02-281-9/+21
| | | | | didn't create, in most cases. When there are max_children handlers running, it will still wait for any child process, not just handler processes.
* Add diagnostic message to help figure-out why SocketServer tests ↵Raymond Hettinger2008-02-141-1/+5
| | | | | | occasionally crash when trying to remove a pid that in not in the activechildren list.
* Patch #742598 from Michael Pomraning: add .timeout attribute to SocketServer ↵Andrew M. Kuchling2008-01-191-4/+41
| | | | | | that will call .handle_timeout() method when no requests are received within the timeout period.
* Whitespace normalization.Tim Peters2007-03-121-2/+2
|
* Patch #1599845: Add an option to disable the implicit calls to server_bind() ↵Collin Winter2007-03-101-4/+5
| | | | and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer and DocXMLRPCServer.
* Bug #1531963: Make SocketServer.TCPServer's server_address always be equal ↵Collin Winter2007-03-101-0/+1
| | | | | | to calling getsockname() on the server's socket. Will backport.
* bug [ 957505 ] SocketServer module documentation misleadingGeorg Brandl2005-07-181-2/+2
|
* Fixed a typo in docstring I happened upon.Guido van Rossum2005-04-301-1/+1
|
* Use cStringIO where available.Raymond Hettinger2004-12-311-3/+6
|
* TCPServer: Fixed typo in class docstring.Barry Warsaw2003-10-091-1/+1
|
* TCPServer: Fixed typo in class docstring.Barry Warsaw2003-10-091-1/+1
| | | | Backport candidate.
* Clearing out old patch queue. Patch #558547, make SocketServer moreAnthony Baxter2003-01-021-1/+2
| | | | | robust. This makes socketserver's close() method callable repeatedly without error - similar to other file-like objects.
* Use False instead of 0.Fred Drake2002-11-221-1/+1
|
* Patch #550765: Add daemon_threads flag.Martin v. Löwis2002-11-221-1/+8
|
* Replace 0 with False to match working in documentation. SF 599681.Raymond Hettinger2002-08-251-2/+2
|
* SF bug #543318 (Frank J. Tobin).Guido van Rossum2002-04-151-1/+1
| | | | | | | In DatagramRequestHandler.setup(), the wfile initialization should be StringIO.StringIO(), not StringIO.StringIO(slf.packet). Bugfix candidate (all the way back to Python 1.5.2 :-).
* Convert a pile of obvious "yes/no" functions to return bool.Tim Peters2002-04-041-2/+2
|
* Apply the first chunk of the second patch from SF bug #471720:Guido van Rossum2001-10-231-3/+11
| | | | | | | | | | | | | ThreadingMixIn/TCPServer forgets close (Max Neunhöffer). This ensures that handle_error() and close_request() are called when an error occurs in the thread. (I am not applying the second chunk of the patch, which moved the finish() call into the finally clause in BaseRequestHandler's __init__ method; that would be a semantic change that I cannot accept at this point - the data would be sent even if the handler raised an exception.)
* SF bug #471720: ThreadingMixIn/TCPServer forgets closeGuido van Rossum2001-10-181-1/+6
| | | | | Solved with a helper method that calls finish_request() and then close_request(). The code is by Max Neunhöffer.
* remove empty __del__ method from BaseRequestHandler to avoid cyclic garbageSkip Montanaro2001-10-031-3/+0
| | | | loss for no reason.
* Patch #401196: Use getaddrinfo and AF_INET6 in TCP servers and clients.Martin v. Löwis2001-07-241-1/+1
|
* IMPORTANT FIX: This should definitely go into the 2.1.1 release!!!Guido van Rossum2001-07-101-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix various serious problems: - The ThreadingTCPServer class and its derived classes were completely broken because the main thread would close the request before the handler thread had time to look at it. This was introduced by Ping's close_request() patch. The fix moves the close_request() calls to after the handler has run to completion in the BaseServer class and the ForkingMixIn class; when using the ThreadingMixIn, closing the request is the handler's responsibility. - The ForkingUDPServer class has always been been broken because the socket was closed in the child before calling the handler. I fixed this by simply not calling server_close() in the child at all. - I cannot get the UnixDatagramServer class to work at all. The recvfrom() call doesn't return a meaningful client address. I added a comment to this effect. Maybe it works on other Unix versions. - The __all__ variable was missing ThreadingMixIn and ForkingMixIn. - Bumped __version__ to "0.4". - Added a note about the test suite (to be checked in shortly).
* Add a close_request method to the BaseServer so that the TCPServer classKa-Ping Yee2001-04-111-0/+14
| | | | can close the request connection when it's done handling it.
* added __all__ lists to a number of Python modulesSkip Montanaro2001-01-201-0/+7
| | | | | | | | added test script and expected output file as well this closes patch 103297. __all__ attributes will be added to other modules without first submitting a patch, just adding the necessary line to the test script to verify more-or-less correct implementation.
* Bump __version__; add authorship note for the BaseServer patch.Guido van Rossum2001-01-191-1/+2
|
* SF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer classGuido van Rossum2001-01-191-51/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for SocketServer.py (inherited by TCPServer) Luke wrote: The socketserver code, with a little bit of tweaking, can be made sufficiently general to service "requests" of any kind, not just by sockets. The BaseServer class was created, for example, to poll a table in a MYSQL database every 2 seconds. each entry in the table can be allocated a Handler which deals with the entry. With this patch, using BaseServer and ThreadedServer classes, the creation of the server that reads and handles MySQL table entries instead of a socket was utterly trivial: about 50 lines of python code. You may consider this code to be utterly useless [why would anyone else want to do anything like this???] - you are entitled to your opinion. if you think so, then think of this: have you considered how to cleanly add SSL to the TCPSocketServer? What about using shared memory as the communications mechanism for a server, instead of sockets? What about communication using files? The SocketServer code is extremely good every useful. it's just that as it stands, it is tied to sockets, which is not as useful. I heartily approve of this idea.