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."""
     

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to