Skip to content

Commit c9e1ad7

Browse files
committed
Detect presence of SSL_get_current_compression
Apparently we still build against OpenSSL so old that it doesn't have this function, so add an autoconf check for it to make the buildfarm happy. If the function doesn't exist, always return that compression is disabled, since presumably the actual compression functionality is always missing. For now, hardcode the function as present on MSVC, since we should hopefully be well beyond those old versions on that platform.
1 parent f9ddcf7 commit c9e1ad7

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

configure

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8509,6 +8509,17 @@ else
85098509
as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
85108510
fi
85118511

8512+
for ac_func in SSL_get_current_compression
8513+
do :
8514+
ac_fn_c_check_func "$LINENO" "SSL_get_current_compression" "ac_cv_func_SSL_get_current_compression"
8515+
if test "x$ac_cv_func_SSL_get_current_compression" = xyes; then :
8516+
cat >>confdefs.h <<_ACEOF
8517+
#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
8518+
_ACEOF
8519+
8520+
fi
8521+
done
8522+
85128523
else
85138524
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
85148525
$as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }

configure.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ if test "$with_openssl" = yes ; then
950950
if test "$PORTNAME" != "win32"; then
951951
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
952952
AC_CHECK_LIB(ssl, SSL_library_init, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
953+
AC_CHECK_FUNCS([SSL_get_current_compression])
953954
else
954955
AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
955956
AC_SEARCH_LIBS(SSL_library_init, ssleay32 ssl, [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])

src/include/pg_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,9 @@
430430
/* Define to 1 if you have the `srandom' function. */
431431
#undef HAVE_SRANDOM
432432

433+
/* Define to 1 if you have the `SSL_get_current_compression' function. */
434+
#undef HAVE_SSL_GET_CURRENT_COMPRESSION
435+
433436
/* Define to 1 if you have the <stdint.h> header file. */
434437
#undef HAVE_STDINT_H
435438

src/include/pg_config.h.win32

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@
337337
/* Define to 1 if you have the `srandom' function. */
338338
/* #undef HAVE_SRANDOM */
339339

340+
/* Define to 1 if you have the `SSL_get_current_compression' function. */
341+
#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
342+
340343
/* Define to 1 if you have the <stdint.h> header file. */
341344
/* #undef HAVE_STDINT_H */
342345

src/include/port.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@ extern void unsetenv(const char *name);
420420
extern void srandom(unsigned int seed);
421421
#endif
422422

423+
#ifndef HAVE_SSL_GET_CURRENT_COMPRESSION
424+
#define SSL_get_current_compression(x) 0
425+
#endif
426+
423427
/* thread.h */
424428
extern char *pqStrerror(int errnum, char *strerrbuf, size_t buflen);
425429

0 commit comments

Comments
 (0)