git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
79e3509
)
as a comment in plc.wsgi: keep track of potentially useful debug snippet
author
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Wed, 27 Apr 2022 16:17:01 +0000
(18:17 +0200)
committer
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Wed, 27 Apr 2022 16:17:01 +0000
(18:17 +0200)
apache/plc.wsgi
patch
|
blob
|
history
diff --git
a/apache/plc.wsgi
b/apache/plc.wsgi
index
40a1327
..
b16b7f2
100644
(file)
--- a/
apache/plc.wsgi
+++ b/
apache/plc.wsgi
@@
-23,6
+23,7
@@
def application(environ, start_response):
</head><body>
<h1>PLCAPI WSGI XML-RPC/SOAP Interface</h1>
<p>Please use XML-RPC or SOAP to access the PLCAPI.</p>
</head><body>
<h1>PLCAPI WSGI XML-RPC/SOAP Interface</h1>
<p>Please use XML-RPC or SOAP to access the PLCAPI.</p>
+<p>At the very least you need to use a POST method.</p>
</body></html>
"""
else:
</body></html>
"""
else:
@@
-37,6
+38,14
@@
def application(environ, start_response):
ip = environ.get('REMOTE_ADDR')
port = environ.get('REMOTE_PORT')
output = api.handle((ip,port), environ.get('wsgi.input').read())
ip = environ.get('REMOTE_ADDR')
port = environ.get('REMOTE_PORT')
output = api.handle((ip,port), environ.get('wsgi.input').read())
+# uncomment for debug
+# try:
+# with open("/tmp/dbgplc.log", "a") as f:
+# print(f"{ip=} {port=}\n"
+# f"{output=}",
+# file=f)
+# except Exception as exc:
+# pass
# Shut down database connection, otherwise up to MaxClients DB
# connections will remain open.
api.db.close()
# Shut down database connection, otherwise up to MaxClients DB
# connections will remain open.
api.db.close()