Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
crypto: check for SSL_COMP_get_compression_methods()
Browse files Browse the repository at this point in the history
Function was named SSL_COMP_get_compression_method() (singular)
in OpenSSL 0.9.7 and older.

Fixes #1242.
  • Loading branch information
bnoordhuis committed Jul 20, 2011
1 parent 0599cb7 commit 6f0740e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3638,9 +3638,14 @@ void InitCrypto(Handle<Object> target) {
ERR_load_crypto_strings();

// Turn off compression. Saves memory - do it in userland.
#ifdef SSL_COMP_get_compression_methods
// Before OpenSSL 0.9.8 this was not possible.
STACK_OF(SSL_COMP)* comp_methods = SSL_COMP_get_compression_methods();
#if !defined(OPENSSL_NO_COMP)
STACK_OF(SSL_COMP)* comp_methods =
#if OPENSSL_VERSION_NUMBER < 0x00908000L
SSL_COMP_get_compression_method()
#else
SSL_COMP_get_compression_methods()
#endif
;
sk_SSL_COMP_zero(comp_methods);
assert(sk_SSL_COMP_num(comp_methods) == 0);
#endif
Expand Down

0 comments on commit 6f0740e

Please sign in to comment.