Branch: Tag:

2010-05-05

2010-05-05 06:07:24 by Martin Jonsson <marty@roxen.com>

Fix division by zero bug that occured if update_cache_size_balance was called multiple times within the same second.

Rev: server/base_server/cache.pike:1.131

1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS. - // $Id: cache.pike,v 1.130 2010/05/02 19:39:37 marty Exp $ + // $Id: cache.pike,v 1.131 2010/05/05 06:07:24 marty Exp $      // FIXME: Add argcache, imagecache & protcache   
353: Inside #if defined(NEW_RAM_CACHE)
   // Should only be called at regular intervals from    // update_cache_size_balance.    { +  // Skip updating if we did it recently (avoid division by zero below.) +  if (now == last_update) +  return; +     float last_period = (float) (now - last_update);    float tot_period = (float) (now - start_time);    int startup = tot_period < cm_stats_avg_period;