Skip to content

Commit

Permalink
TLS: Don't give up if you can't write 0 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Feb 9, 2011
1 parent a0702b5 commit dafd6d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
};

Expand Down

0 comments on commit dafd6d9

Please sign in to comment.