| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e59697c commit 4451019
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,7 +140,9 @@ exports.createSecureContext = function createSecureContext(options, context) { | |||
| 140 | 140 | } | |
| 141 | 141 | } | |
| 142 | 142 | ||
| 143 | - // Do not keep read/write buffers in free list | ||
| 143 | + // Do not keep read/write buffers in free list for OpenSSL < 1.1.0. (For | ||
| 144 | + // OpenSSL 1.1.0, buffers are malloced and freed without the use of a | ||
| 145 | + // freelist.) | ||
| 144 | 146 | if (options.singleUse) { | |
| 145 | 147 | c.singleUse = true; | |
| 146 | 148 | c.context.setFreeListLength(0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1148,10 +1148,14 @@ void SecureContext::SetTicketKeys(const FunctionCallbackInfo<Value>& args) { | |||
| 1148 | 1148 | ||
| 1149 | 1149 | ||
| 1150 | 1150 | void SecureContext::SetFreeListLength(const FunctionCallbackInfo<Value>& args) { | |
| 1151 | + #if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(OPENSSL_IS_BORINGSSL) | ||
| 1152 | + // |freelist_max_len| was removed in OpenSSL 1.1.0. In that version OpenSSL | ||
| 1153 | + // mallocs and frees buffers directly, without the use of a freelist. | ||
| 1151 | 1154 | SecureContext* wrap; | |
| 1152 | 1155 | ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); | |
| 1153 | 1156 | ||
| 1154 | 1157 | wrap->ctx_->freelist_max_len = args[0]->Int32Value(); | |
| 1158 | + #endif | ||
| 1155 | 1159 | } | |
| 1156 | 1160 | ||
| 1157 | 1161 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments