Branch: Tag:

2011-04-20

2011-04-20 23:50:47 by Martin Stjernholm <mast@lysator.liu.se>

Fixed cache_lookup compat wrt the old ram cache.

In the old cache, cache_lookup returned UNDEFINED for cache misses, which
the new one didn't do until now. The "tagdoc" cache in rxmlhelp.pike is
known to bug out because of this.

Rev: server/base_server/cache.pike:1.146

1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS. - // $Id: cache.pike,v 1.145 2011/04/15 15:17:47 mast Exp $ + // $Id: cache.pike,v 1.146 2011/04/20 23:50:47 mast Exp $      // FIXME: Add argcache, imagecache & protcache   
1452:    MORE_CACHE_WERR ("cache_lookup (%O, %s): %s\n",    cache_name, RXML.utils.format_short (key),    entry->data ? "Timed out" : "Destructed"); -  return 0; +  return UNDEFINED;    }       mgr->got_hit (cache_name, entry, cache_context);
1464:    mgr->got_miss (cache_name, key, cache_context);    MORE_CACHE_WERR ("cache_lookup (%O, %s): Miss\n",    cache_name, RXML.utils.format_short (key)); -  return 0; +  return UNDEFINED;   }      mixed cache_peek (string cache_name, mixed key)
1480:    mgr->remove_entry (cache_name, entry);    MORE_CACHE_WERR ("cache_peek (%O, %s): Timed out\n",    cache_name, RXML.utils.format_short (key)); -  return 0; +  return UNDEFINED;    }       MORE_CACHE_WERR ("cache_peek (%O, %s): Entry found\n",
1490:       MORE_CACHE_WERR ("cache_peek (%O, %s): Entry not found\n",    cache_name, RXML.utils.format_short (key)); -  return 0; +  return UNDEFINED;   }      mixed cache_set (string cache_name, mixed key, mixed data, void|int timeout,