Author santoso.wijaya
Recipients aerodonkey, santoso.wijaya
Date 2010-04-22.00:03:57
SpamBayes Score 0.0358725
Marked as misclassified No
Message-id <1271894639.49.0.487597912366.issue6085@psf.upfronthosting.co.za>
In-reply-to
Content
There is a simple workaround to bypass the hostname resolution mechanism, so that the server can respond faster.

# This is a hack to patch slow socket.getfqdn calls that
# BaseHTTPServer (and its subclasses) make.
# See: http://bugs.python.org/issue6085
# See: http://www.answermysearches.com/xmlrpc-server-slow-in-python-how-to-fix/2140/

import BaseHTTPServer

def _bare_address_string(self):
    host, port = self.client_address[:2]
    return '%s' % host

BaseHTTPServer.BaseHTTPRequestHandler.address_string = \
        _bare_address_string

# End hack.
History
Date User Action Args
2010-04-22 00:04:00santoso.wijayasetrecipients: + santoso.wijaya, aerodonkey
2010-04-22 00:03:59santoso.wijayasetmessageid: <1271894639.49.0.487597912366.issue6085@psf.upfronthosting.co.za>
2010-04-22 00:03:57santoso.wijayalinkissue6085 messages
2010-04-22 00:03:57santoso.wijayacreate