Browse Source

Rename some SecureStream methods

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
163485c8aa
  1. 20
      lib/net.js
  2. 36
      src/node_crypto.cc
  3. 12
      src/node_crypto.h

20
lib/net.js

@ -322,15 +322,15 @@ function setImplmentationMethods (self) {
assert(buf);
assert(self.secure);
var bytesWritten = self.secureStream.writeInject(buf, off, len);
var bytesWritten = self.secureStream.clearIn(buf, off, len);
if (!securePool) {
allocNewSecurePool();
}
var secureLen = self.secureStream.writeExtract(securePool,
0,
securePool.length);
var secureLen = self.secureStream.encOut(securePool,
0,
securePool.length);
if (secureLen == -1) {
// Check our read again for secure handshake
@ -363,15 +363,15 @@ function setImplmentationMethods (self) {
if (calledByIOWatcher) {
secureBytesRead = oldRead(securePool, 0, securePool.length);
self.secureStream.readInject(securePool, 0, secureBytesRead);
self.secureStream.encIn(securePool, 0, secureBytesRead);
}
var chunkBytes;
do {
chunkBytes =
self.secureStream.readExtract(pool,
pool.used + bytesRead,
pool.length - pool.used - bytesRead);
self.secureStream.clearOut(pool,
pool.used + bytesRead,
pool.length - pool.used - bytesRead);
bytesRead += chunkBytes;
} while ((chunkBytes > 0) && (pool.used + bytesRead < pool.length));
@ -379,7 +379,7 @@ function setImplmentationMethods (self) {
return -1;
}
if (self.secureStream.readPending()) {
if (self.secureStream.clearPending()) {
process.nextTick(function () {
if (self._readWatcher) self._readWatcher.callback();
});
@ -426,7 +426,7 @@ function setImplmentationMethods (self) {
allocNewSecurePool();
}
var secureLen = self.secureStream.writeExtract(
var secureLen = self.secureStream.encOut(
securePool, 0, securePool.length
);

36
src/node_crypto.cc

@ -238,18 +238,18 @@ void SecureStream::Initialize(Handle<Object> target) {
t->InstanceTemplate()->SetInternalFieldCount(1);
t->SetClassName(String::NewSymbol("SecureStream"));
NODE_SET_PROTOTYPE_METHOD(t, "readInject",
SecureStream::ReadInject);
NODE_SET_PROTOTYPE_METHOD(t, "readExtract",
SecureStream::ReadExtract);
NODE_SET_PROTOTYPE_METHOD(t, "writeInject",
SecureStream::WriteInject);
NODE_SET_PROTOTYPE_METHOD(t, "writeExtract",
SecureStream::WriteExtract);
NODE_SET_PROTOTYPE_METHOD(t, "readPending",
SecureStream::ReadPending);
NODE_SET_PROTOTYPE_METHOD(t, "writeCanExtract",
SecureStream::WriteCanExtract);
NODE_SET_PROTOTYPE_METHOD(t, "encIn",
SecureStream::EncIn);
NODE_SET_PROTOTYPE_METHOD(t, "clearOut",
SecureStream::ClearOut);
NODE_SET_PROTOTYPE_METHOD(t, "clearIn",
SecureStream::ClearIn);
NODE_SET_PROTOTYPE_METHOD(t, "encOut",
SecureStream::EncOut);
NODE_SET_PROTOTYPE_METHOD(t, "clearPending",
SecureStream::ClearPending);
NODE_SET_PROTOTYPE_METHOD(t, "encPending",
SecureStream::EncPending);
NODE_SET_PROTOTYPE_METHOD(t, "getPeerCertificate",
SecureStream::GetPeerCertificate);
NODE_SET_PROTOTYPE_METHOD(t, "isInitFinished",
@ -308,7 +308,7 @@ Handle<Value> SecureStream::New(const Arguments& args) {
}
Handle<Value> SecureStream::ReadInject(const Arguments& args) {
Handle<Value> SecureStream::EncIn(const Arguments& args) {
HandleScope scope;
SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
@ -350,7 +350,7 @@ Handle<Value> SecureStream::ReadInject(const Arguments& args) {
}
Handle<Value> SecureStream::ReadExtract(const Arguments& args) {
Handle<Value> SecureStream::ClearOut(const Arguments& args) {
HandleScope scope;
SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
@ -417,7 +417,7 @@ Handle<Value> SecureStream::ReadExtract(const Arguments& args) {
}
Handle<Value> SecureStream::ReadPending(const Arguments& args) {
Handle<Value> SecureStream::ClearPending(const Arguments& args) {
HandleScope scope;
SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
@ -426,7 +426,7 @@ Handle<Value> SecureStream::ReadPending(const Arguments& args) {
}
Handle<Value> SecureStream::WriteCanExtract(const Arguments& args) {
Handle<Value> SecureStream::EncPending(const Arguments& args) {
HandleScope scope;
SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
@ -435,7 +435,7 @@ Handle<Value> SecureStream::WriteCanExtract(const Arguments& args) {
}
Handle<Value> SecureStream::WriteExtract(const Arguments& args) {
Handle<Value> SecureStream::EncOut(const Arguments& args) {
HandleScope scope;
SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
@ -472,7 +472,7 @@ Handle<Value> SecureStream::WriteExtract(const Arguments& args) {
}
Handle<Value> SecureStream::WriteInject(const Arguments& args) {
Handle<Value> SecureStream::ClearIn(const Arguments& args) {
HandleScope scope;
SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());

12
src/node_crypto.h

@ -51,12 +51,12 @@ class SecureStream : ObjectWrap {
protected:
static v8::Handle<v8::Value> New(const v8::Arguments& args);
static v8::Handle<v8::Value> ReadInject(const v8::Arguments& args);
static v8::Handle<v8::Value> ReadExtract(const v8::Arguments& args);
static v8::Handle<v8::Value> ReadPending(const v8::Arguments& args);
static v8::Handle<v8::Value> WriteCanExtract(const v8::Arguments& args);
static v8::Handle<v8::Value> WriteExtract(const v8::Arguments& args);
static v8::Handle<v8::Value> WriteInject(const v8::Arguments& args);
static v8::Handle<v8::Value> EncIn(const v8::Arguments& args);
static v8::Handle<v8::Value> ClearOut(const v8::Arguments& args);
static v8::Handle<v8::Value> ClearPending(const v8::Arguments& args);
static v8::Handle<v8::Value> EncPending(const v8::Arguments& args);
static v8::Handle<v8::Value> EncOut(const v8::Arguments& args);
static v8::Handle<v8::Value> ClearIn(const v8::Arguments& args);
static v8::Handle<v8::Value> GetPeerCertificate(const v8::Arguments& args);
static v8::Handle<v8::Value> IsInitFinished(const v8::Arguments& args);
static v8::Handle<v8::Value> VerifyPeer(const v8::Arguments& args);

Loading…
Cancel
Save