Changeset 577

Show
Ignore:
Timestamp:
04/07/02 12:38:53
Author:
miyagawa
Message:

0.02: sqlite_busy_timeout

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mod_log_sqlite/trunk/MANIFEST

    r574 r577  
     1ChangeLog 
    12README 
    23Makefile 
  • mod_log_sqlite/trunk/Makefile

    r574 r577  
    77APXS=apxs 
    88APACHECTL=apachectl 
    9 VER=0.01 
     9VER=0.02 
    1010 
    1111#   additional user defines, includes and libraries 
  • mod_log_sqlite/trunk/mod_log_sqlite.c

    r574 r577  
    1515#include "sqlite.h" 
    1616 
    17 #define LOG_SQLITE_VERSION 0.01 
     17#define LOG_SQLITE_VERSION 0.02 
     18#define SQL_TIMEOUT 30000 
    1819 
     20typedef struct { 
     21  char   *db_file; 
     22  char   *table; 
     23  sqlite *db; 
     24} log_sqlite_config_rec; 
     25 
     26module MODULE_VAR_EXPORT log_sqlite_module; 
     27 
     28/* utility: NULL to "NULL", others escaped and quoted */ 
    1929static char *quote(request_rec *r, const char *str) 
    2030{ 
     
    4151  return new; 
    4252} 
    43  
    44  
    45 typedef struct { 
    46   char *db_file; 
    47   char *table; 
    48   sqlite *db; 
    49 } log_sqlite_config_rec; 
    50  
    51 module MODULE_VAR_EXPORT log_sqlite_module; 
    5253 
    5354/* create config */ 
     
    7980} 
    8081 
    81 /* open log db file */ 
     82/* open logdb file */ 
    8283static void init_log_sqlite(server_rec* s, pool *p) 
    8384{ 
     
    112113    return DECLINED; 
    113114  } 
     115 
     116  /* sets timeout handler */ 
     117  sqlite_busy_timeout(conf->db, SQL_TIMEOUT); 
    114118   
     119  /* using '%q' would lead to '(NULL)', thus I use my own quote() function */ 
    115120  ret = sqlite_exec_printf( 
    116121    conf->db, 
     
    143148 
    144149 
    145 /* close database on child exit */ 
     150/* close logdb on child exit */ 
    146151static void cleanup_log_sqlite(server_rec *s, pool *p) 
    147152{