[CalendarServer-changes] [508] CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch

source_changes at macosforge.org source_changes at macosforge.org
Fri Nov 17 08:47:14 PST 2006


Revision: 508
          http://trac.macosforge.org/projects/calendarserver/changeset/508
Author:   cdaboo at apple.com
Date:     2006-11-17 08:47:13 -0800 (Fri, 17 Nov 2006)

Log Message:
-----------
Cached URLs are the 'path' component of the URL not the full URL. This is an issue when doing COPY/MOVE as the
Destination URL is absolute - most other situations its relative (i.e. url == path).

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch	2006-11-17 15:40:05 UTC (rev 507)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch	2006-11-17 16:47:13 UTC (rev 508)
@@ -97,7 +97,7 @@
  
      def locateResource(self, url):
          """
-@@ -385,8 +396,13 @@
+@@ -385,7 +396,8 @@
              The contained response will have a status code of
              L{responsecode.BAD_REQUEST}.
          """
@@ -105,18 +105,18 @@
 +        if url is None:
 +            return defer.succeed(None)
  
-+        cached = self._urlsByResource.get(url, None)
-+        if cached is not None:
-+            return defer.succeed(cached)
-+
          #
          # Parse the URL
-         #
-@@ -406,18 +422,65 @@
+@@ -406,18 +418,70 @@
                  "URL is not on this site (%s://%s/): %s" % (scheme, self.headers.getHeader("host"), url)
              ))
  
 -        segments = path.split("/")
++        # Looked for cached value
++        cached = self._urlsByResource.get(path, None)
++        if cached is not None:
++            return defer.succeed(cached)
++
 +        segments = unquote(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/20061117/e32f9a21/attachment.html


More information about the calendarserver-changes mailing list