Thread: [Refdb-cvs] CVS: refdb/src refdbd.c,1.74.2.15,1.74.2.16 refdbd.h.in,1.7.2.9,1.7.2.10
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2005-09-17 21:34:40
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5783 Modified Files: Tag: Release_0_9_5_stable refdbd.c refdbd.h.in Log Message: added db_timeout option Index: refdbd.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.c,v retrieving revision 1.74.2.15 retrieving revision 1.74.2.16 diff -u -U2 -r1.74.2.15 -r1.74.2.16 --- refdbd.c 29 Jul 2005 21:15:41 -0000 1.74.2.15 +++ refdbd.c 17 Sep 2005 21:34:31 -0000 1.74.2.16 @@ -62,5 +62,5 @@ #endif -Prefs prefs[22] = { +Prefs prefs[23] = { {"serverip", ""}, {"timeout", ""}, @@ -84,4 +84,5 @@ {"in_encoding", ""}, {"nongeek_offset", ""}, + {"db_timeout", ""}, {"", ""} }; @@ -114,4 +115,5 @@ char keyword_scan[PREFS_BUF_LEN] = ""; /* run automatic keyword scan if 't' */ char ng_offset[PREFS_BUF_LEN] = "1"; /* 0 for geeks, 1 for humans */ +char db_timeout[PREFS_BUF_LEN] = "60000"; /* db-engine specific timeout */ char confdir[_POSIX_PATH_MAX+1] = ""; /* path to the config files */ @@ -245,4 +247,5 @@ prefs[19].varvalue = default_input_encoding; prefs[20].varvalue = ng_offset; + prefs[21].varvalue = db_timeout; *dbi_driver_dir = '\0'; @@ -274,5 +277,5 @@ /* read command line settings. These may override the config file settings */ - while ((n_opt = getopt(argc, argv, "b:d:D:e:E:hi:IkKl:L:p:P:qrsT:UvVy:Y:")) != -1) { + while ((n_opt = getopt(argc, argv, "b:d:D:e:E:hi:IkKl:L:m:p:P:qrsT:UvVy:Y:")) != -1) { switch (n_opt) { case 'b': @@ -297,5 +300,5 @@ break; case 'h': - fprintf(stderr, "Usage: refdbd [-b dbs_port] [-d database] [-D dbserver] [-e dest] [-E encoding] [-h] [-i address] [-I] [-k] [-K] [-l level] [-L file] [-p port] [-P PIDfile] [-q] [-r] [-s] [-T time] [-u] [-v] [-V] [-y confdir] [-Y driverdir]\nOptions: -b set database server port\n -D select database server (mysql|pgsql|sqlite|sqlite3)\n -e set log destination to dest (0-2)\n -h prints this help\n -i set server IP address to address\n -I allow remote connections\n -k keep periodical names when deleting references\n -K activate automatic keyword scan\n -l set the log level to level (0<=level<=7)\n -L use file as log-file (full path)\n -p set refdbd port\n -P set path to PID file\n -q ignore init-file\n -r allow remote administration\n -s run standalone, not as daemon\n -T set timeout to time\n -U uppercase citation keys (for SGML)\n -v show version information\n -V switch to verbose mode\n -y look for configuration files in confdir\n -Y look for dbi drivers in driverdir\n"); + fprintf(stderr, "Usage: refdbd [-b dbs_port] [-d database] [-D dbserver] [-e dest] [-E encoding] [-h] [-i address] [-I] [-k] [-K] [-l level] [-L file] [-m time] [-p port] [-P PIDfile] [-q] [-r] [-s] [-T time] [-u] [-v] [-V] [-y confdir] [-Y driverdir]\nOptions: -b set database server port\n -D select database server (mysql|pgsql|sqlite|sqlite3)\n -e set log destination to dest (0-2)\n -h prints this help\n -i set server IP address to address\n -I allow remote connections\n -k keep periodical names when deleting references\n -K activate automatic keyword scan\n -l set the log level to level (0<=level<=7)\n -L use file as log-file (full path)\n -m set database timeout to time\n -p set refdbd port\n -P set path to PID file\n -q ignore init-file\n -r allow remote administration\n -s run standalone, not as daemon\n -T set timeout to time\n -U uppercase citation keys (for SGML)\n -v show version information\n -V switch to verbose mode\n -y look for configuration files in confdir\n -Y look for dbi drivers in driverdir\n"); free(ptr_clrequest); exit (0); @@ -322,4 +325,8 @@ log_file[PREFS_BUF_LEN-1] = '\0'; break; + case 'm': + strncpy(db_timeout, optarg, PREFS_BUF_LEN); + db_timeout[PREFS_BUF_LEN - 1] = '\0'; + break; case 'p': strncpy(port_address, optarg, PREFS_BUF_LEN); @@ -381,4 +388,5 @@ n_remote_connect = (*remote_connect == 't') ? 1:0; nongeek_offset = atoi(ng_offset); + ptr_clrequest->db_timeout = atoi(db_timeout); /* uppercase the encoding names */ @@ -1184,4 +1192,5 @@ dbi_initialize(NULL); } + LOG_PRINT(LOG_INFO, "dbi is up"); n_dbi_is_up++; @@ -1771,4 +1780,6 @@ ptr_biblio_info->encoding = ptr_child_clrequest->db_encoding; +/* printf("child sleeps PID=%d\n", getpid()); */ +/* sleep(10); */ retval = getbib(ptr_child_clrequest, ptr_biblio_info, ref_format, n_send_stylespec, ptr_addresult); Index: refdbd.h.in =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.h.in,v retrieving revision 1.7.2.9 retrieving revision 1.7.2.10 diff -u -U2 -r1.7.2.9 -r1.7.2.10 --- refdbd.h.in 7 Sep 2005 23:45:02 -0000 1.7.2.9 +++ refdbd.h.in 17 Sep 2005 21:34:32 -0000 1.7.2.10 @@ -43,4 +43,5 @@ int inargc; /* number of parsed arguments */ int protocol; /* protocol version */ + int db_timeout; /* db-engine specific timeout (sqlite/sqlite3) */ char** inargv; /* ptr to array of parsed arguments */ char username[USERNAME_LENGTH]; /* username for database authentication */ |