TLS: Add _pendingBytes()

pull/22966/head
Ryan Dahl 2011-01-31 17:29:11 -08:00
parent 33e8e3d799
commit 3e5b568504
1 changed files with 10 additions and 0 deletions

View File

@ -290,6 +290,11 @@ function CleartextStream(pair) {
util.inherits(CleartextStream, CryptoStream);
CleartextStream.prototype._pendingBytes = function() {
return this.pair._ssl._clearPending();
};
CleartextStream.prototype._sucker = function(b) {
debug('writng from clearIn');
return this.pair._ssl.clearIn(b, 0, b.length);
@ -309,6 +314,11 @@ function EncryptedStream(pair) {
util.inherits(EncryptedStream, CryptoStream);
EncryptedStream.prototype._pendingBytes = function() {
return this.pair._ssl._endPending();
};
EncryptedStream.prototype._sucker = function(b) {
debug('writing from encIn');
return this.pair._ssl.encIn(b, 0, b.length);