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

Commit8fb5936

Browse files
committed
Make the memory layout of Port struct independent of USE_OPENSSL
Commitd39a49c added new fields to the struct, but missed the "keepthese last" comment on the previous fields. Add placeholder variablesso that the offsets of the fields are the same whether you build withUSE_OPENSSL or not. This is a courtesy to extensions that might peekat the fields, to make the ABI the same regardless of the options usedto build PostgreSQL.In reality, I don't expect any extensions to look at the 'raw_buf'fields. Firstly, they are new in v17, so no one's written suchextensions yet. Secondly, extensions should have no business poking atthose fields anyway. Nevertheless, fix this properly on 'master'. Onv17, we mustn't change the memory layout, so just fix the comments.Author: Jacob ChampionDiscussion:https://www.postgresql.org/message-id/raw/CAOYmi%2BmKVJNzn5_TD_MK%3DhqO64r_w8Gb0FHCLk0oAkW-PJv8jQ@mail.gmail.com
1 parentee937f0 commit8fb5936

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/include/libpq/libpq-be.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,17 @@ typedef struct Port
207207
boollast_read_was_eof;
208208

209209
/*
210-
* OpenSSL structures. (Keep these last so that the locations of other
211-
* fields are the same whether or not you build with SSL enabled.)
210+
* OpenSSL structures. As with GSSAPI above, to keep struct offsets
211+
* constant, NULL pointers are stored when SSL support is not enabled.
212+
* (Although extensions should have no business accessing the raw_buf
213+
* fields anyway.)
212214
*/
213215
#ifdefUSE_OPENSSL
214216
SSL*ssl;
215217
X509*peer;
218+
#else
219+
void*ssl;
220+
void*peer;
216221
#endif
217222

218223
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp