[Twisted-web] [patch] 2/3 scgi logging
Andrea Arcangeli
andrea at cpushare.com
Wed May 17 09:56:34 CDT 2006
This patch allows scgi logging on the scgi client side (so the main
server). Without this patch there are exceptions due the lack of
write/finish methods in the logbytecounter. It's not entirely clear if
this is the right fix but it works fine (it's not entirely clear if this
is a kind of protocol that requires no counting at all, so if the read
actually is invoked). I asked for comments several times to drier and
foom but I got no reply about this.
diff -r 493b5c24e0f3 twisted/web2/log.py
--- a/twisted/web2/log.py Tue May 16 04:57:00 2006 +0000
+++ b/twisted/web2/log.py Wed May 17 15:59:28 2006 +0200
@@ -40,7 +40,13 @@ class _LogByteCounter(object):
done=self.done; self.done=None
done(False, self.len)
self.stream.close()
-
+
+ # allow ProducerStream to be accounted like with twscgi
+ def write(self, data):
+ self.stream.write(data)
+ def finish(self):
+ self.stream.finish()
+
class ILogInfo(Interface):
"""Auxilliary information about the response useful for logging."""
More information about the Twisted-web
mailing list