Changeset 597

Show
Ignore:
Timestamp:
04/19/02 20:31:24
Author:
miyagawa
Message:

LogSQLiteAutoChown now takes On|Off
close log databases properly

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mod_log_sqlite/trunk/mod_log_sqlite.c

    r595 r597  
    1616#include "sqlite.h" 
    1717 
    18 #define LOG_SQLITE_VERSION 0.05 
     18#define LOG_SQLITE_VERSION 0.06 
    1919#define SQL_TIMEOUT 30000 
    2020 
     
    9898} 
    9999 
    100 static const char *set_sqlite_auto_chown(cmd_parms *cmd, void *mconfig, char *param
     100static const char *set_sqlite_auto_chown(cmd_parms *cmd, void *mconfig, int bool
    101101{ 
    102102  log_sqlite_config_rec *conf = (log_sqlite_config_rec *) ap_get_module_config(cmd->server->module_config, &log_sqlite_module); 
    103   if (strncasecmp(param, "On", 2) == 0) 
    104       conf->auto_chown = 1; 
    105   else 
    106       conf->auto_chown = 0; 
     103  conf->auto_chown = bool; 
    107104  return NULL; 
    108105} 
     
    206203} 
    207204 
     205static void log_sqlite_close(server_rec *s, pool *p) 
     206{ 
     207    log_sqlite_config_rec *conf = (log_sqlite_config_rec *) ap_get_module_config(s->module_config, &log_sqlite_module); 
     208    if (conf->db != 0) 
     209        sqlite_close(conf->db); 
     210    return; 
     211} 
    208212 
    209213/* close logdb on child exit */ 
    210214static void cleanup_log_sqlite(server_rec *s, pool *p) 
    211215{ 
    212   log_sqlite_config_rec *conf = (log_sqlite_config_rec *) ap_get_module_config(s->module_config, &log_sqlite_module); 
    213   sqlite_close(conf->db); 
     216    log_sqlite_close(s, p); 
     217    for (s = s->next; s; s = s->next){ 
     218        log_sqlite_close(s, p); 
     219    } 
     220    return; 
    214221} 
    215222 
     
    221228   NULL, RSRC_CONF, TAKE1, "sqlite log table name"}, 
    222229  {"LogSQLiteAutoChown", set_sqlite_auto_chown,  
    223    NULL, RSRC_CONF, TAKE1, "sqlite log file auto chown"}, 
     230   NULL, RSRC_CONF, FLAG, "sqlite log file auto chown"}, 
    224231  {NULL}, 
    225232};