[CalendarServer-changes] [140] CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted

source_changes at macosforge.org source_changes at macosforge.org
Fri Sep 15 08:06:47 PDT 2006


Revision: 140
Author:   cdaboo at apple.com
Date:     2006-09-15 08:06:35 -0700 (Fri, 15 Sep 2006)

Log Message:
-----------
Fix bug in Twisted whereby the access log entry for a single request gets written multiple times - once for each call to locateChild
during the course of processing the request.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.server.patch

Added Paths:
-----------
    CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.log.patch

Added: CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.log.patch
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.log.patch	                        (rev 0)
+++ CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.log.patch	2006-09-15 15:06:35 UTC (rev 140)
@@ -0,0 +1,13 @@
+Index: twisted/web2/log.py
+===================================================================
+--- twisted/web2/log.py	(revision 18157)
++++ twisted/web2/log.py	(working copy)
+@@ -88,7 +88,7 @@
+ class LogWrapperResource(resource.WrapperResource):
+     def hook(self, request):
+         # Insert logger
+-        request.addResponseFilter(logFilter, atEnd=True)
++        request.addResponseFilter(logFilter, atEnd=True, onlyOnce=True)
+ 
+ monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+              'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

Modified: CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.server.patch
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.server.patch	2006-09-15 04:09:55 UTC (rev 139)
+++ CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.server.patch	2006-09-15 15:06:35 UTC (rev 140)
@@ -11,7 +11,18 @@
  from urlparse import urlsplit
  
  import weakref
-@@ -316,7 +316,12 @@
+@@ -156,7 +156,9 @@
+         self.resources = []
+         http.Request.__init__(self, *args, **kw)
+ 
+-    def addResponseFilter(self, f, atEnd=False):
++    def addResponseFilter(self, f, atEnd=False, onlyOnce = False):
++        if onlyOnce and f in self.responseFilters:
++            return
+         if atEnd:
+             self.responseFilters.append(f)
+         else:
+@@ -316,7 +318,12 @@
          if newpath is StopTraversal:
              # We need to rethink how to do this.
              #if newres is res:
@@ -25,7 +36,7 @@
                  return res
              #else:
              #    raise ValueError("locateChild must not return StopTraversal with a resource other than self.")
-@@ -337,7 +342,7 @@
+@@ -337,7 +344,7 @@
                  self.prepath.append(self.postpath.pop(0))
  
          child = self._getChild(None, newres, newpath, updatepaths=updatepaths)
@@ -34,7 +45,7 @@
  
          return child
  
-@@ -404,6 +409,7 @@
+@@ -404,6 +411,7 @@
          segments = path.split("/")
          assert segments[0] == "", "URL path didn't begin with '/': %s" % (path,)
          segments = segments[1:]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20060915/81c67af7/attachment.html


More information about the calendarserver-changes mailing list