summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-03-31 19:27:28 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-04-01 09:49:25 -0700
commit362785f704b5754f6025bc4bcbe5835688d3002c (patch)
tree05ea4b2205fb59ac3230a39936bd971945e6ecda /src
parent4877279efa9eb6c8dce51081df52e8f48750b61a (diff)
downloadnode-new-362785f704b5754f6025bc4bcbe5835688d3002c.tar.gz
Disable compression with OpenSSL.
This improves memory and speed. Users may apply compression in "userland" above the CryptoStream layer if they desire.
Diffstat (limited to 'src')
-rw-r--r--src/node_crypto.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 14b267fb2c..b1369d694e 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -2904,9 +2904,6 @@ class Verify : public ObjectWrap {
};
-
-
-
void InitCrypto(Handle<Object> target) {
HandleScope scope;
@@ -2916,6 +2913,18 @@ void InitCrypto(Handle<Object> target) {
SSL_load_error_strings();
ERR_load_crypto_strings();
+ // Turn off compression. Saves memory - do it in userland.
+ STACK_OF(SSL_COMP)* comp_methods = SSL_COMP_get_compression_methods();
+#if 0
+ if (comp_methods && sk_SSL_COMP_num(comp_methods) > 0) {
+ default_compression_method = sk_SSL_COMP_pop(comp_methods);
+ fprintf(stderr, "SSL_COMP_get_name %s\n",
+ SSL_COMP_get_name(default_compression_method->method));
+ }
+#endif
+ sk_SSL_COMP_zero(comp_methods);
+ assert(sk_SSL_COMP_num(comp_methods) == 0);
+
SecureContext::Initialize(target);
Connection::Initialize(target);
Cipher::Initialize(target);