From: Bert Hubert Date: Sat, 9 Apr 2005 17:15:03 +0000 (+0000) Subject: add --gpgsql-port support (Matthijs) X-Git-Tag: pdns-2.9.18~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39bdc7e9f020413d86935ad4114de55c1c8e4d8c;p=pdns add --gpgsql-port support (Matthijs) drop old dependency on -lpq++ (Matthijs) git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@340 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/modules/gpgsqlbackend/Makefile.am b/modules/gpgsqlbackend/Makefile.am index cedaf2361..2395aae84 100644 --- a/modules/gpgsqlbackend/Makefile.am +++ b/modules/gpgsqlbackend/Makefile.am @@ -6,7 +6,7 @@ INCLUDES=-I@PGSQL_incdir@ libgpgsqlbackend_la_SOURCES=gpgsqlbackend.cc gpgsqlbackend.hh \ spgsql.hh spgsql.cc -libgpgsqlbackend_la_LDFLAGS=@PGSQL_lib@ -Wl,-Bstatic -lpq++ -lpq \ +libgpgsqlbackend_la_LDFLAGS=@PGSQL_lib@ -Wl,-Bstatic -lpq \ -Wl,-Bdynamic libgpgsqlbackend_la_LIBADD=-lssl -lcrypt -lcrypto diff --git a/modules/gpgsqlbackend/gpgsqlbackend.cc b/modules/gpgsqlbackend/gpgsqlbackend.cc index d00b19cdd..1aaebca46 100644 --- a/modules/gpgsqlbackend/gpgsqlbackend.cc +++ b/modules/gpgsqlbackend/gpgsqlbackend.cc @@ -1,4 +1,3 @@ -// $Id: gpgsqlbackend.cc,v 1.4 2004/09/13 19:07:00 ahu Exp $ #include #include @@ -23,6 +22,7 @@ gPgSQLBackend::gPgSQLBackend(const string &mode, const string &suffix) : GSQLBa try { setDB(new SPgSQL(getArg("dbname"), getArg("host"), + getArg("port"), getArg("socket"), getArg("user"), getArg("password"))); @@ -47,6 +47,7 @@ public: declare(suffix,"dbname","Pdns backend database name to connect to","powerdns"); declare(suffix,"user","Pdns backend user to connect as","powerdns"); declare(suffix,"host","Pdns backend host to connect to",""); + declare(suffix,"port","Database backend port to connect to",""); declare(suffix,"socket","Pdns backend socket to connect to",""); declare(suffix,"password","Pdns backend password to connect with",""); diff --git a/modules/gpgsqlbackend/spgsql.cc b/modules/gpgsqlbackend/spgsql.cc index df3e6950b..7cd864043 100644 --- a/modules/gpgsqlbackend/spgsql.cc +++ b/modules/gpgsqlbackend/spgsql.cc @@ -1,6 +1,5 @@ -/* Copyright 2003 Netherlabs BV, bert.hubert@netherlabs.nl. See LICENSE - for more information. - $Id: spgsql.cc,v 1.4 2004/01/17 13:18:22 ahu Exp $ */ +/* Copyright 2003 - 2005 Netherlabs BV, bert.hubert@netherlabs.nl. See LICENSE + for more information. */ #include #include "spgsql.hh" @@ -12,7 +11,7 @@ using namespace std; bool SPgSQL::s_dolog; -SPgSQL::SPgSQL(const string &database, const string &host, const string &msocket, const string &user, +SPgSQL::SPgSQL(const string &database, const string &host, const string& port, const string &msocket, const string &user, const string &password) { d_db=0; @@ -26,6 +25,9 @@ SPgSQL::SPgSQL(const string &database, const string &host, const string &msocket if(!host.empty()) connectstr+=" host="+host; + if(!port.empty()) + connectstr+=" port="+port; + if(!password.empty()) connectstr+=" password="+password; diff --git a/modules/gpgsqlbackend/spgsql.hh b/modules/gpgsqlbackend/spgsql.hh index 0057725ba..bea5db8c0 100644 --- a/modules/gpgsqlbackend/spgsql.hh +++ b/modules/gpgsqlbackend/spgsql.hh @@ -1,6 +1,5 @@ -/* Copyright 2001 Netherlabs BV, bert.hubert@netherlabs.nl. See LICENSE - for more information. - $Id: spgsql.hh,v 1.5 2004/01/17 13:18:22 ahu Exp $ */ +/* Copyright 2001 - 2005 Netherlabs BV, bert.hubert@netherlabs.nl. See LICENSE + for more information. */ #ifndef SPGSQL_HH #define SPGSQL_HH using namespace std; @@ -10,7 +9,7 @@ using namespace std; class SPgSQL : public SSql { public: - SPgSQL(const string &database, const string &host="", + SPgSQL(const string &database, const string &host="", const string& port="", const string &msocket="",const string &user="", const string &password="");