void Connection::EncIn(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (args.Length() < 3) {
return ThrowTypeError("Takes 3 parameters");
void Connection::ClearOut(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (args.Length() < 3) {
return ThrowTypeError("Takes 3 parameters");
void Connection::ClearPending(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
int bytes_pending = BIO_pending(conn->bio_read_);
args.GetReturnValue().Set(bytes_pending);
}
void Connection::EncPending(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
int bytes_pending = BIO_pending(conn->bio_write_);
args.GetReturnValue().Set(bytes_pending);
}
void Connection::EncOut(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (args.Length() < 3) {
return ThrowTypeError("Takes 3 parameters");
void Connection::ClearIn(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (args.Length() < 3) {
return ThrowTypeError("Takes 3 parameters");
void Connection::GetPeerCertificate(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (conn->ssl_ == NULL) return;
Local<Object> info = Object::New();
void Connection::GetSession(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (conn->ssl_ == NULL) return;
void Connection::SetSession(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (args.Length() < 1 ||
(!args[0]->IsString() && !Buffer::HasInstance(args[0]))) {
void Connection::LoadSession(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (args.Length() >= 1 && Buffer::HasInstance(args[0])) {
ssize_t slen = Buffer::Length(args[0].As<Object>());
void Connection::IsSessionReused(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
bool yes = conn->ssl_ && SSL_session_reused(conn->ssl_);
args.GetReturnValue().Set(yes);
}
void Connection::Start(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
int rv = 0;
if (!SSL_is_init_finished(conn->ssl_)) {
void Connection::Shutdown(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (conn->ssl_ == NULL) {
return args.GetReturnValue().Set(false);
void Connection::ReceivedShutdown(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
bool yes =
conn->ssl_ && SSL_get_shutdown(conn->ssl_) == SSL_RECEIVED_SHUTDOWN;
args.GetReturnValue().Set(yes);
void Connection::IsInitFinished(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
bool yes = conn->ssl_ && SSL_is_init_finished(conn->ssl_);
args.GetReturnValue().Set(yes);
}
void Connection::VerifyError(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (conn->ssl_ == NULL) {
return args.GetReturnValue().SetNull();
void Connection::GetCurrentCipher(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (conn->ssl_ == NULL) return;
OPENSSL_CONST SSL_CIPHER *c = SSL_get_current_cipher(conn->ssl_);
void Connection::Close(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (conn->ssl_ != NULL) {
SSL_free(conn->ssl_);
void Connection::GetNegotiatedProto(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (conn->is_server_) {
const unsigned char* npn_proto;
void Connection::SetNPNProtocols(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (args.Length() < 1 || !Buffer::HasInstance(args[0])) {
return ThrowError("Must give a Buffer as first argument");
void Connection::GetServername(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (conn->is_server_ && !conn->servername_.IsEmpty()) {
args.GetReturnValue().Set(conn->servername_);
void Connection::SetSNICallback(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- Connection* conn = Connection::Unwrap(args);
+ Connection* conn = Connection::Unwrap(args.This());
if (args.Length() < 1 || !args[0]->IsFunction()) {
return ThrowError("Must give a Function as first argument");