Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unverified pieces get stuck until all pieces finish downloading #266

Closed
adammw opened this issue Feb 15, 2015 · 3 comments
Closed

Unverified pieces get stuck until all pieces finish downloading #266

adammw opened this issue Feb 15, 2015 · 3 comments

Comments

@adammw
Copy link

@adammw adammw commented Feb 15, 2015

e.g. piece 59 in the screenshot below

screen shot 2015-02-16 at 12 28 03 am

@grunjol

This comment has been minimized.

Copy link
Contributor

@grunjol grunjol commented Feb 15, 2015

I think you are seeing that because the green represent non-BLOCK_BLANK blocks, which includes reserved blocks.

on cmd.js line 461 you can replace

bar += piece.blocks[j] ? '{green:█}' : '{red:█}'

with

bar += piece.blocks[j] ? (piece.blocks[j] === 1 ? '{blue:█}' : '{green:█}') : '{red:█}'

and you will see reserved blocks in blue.

But not all reserved blocks will be shown, because if you have reserved blocks on pieces without any written block, the condition on line 456 will skip it

if (piece.verified || piece.blocksWritten === 0) {
    continue
}

so, something like this can be used to skip the condition

if (piece.verified || !piece.blocks[0]) {
    continue
}

even if it doesn't check all the blocks, as far i can see when starting with a new piece it starts with the first block, so its a kind of better approach

@adammw

This comment has been minimized.

Copy link
Author

@adammw adammw commented Feb 18, 2015

I'm not sure exactly what "reserved" means in this context, but yeah with that change I'm seeing that the pieces that get stuck do have 'blue' segments in them, I was really unfortunate with this one as it happened on the first block so I had to wait for the entire file to be downloaded before it would go back and try again.
screen shot 2015-02-18 at 9 37 29 pm

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Feb 19, 2015

@grunjol's fix in #272 should resolve this issue! Please give webtorrent@0.27.2 a try, and please let us know if this does the trick.

@feross feross closed this Feb 19, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.