parent
2de0611b43
commit
9c7f89bf56
20
lib/tls.js
20
lib/tls.js
@ -216,9 +216,23 @@ CryptoStream.prototype._done = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
CryptoStream.prototype.fd = -1;
|
// readyState is deprecated. Don't use it.
|
||||||
CryptoStream.prototype.__defineGetter__('readyState',
|
Object.defineProperty(CryptoStream.prototype, 'readyState', {
|
||||||
net.Socket.prototype.__lookupGetter__('readyState'));
|
get: function() {
|
||||||
|
if (this._connecting) {
|
||||||
|
return 'opening';
|
||||||
|
} else if (this.readable && this.writable) {
|
||||||
|
return 'open';
|
||||||
|
} else if (this.readable && !this.writable) {
|
||||||
|
return 'readOnly';
|
||||||
|
} else if (!this.readable && this.writable) {
|
||||||
|
return 'writeOnly';
|
||||||
|
} else {
|
||||||
|
return 'closed';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// Move decrypted, clear data out into the application.
|
// Move decrypted, clear data out into the application.
|
||||||
// From the user's perspective this occurs as a 'data' event
|
// From the user's perspective this occurs as a 'data' event
|
||||||
|
@ -54,6 +54,11 @@ server.listen(common.PORT, function() {
|
|||||||
|
|
||||||
|
|
||||||
client.on('close', function() {
|
client.on('close', function() {
|
||||||
|
// readyState is deprecated but we want to make
|
||||||
|
// sure this isn't triggering an assert in lib/net.js
|
||||||
|
// See issue #1069.
|
||||||
|
assert.equal('closed', client.readyState);
|
||||||
|
|
||||||
assert.equal(buffer, message);
|
assert.equal(buffer, message);
|
||||||
console.log(message);
|
console.log(message);
|
||||||
server.close();
|
server.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user