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

Commit3c18409

Browse files
committed
libpq: If ALPN is not used, make PQsslAttribute(conn, "alpn") == ""
The documentation says that PQsslAttribute(conn, "alpn") returns anempty string if ALPN is not used, but the code actually returnedNULL. Fix the code to match the documentation.Reported-by: Michael PaquierDiscussion:https://www.postgresql.org/message-id/ZideNHji0G4gxmc3@paquier.xyz
1 parent592a228 commit3c18409

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/bin/psql/command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3896,7 +3896,7 @@ printSSLInfo(void)
38963896
protocol ?protocol :_("unknown"),
38973897
cipher ?cipher :_("unknown"),
38983898
(compression&&strcmp(compression,"off")!=0) ?_("on") :_("off"),
3899-
alpn ?alpn :_("none"));
3899+
(alpn&&alpn[0]!='\0') ?alpn :_("none"));
39003900
}
39013901

39023902
/*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ PQsslAttribute(PGconn *conn, const char *attribute_name)
18371837

18381838
SSL_get0_alpn_selected(conn->ssl,&data,&len);
18391839
if (data==NULL||len==0||len>sizeof(alpn_str)-1)
1840-
returnNULL;
1840+
return"";
18411841
memcpy(alpn_str,data,len);
18421842
alpn_str[len]=0;
18431843
returnalpn_str;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp