mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 01:37:04 +00:00
Merged and updated to latest PTR build 9704
This commit is contained in:
commit
a2d3941588
22 changed files with 376 additions and 454 deletions
|
|
@ -77,14 +77,14 @@ bool DatabasePostgre::Initialize(const char *infoString)
|
|||
|
||||
Tokens::iterator iter;
|
||||
|
||||
std::string host, port_or_socket, user, password, database;
|
||||
std::string host, port_or_socket_dir, user, password, database;
|
||||
|
||||
iter = tokens.begin();
|
||||
|
||||
if(iter != tokens.end())
|
||||
host = *iter++;
|
||||
if(iter != tokens.end())
|
||||
port_or_socket = *iter++;
|
||||
port_or_socket_dir = *iter++;
|
||||
if(iter != tokens.end())
|
||||
user = *iter++;
|
||||
if(iter != tokens.end())
|
||||
|
|
@ -92,7 +92,10 @@ bool DatabasePostgre::Initialize(const char *infoString)
|
|||
if(iter != tokens.end())
|
||||
database = *iter++;
|
||||
|
||||
mPGconn = PQsetdbLogin(host.c_str(), port_or_socket.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str());
|
||||
if (host == ".")
|
||||
mPGconn = PQsetdbLogin(NULL, port_or_socket_dir == "." ? NULL : port_or_socket_dir.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str());
|
||||
else
|
||||
mPGconn = PQsetdbLogin(host.c_str(), port_or_socket_dir.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str());
|
||||
|
||||
/* check to see that the backend connection was successfully made */
|
||||
if (PQstatus(mPGconn) != CONNECTION_OK)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7483"
|
||||
#define REVISION_NR "7490"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue