Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5e4c9b3

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 77b4101 commit 5e4c9b3

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

configure

+11
Original file line numberDiff line numberDiff line change
@@ -8511,6 +8511,17 @@ else
85118511
as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
85128512
fi
85138513

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

configure.in

+1
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,7 @@ if test "$with_openssl" = yes ; then
951951
if test "$PORTNAME" != "win32"; then
952952
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
953953
AC_CHECK_LIB(ssl, SSL_library_init, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
954+
AC_CHECK_FUNCS([SSL_get_current_compression])
954955
else
955956
AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
956957
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

+3
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,9 @@
433433
/* Define to 1 if you have the `srandom' function. */
434434
#undef HAVE_SRANDOM
435435

436+
/* Define to 1 if you have the `SSL_get_current_compression' function. */
437+
#undef HAVE_SSL_GET_CURRENT_COMPRESSION
438+
436439
/* Define to 1 if you have the <stdint.h> header file. */
437440
#undef HAVE_STDINT_H
438441

src/include/pg_config.h.win32

+3
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@
340340
/* Define to 1 if you have the `srandom' function. */
341341
/* #undef HAVE_SRANDOM */
342342

343+
/* Define to 1 if you have the `SSL_get_current_compression' function. */
344+
#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
345+
343346
/* Define to 1 if you have the <stdint.h> header file. */
344347
/* #undef HAVE_STDINT_H */
345348

src/include/port.h

+4
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)