summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a3fca8d)
raw | patch | inline | side by side (parent: a3fca8d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 15 Feb 2004 21:44:02 +0000 (21:44 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 15 Feb 2004 21:44:02 +0000 (21:44 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2088 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/scripts/roundup_server.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 233b45dfb11d5ecfbf67b9d62fb51bee216eb24e..490c048eef474707dfc24ccc7925d62c4bfb787b 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- use supplied content-type on file uploads before trying filename)
- fixed roundup-reminder script to use default schema (thanks Klamer Schutte)
- fixed edit action / parsePropsFromForm to handle index-page edits better
+- safer logging from HTTP server (sf bug 896917)
2003-12-17 0.6.4
index 6f58a60ca3dd2fd71f6710b451de0aa2a613ad07..c40a71c02b7616c8be4fc98bfe74103cf3f737c8 100644 (file)
"""Command-line script that runs a server over roundup.cgi.client.
-$Id: roundup_server.py,v 1.37 2004-02-11 23:55:10 richard Exp $
+$Id: roundup_server.py,v 1.38 2004-02-15 21:44:02 richard Exp $
"""
__docformat__ = 'restructuredtext'
r3fPdUcIYeyEfLSAJ0LeAUZHCAt8Al/8/kLIEWDB5YDj0wm8fAP6fVfo
'''.strip()))
+class RoundupHTTPServer(SafeLogging, BaseHTTPServer.HTTPServer):
+ def log_message(self, format, *args):
+ ''' Try to use the logging package, otherwise *safely* log to
+ stderr.
+ '''
+ try:
+ BaseHTTPServer.HTTPServer.log_message(self, format, *args)
+ except IOError:
+ # stderr is no longer viable, we can't log
+ pass
+
class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
TRACKER_HOMES = TRACKER_HOMES
ROUNDUP_USER = ROUNDUP_USER
SvcShutdown = "ServiceShutdown"
- class RoundupService(win32serviceutil.ServiceFramework,
- BaseHTTPServer.HTTPServer):
+ class RoundupService(win32serviceutil.ServiceFramework, RoundupHTTPServer):
''' A Roundup standalone server for Win32 by Ewout Prangsma
'''
_svc_name_ = "Roundup Bug Tracker"
# appending, unbuffered
sys.stdout = sys.stderr = open(LOGFILE, 'a', 0)
win32serviceutil.ServiceFramework.__init__(self, args)
- BaseHTTPServer.HTTPServer.__init__(self, self.address,
+ RoundupHTTPServer.__init__(self, self.address,
RoundupRequestHandler)
# Create the necessary NT Event synchronization objects...
# 1024 if started as root
address = (hostname, port)
try:
- httpd = BaseHTTPServer.HTTPServer(address, RoundupRequestHandler)
+ httpd = RoundupHTTPServer(address, RoundupRequestHandler)
except socket.error, e:
if e[0] == errno.EADDRINUSE:
raise socket.error, \