From: richard Date: Tue, 2 Feb 2010 05:00:42 +0000 (+0000) Subject: Fix thread safety with stdin in roundup-server X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=278afda38aaee1719f4fe422579d7e30d8cd7d01;p=roundup.git Fix thread safety with stdin in roundup-server git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4448 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index 7161378..96fedf3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -29,6 +29,8 @@ Fixes: issue2550632 - Allow value to be specified to multilink form element templating, fixes issue2550613, thanks David Wolever +- Fix thread safety with stdin in roundup-server, fixes issue2550596 + (thanks Werner Hunger) 2009-12-21 1.4.11 (r4413) diff --git a/doc/acknowledgements.txt b/doc/acknowledgements.txt index 8ab9058..13793dc 100644 --- a/doc/acknowledgements.txt +++ b/doc/acknowledgements.txt @@ -58,6 +58,7 @@ Tobias Herp, Uwe Hoffmann, Alex Holkner, Tobias Hunger, +Werner Hunger, Simon Hyde, Paul Jimenez, Christophe Kalt, diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index b66b39b..3b10238 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -300,7 +300,7 @@ class Client: # see if we need to re-parse the environment for the form (eg Zope) if form is None: - self.form = cgi.FieldStorage(environ=env) + self.form = cgi.FieldStorage(fp=request.rfile, environ=env) else: self.form = form diff --git a/roundup/scripts/roundup_server.py b/roundup/scripts/roundup_server.py index 266edb9..12a2d00 100644 --- a/roundup/scripts/roundup_server.py +++ b/roundup/scripts/roundup_server.py @@ -188,8 +188,6 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """ Execute the CGI command. Wrap an innner call in an error handler so all errors can be caught. """ - save_stdin = sys.stdin - sys.stdin = self.rfile try: self.inner_run_cgi() except client.NotFound: @@ -226,7 +224,6 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): # out to the logfile print 'EXCEPTION AT', ts traceback.print_exc() - sys.stdin = save_stdin do_GET = do_POST = do_HEAD = run_cgi