From: wessels <> Date: Thu, 5 Sep 1996 05:42:01 +0000 (+0000) Subject: - Added storeConfigure() so HUP signal affects store_swap size. X-Git-Tag: SQUID_3_0_PRE1~5851 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1c0cc670ad003e0b94d5176ce65ee1a41971ded;p=thirdparty%2Fsquid.git - Added storeConfigure() so HUP signal affects store_swap size. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index d849b50819..eb3816c5d4 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.cc,v 1.81 1996/09/03 19:24:01 wessels Exp $ + * $Id: cache_cf.cc,v 1.82 1996/09/04 23:42:01 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -1411,12 +1411,6 @@ int parseConfigFile(file_name) return 0; } -int setCacheSwapMax(size) - int size; -{ - Config.Swap.maxSize = size; - return Config.Swap.maxSize; -} u_short setHttpPortNum(port) u_short port; { @@ -1564,4 +1558,5 @@ static void configDoConfigure() getMyHostname(), Config.Port.http); if (Config.errHtmlText == NULL) Config.errHtmlText = xstrdup(""); + storeConfigure(); } diff --git a/src/store.cc b/src/store.cc index 8bb3297520..abe8e3b5ba 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,5 +1,5 @@ /* - * $Id: store.cc,v 1.96 1996/09/04 22:50:15 wessels Exp $ + * $Id: store.cc,v 1.97 1996/09/04 23:42:02 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -1272,11 +1272,8 @@ void storeSwapOutHandle(fd, flag, e) } if (flag == DISK_NO_SPACE_LEFT) { /* reduce the swap_size limit to the current size. */ - setCacheSwapMax(store_swap_size); - store_swap_high = (long) (((float) Config.Swap.maxSize * - (float) Config.Swap.highWaterMark) / (float) 100); - store_swap_low = (long) (((float) Config.Swap.maxSize * - (float) Config.Swap.lowWaterMark) / (float) 100); + Config.Swap.maxSize = store_swap_size; + storeConfigure(); } return; } @@ -2518,7 +2515,7 @@ static void storeCreateSwapSubDirs() } } -int storeInit() +void storeInit() { int dir_created; wordlist *w = NULL; @@ -2555,7 +2552,10 @@ int storeInit() if (dir_created || opt_zap_disk_store) storeCreateSwapSubDirs(); +} +void storeConfigure() +{ store_mem_high = (long) (Config.Mem.maxSize / 100) * Config.Mem.highWaterMark; store_mem_low = (long) (Config.Mem.maxSize / 100) * @@ -2578,12 +2578,10 @@ int storeInit() if (store_hotobj_low > store_hotobj_high) store_hotobj_low = store_hotobj_high; - store_swap_high = (long) (Config.Swap.maxSize / 100) * - Config.Swap.highWaterMark; - store_swap_low = (long) (Config.Swap.maxSize / 100) * - Config.Swap.lowWaterMark; - - return 0; + store_swap_high = (long) (((float) Config.Swap.maxSize * + (float) Config.Swap.highWaterMark) / (float) 100); + store_swap_low = (long) (((float) Config.Swap.maxSize * + (float) Config.Swap.lowWaterMark) / (float) 100); } /*