Module: sip-router
Branch: janakj/postgres
Commit: 61ee30f2de9138dae297d0b740e5879357e1145a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=61ee30f…
Author: Greg Fausak <lgfausak(a)august.net>
Committer: Greg Fausak <lgfausak(a)august.net>
Date: Sun Feb 8 15:30:59 2004 +0000
Jan's changes, his comments:
Attached patch makes postgres module in the unstable branch compile and
load again (it didn't compile because of some changes I did a couple
days ago).
The changes are cosmetic only.
I did verify that the code compiled in the current branch. I did
not test this version.
---
modules/db_postgres/con_postgres.h | 2 ++
modules/db_postgres/db_con.c | 2 +-
modules/db_postgres/db_mod.c | 1 +
modules/db_postgres/db_res.c | 1 +
4 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/modules/db_postgres/con_postgres.h b/modules/db_postgres/con_postgres.h
index dbf3211..5de0aee 100644
--- a/modules/db_postgres/con_postgres.h
+++ b/modules/db_postgres/con_postgres.h
@@ -46,6 +46,7 @@
* Postgres specific connection data
*/
struct con_postgres {
+ int connected;
char *sqlurl; /* the url we are connected to, all connection memory
parents from this */
PGconn *con; /* this is the postgres connection */
@@ -60,6 +61,7 @@ struct con_postgres {
#define CON_CONNECTION(db_con) (((struct con_postgres*)((db_con)->tail))->con)
#define CON_FP(db_con) (((struct con_postgres*)((db_con)->tail))->fp)
#define CON_PID(db_con) (((struct con_postgres*)((db_con)->tail))->tpid)
+#define CON_CONNECTED(db_con) (((struct
con_postgres*)((db_con)->tail))->connected)
#define PLOG(f,s) LOG(L_ERR, "PG[%d] %s %s\n",__LINE__,f,s)
#define DLOG(f,s) LOG(L_INFO, "PG[%d] %s %s\n",__LINE__,f,s)
diff --git a/modules/db_postgres/db_con.c b/modules/db_postgres/db_con.c
index 5ee03d1..52a4fe1 100644
--- a/modules/db_postgres/db_con.c
+++ b/modules/db_postgres/db_con.c
@@ -37,12 +37,12 @@
*/
#include <string.h>
-#include "../../db/db_con.h"
#include "../../dprint.h"
#include "../../mem/mem.h"
#include "defs.h"
#include "con_postgres.h"
#include "aug_std.h"
+#include "db_con.h"
/*
* Store name of table that will be used by
diff --git a/modules/db_postgres/db_mod.c b/modules/db_postgres/db_mod.c
index c53bddf..8d7b124 100644
--- a/modules/db_postgres/db_mod.c
+++ b/modules/db_postgres/db_mod.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include "../../sr_module.h"
+#include "db_con.h"
#include "dbase.h"
MODULE_VERSION
diff --git a/modules/db_postgres/db_res.c b/modules/db_postgres/db_res.c
index d9ac598..d8be1d7 100644
--- a/modules/db_postgres/db_res.c
+++ b/modules/db_postgres/db_res.c
@@ -38,6 +38,7 @@
#include <stdlib.h>
#include "../../db/db_res.h"
+#include "../../db/db_con.h"
#include "../../dprint.h"
#include "../../mem/mem.h"
#include "defs.h"