Skip to content

Commit 362785f

Browse files
committed
Disable compression with OpenSSL.
This improves memory and speed. Users may apply compression in "userland" above the CryptoStream layer if they desire.
1 parent 4877279 commit 362785f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/node_crypto.cc

+12-3
Original file line numberDiff line numberDiff line change
@@ -2904,9 +2904,6 @@ class Verify : public ObjectWrap {
29042904
};
29052905

29062906

2907-
2908-
2909-
29102907
void InitCrypto(Handle<Object> target) {
29112908
HandleScope scope;
29122909

@@ -2916,6 +2913,18 @@ void InitCrypto(Handle<Object> target) {
29162913
SSL_load_error_strings();
29172914
ERR_load_crypto_strings();
29182915

2916+
// Turn off compression. Saves memory - do it in userland.
2917+
STACK_OF(SSL_COMP)* comp_methods = SSL_COMP_get_compression_methods();
2918+
#if 0
2919+
if (comp_methods && sk_SSL_COMP_num(comp_methods) > 0) {
2920+
default_compression_method = sk_SSL_COMP_pop(comp_methods);
2921+
fprintf(stderr, "SSL_COMP_get_name %s\n",
2922+
SSL_COMP_get_name(default_compression_method->method));
2923+
}
2924+
#endif
2925+
sk_SSL_COMP_zero(comp_methods);
2926+
assert(sk_SSL_COMP_num(comp_methods) == 0);
2927+
29192928
SecureContext::Initialize(target);
29202929
Connection::Initialize(target);
29212930
Cipher::Initialize(target);

0 commit comments

Comments
 (0)