Module: sip-router
Branch: janakj/bdb
Commit: 873c8d310fb3769aa343788c9a5fbbc7b05df5ed
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=873c8d3…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Fri Feb 8 14:32:23 2008 +0000
- port db_text and db_berkeley to the new core DB API
- remove free_* methods that are not needed anymore
- adjust structure to the other SQL based modules
- basic queries works, but otherwise not that much tested
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3668 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_berkeley/km_bdb_res.c | 426 ++++++++--------------------------
modules/db_berkeley/km_bdb_res.h | 5 -
modules/db_berkeley/km_bdb_val.c | 2 +
modules/db_berkeley/km_db_berkeley.c | 10 +-
4 files changed, 107 insertions(+), 336 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=873…
Module: sip-router
Branch: janakj/bdb
Commit: 1bae0321cddb37c8fa9e3f58f9df1b5efee814aa
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1bae032…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Wed Feb 6 15:46:09 2008 +0000
further changes after the db name change
- update INSTALL file
- fix Makefile skip modules variable
- fix module Makefile, lib name
- change db_bind_mod to add the db prefix in the function
- change db url defines in db_berkeley and db_text
- change database modules names in module struct
- fix debian packaging
- fix tests
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3642 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_berkeley/km_README | 4 ++--
modules/db_berkeley/km_db_berkeley.c | 2 +-
modules/db_berkeley/km_doc/db_berkeley_user.sgml | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/db_berkeley/km_README b/modules/db_berkeley/km_README
index 1f7dda5..4cc84b4 100644
--- a/modules/db_berkeley/km_README
+++ b/modules/db_berkeley/km_README
@@ -228,8 +228,8 @@ by default none is loaded
Modify the OpenSER configuration file to use db_berkeley
module. The database URL for modules must be the path to the
directory where the Berkeley DB table-files are located,
- prefixed by "db_berkeley://", e.g.,
- "db_berkeley:///usr/local/etc/openser/db_berkeley".
+ prefixed by "berkeley://", e.g.,
+ "berkeley:///usr/local/etc/openser/db_berkeley".
A couple other IMPORTANT things to consider are the 'db_mode'
and the 'use_domain' modparams. The description of these
diff --git a/modules/db_berkeley/km_db_berkeley.c b/modules/db_berkeley/km_db_berkeley.c
index 74fea05..7c69751 100644
--- a/modules/db_berkeley/km_db_berkeley.c
+++ b/modules/db_berkeley/km_db_berkeley.c
@@ -47,7 +47,7 @@
#define CFG_DIR "/tmp"
#endif
-#define BDB_ID "db_berkeley://"
+#define BDB_ID "berkeley://"
#define BDB_ID_LEN (sizeof(BDB_ID)-1)
#define BDB_PATH_LEN 256
diff --git a/modules/db_berkeley/km_doc/db_berkeley_user.sgml b/modules/db_berkeley/km_doc/db_berkeley_user.sgml
index c08222f..b2bd6e3 100644
--- a/modules/db_berkeley/km_doc/db_berkeley_user.sgml
+++ b/modules/db_berkeley/km_doc/db_berkeley_user.sgml
@@ -253,8 +253,8 @@ modparam("db_berkeley", "journal_roll_interval", 3600)
<para>
Modify the OpenSER configuration file to use db_berkeley module.
The database URL for modules must be the path to the directory where
- the Berkeley DB table-files are located, prefixed by "db_berkeley://",
- e.g., "db_berkeley:///usr/local/etc/openser/db_berkeley".
+ the Berkeley DB table-files are located, prefixed by "berkeley://",
+ e.g., "berkeley:///usr/local/etc/openser/db_berkeley".
</para>
<para>
Module: sip-router
Branch: janakj/bdb
Commit: 0b20fe03d98988177ca55954bfbc14d50feb9f2b
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0b20fe0…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Wed Feb 27 13:53:33 2008 +0000
- first round of cleanups for documentation
- remove all FAQ and DEVEL files considered empty in content (no content at all
or just the default lines)
- remove of the <RevHistory>/</RevHistory> tag (and of course anything between
them)
- remove the comments at the end of the file that begins with
"<!-- Keep this element at the end of the file"
- credits for the patch/ the change scripts goes to Edson Gellert Schubert,
4lists at gmail dot com
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3769 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_berkeley/km_doc/db_berkeley_devel.sgml | 22 -------
modules/db_berkeley/km_doc/db_berkeley_faq.sgml | 70 ---------------------
modules/db_berkeley/km_doc/db_berkeley_user.sgml | 11 ---
3 files changed, 0 insertions(+), 103 deletions(-)
diff --git a/modules/db_berkeley/km_doc/db_berkeley_devel.sgml b/modules/db_berkeley/km_doc/db_berkeley_devel.sgml
deleted file mode 100644
index 1c666a4..0000000
--- a/modules/db_berkeley/km_doc/db_berkeley_devel.sgml
+++ /dev/null
@@ -1,22 +0,0 @@
-<!-- Module Developer's Guide -->
-
-<chapter>
- <chapterinfo>
- <revhistory>
- <revision>
- <revnumber>$Revision: 846 $</revnumber>
- <date>$Date: 2006-05-22 09:15:40 -0500 (Mon, 22 May 2006) $</date>
- </revision>
- </revhistory>
- </chapterinfo>
- <title>Developer's Guide</title>
- <para>
- The module does not provide any <acronym>API</acronym> to use in other &ser; modules.
- </para>
-</chapter>
-
-<!-- Keep this element at the end of the file
-Local Variables:
-sgml-parent-document: ("db_berkeley.sgml" "book" "chapter")
-End:
--->
diff --git a/modules/db_berkeley/km_doc/db_berkeley_faq.sgml b/modules/db_berkeley/km_doc/db_berkeley_faq.sgml
deleted file mode 100644
index 4fc364e..0000000
--- a/modules/db_berkeley/km_doc/db_berkeley_faq.sgml
+++ /dev/null
@@ -1,70 +0,0 @@
-<!-- Module FAQ -->
-
-<chapter>
- <chapterinfo>
- <revhistory>
- <revision>
- <revnumber>$Revision: 846 $</revnumber>
- <date>$Date: 2006-05-22 09:15:40 -0500 (Mon, 22 May 2006) $</date>
- </revision>
- </revhistory>
- </chapterinfo>
- <title>Frequently Asked Questions</title>
- <qandaset defaultlabel="number">
- <qandaentry>
- <question>
- <para>Where can I find more about OpenSER?</para>
- </question>
- <answer>
- <para>
- Take a look at &serhomelink;.
- </para>
- </answer>
- </qandaentry>
- <qandaentry>
- <question>
- <para>Where can I post a question about this module?</para>
- </question>
- <answer>
- <para>
- First at all check if your question was already answered on one of
- our mailing lists:
- </para>
- <itemizedlist>
- <listitem>
- <para>User Mailing List - &seruserslink;</para>
- </listitem>
- <listitem>
- <para>Developer Mailing List - &serdevlink;</para>
- </listitem>
- </itemizedlist>
- <para>
- E-mails regarding any stable &ser; release should be sent to
- &serusersmail; and e-mails regarding development versions
- should be sent to &serdevmail;.
- </para>
- <para>
- If you want to keep the mail private, send it to
- &serhelpmail;.
- </para>
- </answer>
- </qandaentry>
- <qandaentry>
- <question>
- <para>How can I report a bug?</para>
- </question>
- <answer>
- <para>
- Please follow the guidelines provided at:
- &serbugslink;.
- </para>
- </answer>
- </qandaentry>
- </qandaset>
-</chapter>
-
-<!-- Keep this element at the end of the file
-Local Variables:
-sgml-parent-document: ("db_berkeley.sgml" "Book" "chapter")
-End:
--->
diff --git a/modules/db_berkeley/km_doc/db_berkeley_user.sgml b/modules/db_berkeley/km_doc/db_berkeley_user.sgml
index b2bd6e3..affdf40 100644
--- a/modules/db_berkeley/km_doc/db_berkeley_user.sgml
+++ b/modules/db_berkeley/km_doc/db_berkeley_user.sgml
@@ -2,12 +2,6 @@
<chapter>
<chapterinfo>
- <revhistory>
- <revision>
- <revnumber>$Revision: 846 $</revnumber>
- <date>$Date: 2006-05-22 09:15:40 -0500 (Mon, 22 May 2006) $</date>
- </revision>
- </revhistory>
</chapterinfo>
<title>User's Guide</title>
@@ -587,8 +581,3 @@ usage: ./bdb_recover -s schemadir [-h home] [-R lastN]
</chapter>
-<!-- Keep this element at the end of the file
-Local Variables:
-sgml-parent-document: "db_berkeley.sgml" "Book" "chapter")
-End:
--->
Module: sip-router
Branch: janakj/bdb
Commit: 2eb8cc0833aef2a0dcacdb25c804c0187cd74a13
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2eb8cc0…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Mon Jan 7 14:26:27 2008 +0000
further cleanups in core database API
- move use_table and close function for SQL DBs to core
- move query, raw_query, insert, update, delete functions for SQL DBs to core
- all this functions were almost identical implemented in the three DB,
this functions uses now a function pointer based interface to do the work
- the use_table functions from dbtext and db_berkeley uses also now the core API
- move result management function from db_col to db_res to the other result
management functions, they are not useful alone
- change postgres module to match more the structure of mysql and unixodbc,
remove the 'PARANOID' #define, the other modules don't have this and prefix
all functions with db_postgres, make this more consistent to mysql module
- prefix all functions in unixodbc module with db_unixodbc, make this consistent
to the other modules, cleanup the namespace
- prefix val2str function in mysql with db_mysql too
- move the SQL_BUF_LENGTH to core API, all modules need this
- remove the static SQL char buffer from postgres and unixodbc, uses the one
provided from the core API
- move documentation from db/doc to API files in doxygen format
- improve and extend documentation for the whole API
- make database API const correct, to guard against implementation errors and
allow better compiler optimizations
- change interface free_connection function in SQL DBs to connection structure
to allow the usage of core API do_close
- fix indention for postgres driver and make logging messages consistent
- remove now unneeded system header includes for SQL DBs
- remove transaction related code from postgres driver, this is not used at all
and according to Klaus also brings no performance benefit if used.
- probably some other smaller cleanups
Tested with the testcases, so basic functionality should work.. Please test! :-)
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3506 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_berkeley/km_db_berkeley.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/modules/db_berkeley/km_db_berkeley.c b/modules/db_berkeley/km_db_berkeley.c
index b4ccc7c..8049baf 100644
--- a/modules/db_berkeley/km_db_berkeley.c
+++ b/modules/db_berkeley/km_db_berkeley.c
@@ -134,11 +134,7 @@ static void destroy(void)
int bdb_use_table(db_con_t* _h, const char* _t)
{
- if ((!_h) || (!_t))
- return -1;
-
- CON_TABLE(_h) = _t;
- return 0;
+ return db_use_table(_h, _t);
}
/*
Module: sip-router
Branch: janakj/bdb
Commit: b75657222b654f20d75408be5c2161a4b8880127
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b756572…
Author: Will Quan <wiquan(a)employees.org>
Committer: Will Quan <wiquan(a)employees.org>
Date: Wed Nov 28 20:34:07 2007 +0000
Moved definition of STANDARD_TABLES, EXTRA_TABLES, PRESENCE_TABLES to openserdbctl.base.
Add tables 'dispatcher' and 'dialog' to list of STANDARD_TABLES (Patch provided from Ovidiu Sas).
Modified bdb_lib::bdblib_create_table to return error if the table does not exist.
These are all fixes for Bug# 1836601: db_berkeley don't work
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3227 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_berkeley/km_bdb_lib.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/modules/db_berkeley/km_bdb_lib.c b/modules/db_berkeley/km_bdb_lib.c
index 54ee975..8b9f37f 100644
--- a/modules/db_berkeley/km_bdb_lib.c
+++ b/modules/db_berkeley/km_bdb_lib.c
@@ -543,6 +543,20 @@ void bdblib_log(int op, table_p _tp, char* _msg, int len)
}
/**
+ * The function is called to create a handle to a db table.
+ *
+ * On startup, we do not create any of the db handles.
+ * Instead it is done on first-use (lazy-initialized) to only create handles to
+ * files (db) that we require.
+ *
+ * There is one db file per openser table (eg. acc), and they should exist
+ * in your DB_PATH (refer to openserctlrc) directory.
+ *
+ * This function does _not_ create the underlying binary db tables.
+ * Creating the tables MUST be manually performed before
+ * openser startup by 'openserdbctl create'
+ *
+ * Function returns NULL on error, which will cause openser to exit.
*
*/
table_p bdblib_create_table(database_p _db, str *_s)
@@ -581,12 +595,12 @@ table_p bdblib_create_table(database_p _db, str *_s)
LM_DBG("CREATE TABLE = %s\n", tblname);
#endif
- flags = DB_CREATE | DB_THREAD;
+ flags = DB_THREAD;
if ((rc = bdb->open(bdb, NULL, tblname, NULL, DB_HASH, flags, 0664)) != 0)
{
_db->dbenv->err(_db->dbenv, rc, "DB->open: %s", tblname);
- LM_ERR("bdb open: %s.\n",db_strerror(rc));
+ LM_ERR("bdb open failed: %s.\n",db_strerror(rc));
pkg_free(tp);
return NULL;
}