Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7e95337d
Commit
7e95337d
authored
Dec 18, 2010
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly print the IP number and "localhost" for failed localhost
connections when the server is down, on Win32.
parent
4754dbf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+12
-7
No files found.
src/interfaces/libpq/fe-connect.c
View file @
7e95337d
...
...
@@ -1030,20 +1030,25 @@ connectFailureMessage(PGconn *conn, int errorno)
else
strcpy
(
host_addr
,
"???"
);
/*
* If the user did not supply an IP address using 'hostaddr', and
* 'host' was missing or does not match our lookup, display the
* looked-up IP address.
*/
display_host_addr
=
(
conn
->
pghostaddr
==
NULL
)
&&
(
conn
->
pghost
!=
NULL
)
&&
(
strcmp
(
conn
->
pghost
,
host_addr
)
!=
0
);
(
(
conn
->
pghost
==
NULL
)
||
(
strcmp
(
conn
->
pghost
,
host_addr
)
!=
0
)
);
appendPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"could not connect to server: %s
\n
"
"
\t
Is the server running on host
\"
%s
\"
%s%s%s and accepting
\n
"
"
\t
TCP/IP connections on port %s?
\n
"
),
SOCK_STRERROR
(
errorno
,
sebuf
,
sizeof
(
sebuf
)),
conn
->
pghostaddr
(
conn
->
pghostaddr
&&
conn
->
pghostaddr
[
0
]
!=
'\0'
)
?
conn
->
pghostaddr
:
(
conn
->
pghost
:
(
conn
->
pghost
&&
conn
->
pghost
[
0
]
!=
'\0'
)
?
conn
->
pghost
:
"???"
)
,
:
DefaultHost
,
/* display the IP address only if not already output */
display_host_addr
?
" ("
:
""
,
display_host_addr
?
host_addr
:
""
,
...
...
@@ -1304,7 +1309,7 @@ connectDBStart(PGconn *conn)
UNIXSOCK_PATH
(
portstr
,
portnum
,
conn
->
pgunixsocket
);
#else
/* Without Unix sockets, default to localhost instead */
node
=
"localhost"
;
node
=
DefaultHost
;
hint
.
ai_family
=
AF_UNSPEC
;
#endif
/* HAVE_UNIX_SOCKETS */
}
...
...
@@ -3388,7 +3393,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
/* hostname */
hostname
=
url
+
strlen
(
LDAP_URL
);
if
(
*
hostname
==
'/'
)
/* no hostname? */
hostname
=
"localhost"
;
/* the default */
hostname
=
DefaultHost
;
/* the default */
/* dn, "distinguished name" */
p
=
strchr
(
url
+
strlen
(
LDAP_URL
),
'/'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment