socket.settimeout breaks HTTP server

Steffen Beyer steffenbeyer at windit.de
Wed Mar 9 01:12:00 UTC 2011


Hi,

after some debugging of a WebDAV server (trytond), dropping connections 
shortly after accepting them, I found the issue:

class BaseThreadedHTTPServer(SocketServer.ThreadingMixIn,
    BaseHTTPServer.HTTPServer):

    def server_bind(self):
        # Python < 2.6 doesn't handle self.timeout
        self.socket.settimeout(1)

(http://hg2.tryton.org/trytond/file/28c6cc9fe39f/trytond/protocols/webdav.py#l83)

It runs fine after removing the call to "settimeout". The value does not 
seem to make a difference.

I guess, this works for other OSs as the software is in production. It 
fails however in a FreeBSD 8.1 jail.

What's the cause of the problem? How can I fix it without breaking it for 
other people? 

Kind regards,
-- 
Steffen Beyer

WINDIT GmbH
Holtenauer Str. 57
24105 Kiel

Fon: +49 (0)431 556 8342-0  Fax: +49 (0)431 556 8342-9  Web: 
http://www.windit.de


More information about the freebsd-python mailing list