Bug 159898

Summary: m2crypto SSLServer handle_error() vs. SocketServer.TCPServer handle_error()
Product: [Fedora] Fedora Reporter: Dan Williams <dcbw>
Component: m2cryptoAssignee: Miloslav Trmač <mitr>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://bugzilla.osafoundation.org/show_bug.cgi?id=2841
Whiteboard:
Fixed In Version: 0.13-5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-06-14 15:01:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
normalize m2crypto's SSLServer.handle_error() function
none
Define request & client_address first none

Description Dan Williams 2005-06-08 21:27:25 UTC
If one tries to use m2crypto's ThreadingSSLServer (which uses
SocketServer.TCPServer with the ThreadingMixIn) and experiences an error of any
kind during request processing (triggered from here):

/usr/lib/python2.4/SocketServer.py:465
        try:
            self.finish_request(request, client_address)
            self.close_request(request)
        except:
            self.handle_error(request, client_address)
            self.close_request(request)

handle_error(request, client_address) will be called.  That resolves to
SSLServer.handle_error(), which looks like this:

    def handle_error(self):
        print '-'*40
        import traceback
        traceback.print_exc()
        print '-'*40

Python complains that SSLServer.handle_error() takes only 1 argument, but was
given 3 arguments.

Comment 1 Dan Williams 2005-06-08 21:28:12 UTC
Created attachment 115241 [details]
normalize m2crypto's SSLServer.handle_error() function

Comment 2 Miloslav Trmač 2005-06-09 12:01:13 UTC
Fixed in m2crypto-0.13-4. Thanks!

Comment 3 Dan Williams 2005-06-13 17:53:18 UTC
My previous patch was slightly incomplete.  Turns out we need to set (request,
client_address) to None before we enter the try: block, otherwise they may not
be defined yet during an Exception.

Updated patch attached.

Comment 4 Dan Williams 2005-06-13 17:54:41 UTC
Created attachment 115361 [details]
Define request & client_address first

Comment 5 Miloslav Trmač 2005-06-14 15:01:56 UTC
Built in m2crypto-0.13-5, thanks again.