Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit467839d

Browse files
committed
Handle threading in two more gethostbyname calls.
1 parenta16a031 commit467839d

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

‎src/interfaces/libpq/fe-secure.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v 1.24 2003/06/1417:49:54 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v 1.25 2003/06/1418:20:32 momjian Exp $
1515
*
1616
* NOTES
1717
* The client *requires* a valid server certificate. Since
@@ -453,8 +453,17 @@ verify_peer(PGconn *conn)
453453
if (addr.sa_family==AF_UNIX)
454454
return0;
455455

456+
{
457+
structhostenthpstr;
458+
charbuf[BUFSIZ];
459+
intherrno=0;
460+
461+
pqGethostbyname(conn->peer_cn,&hpstr,buf,sizeof(buf),
462+
&h,&herrno);
463+
}
464+
456465
/* what do we know about the peer's common name? */
457-
if ((h=gethostbyname(conn->peer_cn))==NULL)
466+
if ((h==NULL)
458467
{
459468
printfPQExpBuffer(&conn->errorMessage,
460469
libpq_gettext("could not get information about host (%s): %s\n"),

‎src/port/getaddrinfo.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/port/getaddrinfo.c,v 1.7 2003/06/12 08:15:29 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/port/getaddrinfo.c,v 1.8 2003/06/14 18:20:33 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -84,8 +84,16 @@ getaddrinfo(const char *node, const char *service,
8484
else
8585
{
8686
structhostent*hp;
87-
87+
#ifdefFRONTEND
88+
structhostenthpstr;
89+
charbuf[BUFSIZ];
90+
intherrno=0;
91+
92+
pqGethostbyname(node,&hpstr,buf,sizeof(buf),
93+
&hp,&herrno);
94+
#else
8895
hp=gethostbyname(node);
96+
#endif
8997
if (hp==NULL)
9098
{
9199
switch (h_errno)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp