style
This commit is contained in:
parent
be756d1711
commit
57b57522bb
5
index.js
5
index.js
@ -127,7 +127,9 @@ module.exports = function (metadata) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ut_metadata.prototype._onRequest = function (piece) {
|
ut_metadata.prototype._onRequest = function (piece) {
|
||||||
if (this._metadataComplete) {
|
if (!this._metadataComplete) {
|
||||||
|
return
|
||||||
|
}
|
||||||
var start = piece * PIECE_LENGTH
|
var start = piece * PIECE_LENGTH
|
||||||
var end = start + PIECE_LENGTH
|
var end = start + PIECE_LENGTH
|
||||||
if (end > this._metadataSize) {
|
if (end > this._metadataSize) {
|
||||||
@ -136,7 +138,6 @@ module.exports = function (metadata) {
|
|||||||
var buf = this.metadata.slice(start, end)
|
var buf = this.metadata.slice(start, end)
|
||||||
this._data(piece, buf, this._metadataSize)
|
this._data(piece, buf, this._metadataSize)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ut_metadata.prototype._onData = function (piece, buf, totalSize) {
|
ut_metadata.prototype._onData = function (piece, buf, totalSize) {
|
||||||
if (buf.length > PIECE_LENGTH) {
|
if (buf.length > PIECE_LENGTH) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user