]> granicus.if.org Git - pdns/commitdiff
add --gpgsql-port support (Matthijs)
authorBert Hubert <bert.hubert@netherlabs.nl>
Sat, 9 Apr 2005 17:15:03 +0000 (17:15 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sat, 9 Apr 2005 17:15:03 +0000 (17:15 +0000)
drop old dependency on -lpq++ (Matthijs)

git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@340 d19b8d6e-7fed-0310-83ef-9ca221ded41b

modules/gpgsqlbackend/Makefile.am
modules/gpgsqlbackend/gpgsqlbackend.cc
modules/gpgsqlbackend/spgsql.cc
modules/gpgsqlbackend/spgsql.hh

index cedaf23611b2afa7c7b8d20296b0013e93f59f15..2395aae84fb16fc02687f3e28fa5c2bb9d13b9e0 100644 (file)
@@ -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
index d00b19cddf1c78d0918e2908de89c697e3736fa0..1aaebca464f89006cdc25cfc12d1ab1e7a8462b0 100644 (file)
@@ -1,4 +1,3 @@
-// $Id: gpgsqlbackend.cc,v 1.4 2004/09/13 19:07:00 ahu Exp $ 
 #include <string>
 #include <map>
 
@@ -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","");
 
index df3e6950b0f5041bced1e3c452a10641fbdcc757..7cd86404392400439fb7225aec0674f7f6d827a3 100644 (file)
@@ -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 <string>
 #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;
 
index 0057725ba626d81428fb550bc9b15e7945d42683..bea5db8c062ad72e8623f54dcf9529aac09cc948 100644 (file)
@@ -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="");