Skip to content

Commit

Permalink
[fix] reading padding in substream should not happen multiple times w…
Browse files Browse the repository at this point in the history
…ith padding size of 0
  • Loading branch information
bmeck committed Dec 27, 2012
1 parent 3ecf264 commit b44c960
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/substream.js
Expand Up @@ -7,11 +7,12 @@ function subStream(origin, length, pad, end) {
var stream = new ReadableStream({allowHalfOpen: false});
var readPadding = false;
function _readPadding() {
if (readPadding) return;
if (pad === 0) {
readPadding = true;
end();
return;
}
if (readPadding) return;
var data = origin.read(pad);
if (data) {
readPadding = true;
Expand Down

0 comments on commit b44c960

Please sign in to comment.