[Python-checkins] CVS: python/dist/src/Lib SocketServer.py,1.28,1.29
Guido van Rossum
gvanrossum@users.sourceforge.net
Tue, 23 Oct 2001 14:42:47 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv1184
Modified Files:
SocketServer.py
Log Message:
Apply the first chunk of the second patch from SF bug #471720:
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.)
Index: SocketServer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/SocketServer.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** SocketServer.py 2001/10/18 18:02:07 1.28
--- SocketServer.py 2001/10/23 21:42:45 1.29
***************
*** 450,456 ****
def process_request_thread(self, request, client_address):
! """Same as in BaseServer but as a thread."""
! self.finish_request(request, client_address)
! self.close_request(request)
def process_request(self, request, client_address):
--- 450,464 ----
def process_request_thread(self, request, client_address):
! """Same as in BaseServer but as a thread.
!
! In addition, exception handling is done here.
!
! """
! try:
! self.finish_request(request, client_address)
! self.close_request(request)
! except:
! self.handle_error(request, client_address)
! self.close_request(request)
def process_request(self, request, client_address):