~ubuntu-branches/ubuntu/saucy/sope/saucy

« back to all changes in this revision

Viewing changes to debian/patches/0008-Fix-stale-cache-issue-when-upgrading.patch

  • Committer: Package Import Robot
  • Author(s): Jeroen Dekkers
  • Date: 2012-06-10 22:05:37 UTC
  • Revision ID: package-import@ubuntu.com-20120610220537-50vcuwp4uthj88dk
Tags: 1.3.15-3
* 0009-GNUstep-1.24-fix.patch:
  - Fix to cope with changes in GNUstep 1.24.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Wolfgang Sourdeau <wsourdeau@inverse.ca>
 
2
Date: Thu, 24 May 2012 14:26:45 +0000
 
3
Subject: Fix stale cache issue when upgrading
 
4
 
 
5
Origin: upstream, http://mtn.inverse.ca/revision/info/b2721d7f18528c981a921065d3272cca1a9070e8
 
6
---
 
7
 sope-appserver/WEExtensions/ChangeLog           |    8 ++++++++
 
8
 sope-appserver/WEExtensions/WEResourceManager.m |   15 ++++++++++-----
 
9
 2 files changed, 18 insertions(+), 5 deletions(-)
 
10
 
 
11
diff --git a/sope-appserver/WEExtensions/ChangeLog b/sope-appserver/WEExtensions/ChangeLog
 
12
index 771dc98..ff32f17 100644
 
13
--- a/sope-appserver/WEExtensions/ChangeLog
 
14
+++ b/sope-appserver/WEExtensions/ChangeLog
 
15
@@ -1,3 +1,11 @@
 
16
+2012-05-24  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
17
+
 
18
+       * WEResourceManager.m
 
19
+       (_urlForResourceNamed:inFramework:language:applicationName:):
 
20
+       append "lm=" + the unix timestamp of the file last modification
 
21
+       date to force a reload of the file each time it is modified, no
 
22
+       matter what expiry date the browsers are using in their cache.
 
23
+
 
24
 2010-01-29  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
25
 
 
26
        * WEResourceManager.m
 
27
diff --git a/sope-appserver/WEExtensions/WEResourceManager.m b/sope-appserver/WEExtensions/WEResourceManager.m
 
28
index a7ed87f..03aa8b5 100644
 
29
--- a/sope-appserver/WEExtensions/WEResourceManager.m
 
30
+++ b/sope-appserver/WEExtensions/WEResourceManager.m
 
31
@@ -575,8 +575,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
 
32
       }
 
33
       [ms appendString:_name];
 
34
       
 
35
-      url = [ms copy];
 
36
-      [ms release]; ms = nil;
 
37
+      url = ms;
 
38
       if (debugOn) [self debugWithFormat:@"FOUND: '%@'", url];
 
39
       goto done;
 
40
     }
 
41
@@ -589,6 +588,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
 
42
   while ((path = [e nextObject])) {
 
43
     NSMutableString *ms;
 
44
     NSString *fpath, *basepath;
 
45
+    NSDate *lastModified;
 
46
     
 
47
     /* check language */
 
48
     if (_lang) {
 
49
@@ -608,7 +608,11 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
 
50
     
 
51
     if (![fm fileExistsAtPath:fpath])
 
52
       continue;
 
53
-      
 
54
+
 
55
+    lastModified = [[fm fileAttributesAtPath: fpath
 
56
+                                traverseLink: YES]
 
57
+                     fileModificationDate];
 
58
+
 
59
     ms = [[NSMutableString alloc] initWithCapacity:256];
 
60
       
 
61
     if (prefix) [ms appendString:prefix];
 
62
@@ -622,9 +626,10 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
 
63
       [ms appendString:@".lproj/"];
 
64
     }
 
65
     [ms appendString:_name];
 
66
+    [ms appendFormat: @"?lm=%u",
 
67
+        (NSUInteger) [lastModified timeIntervalSince1970]];
 
68
       
 
69
-    url = [ms copy];
 
70
-    [ms release]; ms = nil;
 
71
+    url = ms;
 
72
     if (debugOn) [self debugWithFormat:@"FOUND: '%@'", url];
 
73
     goto done;
 
74
   }