@@ -166,7 +166,6 @@ void SecureContext::Initialize(Handle<Object> target) {
166
166
NODE_SET_PROTOTYPE_METHOD (t, " addRootCerts" , SecureContext::AddRootCerts);
167
167
NODE_SET_PROTOTYPE_METHOD (t, " setCiphers" , SecureContext::SetCiphers);
168
168
NODE_SET_PROTOTYPE_METHOD (t, " setOptions" , SecureContext::SetOptions);
169
- NODE_SET_PROTOTYPE_METHOD (t, " clearOptions" , SecureContext::ClearOptions);
170
169
NODE_SET_PROTOTYPE_METHOD (t, " setSessionIdContext" ,
171
170
SecureContext::SetSessionIdContext);
172
171
NODE_SET_PROTOTYPE_METHOD (t, " close" , SecureContext::Close);
@@ -541,23 +540,21 @@ Handle<Value> SecureContext::SetCiphers(const Arguments& args) {
541
540
return True ();
542
541
}
543
542
544
- #define X (name, fn ) \
545
- Handle <Value> name (const Arguments& args) { \
546
- HandleScope scope; \
547
- SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder ()); \
548
- if (args.Length () != 1 || !args[0 ]->IsInt32 ()) { \
549
- return ThrowException ( \
550
- Exception::TypeError (String::New (" Bad parameter" ))); \
551
- } \
552
- fn (sc->ctx_ , args[0 ]->Int32Value ()); \
553
- return True (); \
543
+ Handle <Value> SecureContext::SetOptions (const Arguments& args) {
544
+ HandleScope scope;
545
+
546
+ SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder ());
547
+
548
+ if (args.Length () != 1 || !args[0 ]->IsUint32 ()) {
549
+ return ThrowException (Exception::TypeError (String::New (" Bad parameter" )));
554
550
}
555
551
556
- // can't use templates, SSL_CTX_set_options and SSL_CTX_clear_options are macros
557
- X (SecureContext::SetOptions, SSL_CTX_set_options)
558
- X (SecureContext::ClearOptions, SSL_CTX_clear_options)
552
+ unsigned int opts = args[ 0 ]-> Uint32Value ();
553
+
554
+ SSL_CTX_set_options (sc-> ctx_ , opts);
559
555
560
- #undef X
556
+ return True ();
557
+ }
561
558
562
559
Handle <Value> SecureContext::SetSessionIdContext (const Arguments& args) {
563
560
HandleScope scope;
0 commit comments