X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=apache%2Fplc.wsgi;h=c37d3695b5d59b93066420aa98384809b76ee24d;hb=refs%2Fheads%2Fremove-xmlrpc;hp=e6a7eb3c605d931f66510c33c2b59407bb9b30ef;hpb=502c66df9890a99c0887a3a9c89f7a54fb6914f8;p=plcapi.git diff --git a/apache/plc.wsgi b/apache/plc.wsgi index e6a7eb3c..c37d3695 100644 --- a/apache/plc.wsgi +++ b/apache/plc.wsgi @@ -12,8 +12,6 @@ import traceback from PLC.Debug import log from PLC.API import PLCAPI -api = PLCAPI() - def application(environ, start_response): try: status = '200 OK' @@ -28,6 +26,12 @@ def application(environ, start_response): """ else: + # Thomas Dreibholz + # Note that this function is called within multiple threads! + # "api" MUST be a local variable instead of a global one. + # Otherwise, this causes concurrent accesses to the same + # object within different threads! + api = PLCAPI() api.environ = environ content_type = 'text/xml' ip = environ.get('REMOTE_ADDR')