Skip to content
Permalink
Browse files

Commit temporary PROPFIND cache removal before merge from trunk.

  • Loading branch information...
cyrusdaboo committed Apr 7, 2010
1 parent d984430 commit c322dc6341ab9adf932322e9d45f17c953cdcb09
Showing with 24 additions and 24 deletions.
  1. +23 −23 calendarserver/provision/root.py
  2. +1 −1 calendarserver/provision/test/test_root.py
@@ -260,29 +260,29 @@ def locateChild(self, request, segments):
request.extendedLogItems = {}
request.extendedLogItems["xff"] = remote_ip[0]

if request.method == "PROPFIND" and not getattr(request, "notInCache", False) and len(segments) > 1:
try:
authnUser, authzUser = (yield self.authenticate(request))
request.authnUser = authnUser
request.authzUser = authzUser
except (UnauthorizedLogin, LoginFailed):
response = (yield UnauthorizedResponse.makeResponse(
request.credentialFactories,
request.remoteAddr
))
raise HTTPError(response)

try:
if not getattr(request, "checkingCache", False):
request.checkingCache = True
response = (yield self.responseCache.getResponseForRequest(request))
if response is None:
request.notInCache = True
raise KeyError("Not found in cache.")

returnValue((_CachedResponseResource(response), []))
except KeyError:
pass
# if request.method == "PROPFIND" and not getattr(request, "notInCache", False) and len(segments) > 1:
# try:
# authnUser, authzUser = (yield self.authenticate(request))
# request.authnUser = authnUser
# request.authzUser = authzUser
# except (UnauthorizedLogin, LoginFailed):
# response = (yield UnauthorizedResponse.makeResponse(
# request.credentialFactories,
# request.remoteAddr
# ))
# raise HTTPError(response)
#
# try:
# if not getattr(request, "checkingCache", False):
# request.checkingCache = True
# response = (yield self.responseCache.getResponseForRequest(request))
# if response is None:
# request.notInCache = True
# raise KeyError("Not found in cache.")
#
# returnValue((_CachedResponseResource(response), []))
# except KeyError:
# pass

child = (yield super(RootResource, self).locateChild(request, segments))
returnValue(child)
@@ -363,7 +363,7 @@ def gotResponse1(response):
def gotResponse2(response):
if response.code != responsecode.MULTI_STATUS:
self.fail("Incorrect response for PROPFIND /principals/: %s" % (response.code,))
self.assertEqual(self.root.resource.responseCache.cacheHitCount, 1)
self.assertEqual(self.root.resource.responseCache.cacheHitCount, 0)

d = self.send(request, gotResponse1)
return d

0 comments on commit c322dc6

Please sign in to comment.
You can’t perform that action at this time.