Changeset 1049
- Timestamp:
- 11/23/07 20:36:34 (1 year ago)
- Files:
-
- trunk/mango/net/servlet/Servlet.d (modified) (3 diffs)
- trunk/mango/net/util/cache/Payload.d (modified) (2 diffs)
- trunk/mango/net/util/cache/PlainCache.d (modified) (2 diffs)
- trunk/mango/net/util/cache/QueuedCache.d (modified) (1 diff)
- trunk/mango/net/util/cache/model/ICache.d (modified) (2 diffs)
- trunk/mango/net/util/cache/model/ICached.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/mango/net/servlet/Servlet.d
r1047 r1049 13 13 module mango.net.servlet.Servlet; 14 14 15 private import tango. core.TimeSpan;15 private import tango.util.time.DateTime; 16 16 17 17 public import tango.net.http.HttpConst, … … 159 159 160 160 overridable implementation of getLastModified() returns 161 Time.zeroto say it doesn't know.162 163 **********************************************************************/ 164 165 TimeSpangetLastModified (IServletRequest request)166 { 167 return TimeSpan.zero;161 DateTime.epoch to say it doesn't know. 162 163 **********************************************************************/ 164 165 DateTime getLastModified (IServletRequest request) 166 { 167 return DateTime.epoch; 168 168 } 169 169 … … 182 182 { 183 183 auto lastModified = getLastModified (request); 184 if (lastModified is TimeSpan.zero)184 if (lastModified is DateTime.epoch) 185 185 doGet (request, response); 186 186 else 187 187 { 188 auto ifModifiedSince = request.headers.getDate (HttpHeader.IfModifiedSince); 189 if (lastModified - ifModifiedSince > Time.TicksPerSecond) 188 // auto ifModifiedSince = request.headers.getDate (HttpHeader.IfModifiedSince); 189 // if (lastModified - ifModifiedSince > Time.TicksPerSecond) 190 auto span = lastModified - request.headers.getDate (HttpHeader.IfModifiedSince); 191 if (span.seconds > 1) 190 192 { 191 193 response.headers.addDate (HttpHeader.LastModified, lastModified); trunk/mango/net/util/cache/Payload.d
r1047 r1049 35 35 ***********************************************************************/ 36 36 37 Timetime ()37 long time () 38 38 { 39 return cast(Time)time_;39 return time_; 40 40 } 41 41 … … 46 46 ***********************************************************************/ 47 47 48 void time ( Timetime)48 void time (long time) 49 49 { 50 50 time_ = time; trunk/mango/net/util/cache/PlainCache.d
r987 r1049 93 93 **********************************************************************/ 94 94 95 ICached extract (char[] key, TimetimeLimit)95 ICached extract (char[] key, long timeLimit) 96 96 { 97 97 // cast to void* first to avoid overhead … … 137 137 ICached get (char[] key) 138 138 { 139 Timet;139 long t; 140 140 141 141 auto p = cache.get (key); trunk/mango/net/util/cache/QueuedCache.d
r1047 r1049 122 122 **********************************************************************/ 123 123 124 override ICached extract (char[] key, Time timeLimit = Time.max)124 override ICached extract (char[] key, long timeLimit = long.max) 125 125 in { 126 126 assert (key.length); trunk/mango/net/util/cache/model/ICache.d
r1034 r1049 48 48 **********************************************************************/ 49 49 50 ICached extract (char[] key, Time timeLimit = Time.max);50 ICached extract (char[] key, long timeLimit = long.max); 51 51 52 52 /********************************************************************** … … 115 115 **********************************************************************/ 116 116 117 ICached load (char[] key, Timetime);117 ICached load (char[] key, long time); 118 118 } 119 119 trunk/mango/net/util/cache/model/ICached.d
r988 r1049 12 12 13 13 module mango.net.util.cache.model.ICached; 14 15 public import tango.core.Type : Time;16 14 17 15 /****************************************************************************** … … 29 27 ***********************************************************************/ 30 28 31 Timetime ();29 long time (); 32 30 }
