Fix to disable debug mode with a config reload
authorYugo Nagata <nagata@sraoss.co.jp>
Wed, 22 Oct 2014 12:33:02 +0000 (21:33 +0900)
committerYugo Nagata <nagata@sraoss.co.jp>
Wed, 22 Oct 2014 12:44:11 +0000 (21:44 +0900)
Per bug #114.

pool_config.c
pool_config.l

index 2d39a9059025d943cdb848342b6ae49659a5b39c..a0969c27d07f8b7308f2de972dab94affbf132af 100644 (file)
@@ -3819,8 +3819,12 @@ int pool_get_config(char *confpath, POOL_CONFIG_CONTEXT context)
                                fclose(fd);
                                return(-1);
                        }
-                       /* Consider -d option value stored in pool_config already */
-                       pool_config->debug_level |= v;
+                       /* don't overwrite -d option at startup */
+                       if (CHECK_CONTEXT(INIT_CONFIG, context))
+                               pool_config->debug_level |= v;
+                       /* use debug_level value at reload */
+                       else if (CHECK_CONTEXT(RELOAD_CONFIG, context))
+                               pool_config->debug_level = v;
                }
 
                else if (!strcmp(key, "relcache_expire") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context))
index 1d699e59d619676344464fdc64c41ad19ecff2e8..6129f7c7b1b33de1baed2ad74f754eb75510619e 100644 (file)
@@ -2272,8 +2272,12 @@ int pool_get_config(char *confpath, POOL_CONFIG_CONTEXT context)
                                fclose(fd);
                                return(-1);
                        }
-                       /* Consider -d option value stored in pool_config already */
-                       pool_config->debug_level |= v;
+                       /* don't overwrite -d option at startup */
+                       if (CHECK_CONTEXT(INIT_CONFIG, context))
+                               pool_config->debug_level |= v;
+                       /* use debug_level value at reload */
+                       else if (CHECK_CONTEXT(RELOAD_CONFIG, context))
+                               pool_config->debug_level = v;
                }
 
                else if (!strcmp(key, "relcache_expire") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context))