This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

TLS: Don't give up if you can't write 0 bytes

  • Loading branch information...
1 parent a0702b5 commit dafd6d913747295efdc12aa12613a30703ef0f60 @ry ry committed Feb 9, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/tls.js
View
@@ -313,6 +313,8 @@ CryptoStream.prototype._pull = function() {
return;
}
+ if (tmp.length == 0) continue;
+
var rv = this._puller(tmp);
if (this.pair._ssl && this.pair._ssl.error) {
@@ -358,7 +360,7 @@ CleartextStream.prototype._pendingBytes = function() {
CleartextStream.prototype._puller = function(b) {
- debug('writng from clearIn');
+ debug('clearIn ' + b.length + ' bytes');
return this.pair._ssl.clearIn(b, 0, b.length);
};

0 comments on commit dafd6d9

Please sign in to comment.