Ver código fonte

remember offset when checking for partial errors

Gil Pedersen 13 anos atrás
pai
commit
207136e53b
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      lib/uristream.js

+ 1 - 1
lib/uristream.js

@@ -87,7 +87,7 @@ function setupHttp(uri, options, dst) {
       req.abort();
       if (--tries <= 0) {
         // remap error to partial error if we have received any data
-        if (start + accum !== 0)
+        if (start - offset + accum !== 0)
           err = new PartialError(err, start - offset + accum, (size !== -1) ? start - offset + size : size);
         return dst.emit('error', err);
       }