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

Commitf17549f

Browse files
committed
Fix logic of platform-depended sockoptions
1 parentaf41cb5 commitf17549f

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ setKeepalivesIdle(PGconn *conn)
14451445
idle=0;
14461446

14471447
#ifdefPG_TCP_KEEPALIVE_IDLE
1448-
if (pg_setsockopt(conn->sock,IPPROTO_TCP,TCP_KEEPIDLE,
1448+
if (pg_setsockopt(conn->sock,IPPROTO_TCP,PG_TCP_KEEPALIVE_IDLE,
14491449
(char*)&idle,sizeof(idle),conn->isRsocket)<0)
14501450
{
14511451
charsebuf[256];
@@ -1456,20 +1456,6 @@ setKeepalivesIdle(PGconn *conn)
14561456
SOCK_STRERROR(SOCK_ERRNO,sebuf,sizeof(sebuf)));
14571457
return0;
14581458
}
1459-
#else
1460-
#ifdefTCP_KEEPALIVE
1461-
/* Darwin uses TCP_KEEPALIVE rather than TCP_KEEPIDLE */
1462-
if (pg_setsockopt(conn->sock,IPPROTO_TCP,TCP_KEEPALIVE,
1463-
(char*)&idle,sizeof(idle),conn->isRsocket)<0)
1464-
{
1465-
charsebuf[256];
1466-
1467-
appendPQExpBuffer(&conn->errorMessage,
1468-
libpq_gettext("setsockopt(TCP_KEEPALIVE) failed: %s\n"),
1469-
SOCK_STRERROR(SOCK_ERRNO,sebuf,sizeof(sebuf)));
1470-
return0;
1471-
}
1472-
#endif
14731459
#endif
14741460

14751461
return1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp