Bug 134597 - implement partial torrent seed
Summary: implement partial torrent seed
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-24 18:55 UTC by Nick Shaforostoff
Modified: 2006-10-01 10:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
capability of utorrent (128.37 KB, image/x-png)
2006-09-25 18:32 UTC, Nick Shaforostoff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Shaforostoff 2006-09-24 18:55:37 UTC
Version:            (using KDE KDE 3.5.4)

i have small HD and wish to help seeding big torrent.

how i do it with utorrent:
-copy a few (not all) files from DVD to some dir
-open torrent
-deselect all files
-click ok
that's all. it rechecks torrent, finds files i put in the dir and starts seeding (w/o first and lasts chunks)

when i tryied to do this with ktorrent it moved torrent into seeding tab but with 0% done so no seeding was possible

and if i check these files to be downloaded it tries to redownload first and last chunks of each file

so please implement utorrent behaviour
Comment 1 Nick Shaforostoff 2006-09-24 18:59:10 UTC
in other words:
recheck all present files regardless of what files have been selected for download
Comment 2 Nick Shaforostoff 2006-09-24 19:14:21 UTC
http://websvn.kde.org/trunk/extragear/network/ktorrent/libktorrent/datachecker/multidatachecker.cpp?rev=553667&view=markup

we need to delete these lines:
if (!loadChunk(cur_chunk,cs,tor))
{
downloaded.set(cur_chunk,false);
failed.set(cur_chunk,true);
continue;
}

right?
Comment 3 Joris Guisson 2006-09-24 20:29:52 UTC
First :

Why do you deselect all files ? Select the ones you want to seed.

Second : 

> and if i check these files to be downloaded it tries to redownload first and > last chunks of each file 

This is normal, because a torrent is divided into chunks and for each chunk there is a SHA1 hash, chunk borders will not match file borders so if the neighboring files of a file are missing KT cannot determine the validity of the data of the first and last chunk of the file.

Third :

Why don't you seed directly from the DVD ? As long as the files do not need to be opened for writing, it should be no problem to do this.
Comment 4 Nick Shaforostoff 2006-09-24 20:55:37 UTC
thanks, i know _why_ it downloads trimmed chunks.

i try to spare dvd drive cause if i seed directly from it, it will work all the time producing the noise (yes, there are no tools like nero drive speed)
and:
-full scan of dvd
-reading of chunks

so every bit of dvd would be read at least twice

why do you think utorrent has its behaviour?


and imagine the following situation:
i have downloaded selected files from .torrent then after a while i decide to download other files from it - i open the .torrent and point ktorrent to previous dirdl .


it should scan all files (including old ones) and upload them too while i'm downloading new files.



and, ideally, when in seed mode, ktorrent should recheck chunks on-the-fly - ie report to the tracker 100% and, when specifical chunk is requested, first buffer and check it and upload it only if the hash is ok.

this way you will prevent wrong uploads if the harddrive is old and there may emerge bad sectors in it
Comment 5 Nick Shaforostoff 2006-09-24 21:05:17 UTC
and besides, i cant seed from dvd as it doesnt contain all the files (the torrent is >5GB) and i changed the names of the files

of course, i can play with symlinks but also i can play with azureus too :))

right now, the behaviour of ktorrent in case when no files are selected is useless so why not implement it? as far as understand it would not be so hard esp. for you
Comment 6 Joris Guisson 2006-09-24 21:16:48 UTC
Why do you deselect all files ? 
Comment 7 Nick Shaforostoff 2006-09-24 21:26:25 UTC
because if i select them it redownloads outermost chunks while i dont need them.

why software does what it didnt asked to?

if i deselect files in utorrent it still uploads them while not downloading data i dont need
Comment 8 Nick Shaforostoff 2006-09-25 00:29:22 UTC
another way to fix the issue is through "File->Open torrent for seeding" which works even when not all files available
Comment 9 Martijn van Vliet 2006-09-25 15:18:38 UTC
[quote]And imagine the following situation: 
 i have downloaded selected files from .torrent then after a while i decide to download other files from it - i open the .torrent and point ktorrent to previous dirdl . 
 
 it should scan all files (including old ones) and upload them too while i'm downloading new files.[/quote]

Aren't we doing that already? Or do you mean that "have is have" and that you should not be able to "wipe" chunks by deselecting them no matter what, because stupid leechers can use it too? 
Interesting thought. Although i think you have to have a dirty mind to only think about doing this, i think you might have a point here. (and keeping as much complete data in swarm as possible is not so bad either)     

[quote]
because if i select them it redownloads outermost chunks while i dont need them. 
 
 why software does what it didnt asked to?
[/quote]

Isn't that just part of design how hashes work? Chunks don't always fit the file.
I don't think they can do anything about that other than obfuscating the information in GUI. But hit me if i am wrong here...
Comment 10 Nick Shaforostoff 2006-09-25 16:56:05 UTC
>Isn't that just part of design how hashes work? Chunks don't always fit the file. 

OMG i know how hashes work. all i want is to disable outermost chunks download.
cause i do _not download_ partial file, but i'm trying to help _seeding it_.


i commented parts of downloadStatusChanged slots code, so it now doesnt delete files but it somehow breaks the tracker (get 404) :(
Comment 11 Joris Guisson 2006-09-25 18:05:25 UTC
Nick, if KT cannot find the neighboring files, it cannot determine if the first and last chunk of that file are valid. We can't just start uploading data when we are not sure it is valid. And seeing that you selected the file for downloading, it will download the first and last parts of the file.
Comment 12 Nick Shaforostoff 2006-09-25 18:32:53 UTC
Created attachment 17913 [details]
capability of utorrent
Comment 13 Nick Shaforostoff 2006-09-25 18:33:29 UTC
haha and i dont want to _seed_ partial (outermost) chunks

look how utorrent performs
Comment 14 Martijn van Vliet 2006-09-25 23:13:55 UTC
If you don't feel bad about it, i am going to continue asking another question again, so we have a better picture.

if i understand you correctly, you want the following:
"
>in other words: 
>recheck all present files regardless of what files have been selected for download
"
And use these files as "inside file borders mode" but only when these files are deselected/skipped for download. Right? 
And this extra mode is, in your view, usefull for the sake of not having to download something when you go help seeding. (or am i missing something again here?)
Comment 15 Nick Shaforostoff 2006-09-25 23:31:23 UTC
> If you don't feel bad about it
no, i dont mind, its even fun and develops my english skills :)

> but only when these files are deselected/skipped for download. Right? 
of course. and when they are selected - it is normal behaviour to upload chunks we already have (too).

> usefull for the sake of not having to download something when you go help seeding.
yes :)
Comment 16 Joris Guisson 2006-09-26 19:33:25 UTC
I'm currently adding a deselection way, were you can keep existing data.
Comment 17 Nick Shaforostoff 2006-09-29 15:25:30 UTC
thanks. looking forward to see code diffs :)
Comment 18 Joris Guisson 2006-10-01 10:59:04 UTC
SVN commit 590891 by guisson:

Changes :
- Fixed bug in advanced choke algorithm
- Deselecting files without deleting data is now possible
- Deselecting files without deleting data is now the default action when you uncheck a file in the infowdiget
- Deselecting existing files at torrent load time, will not delete the file

BUG: 134803
BUG: 134597



 M  +26 -12    libktorrent/interfaces/filetreediritem.cpp  
 M  +4 -3      libktorrent/interfaces/filetreediritem.h  
 M  +78 -43    libktorrent/interfaces/filetreeitem.cpp  
 M  +8 -3      libktorrent/interfaces/filetreeitem.h  
 M  +12 -1     libktorrent/torrent/chunk.h  
 M  +66 -17    libktorrent/torrent/chunkmanager.cpp  
 M  +18 -1     libktorrent/torrent/chunkmanager.h  
 M  +2 -1      libktorrent/torrent/chunkselector.cpp  
 M  +6 -5      libktorrent/torrent/downloader.cpp  
 M  +2 -3      libktorrent/torrent/peer.cpp  
 M  +1 -1      libktorrent/torrent/peer.h  
 M  +1 -1      libktorrent/torrent/peeruploader.cpp  
 M  +3 -3      libktorrent/torrent/torrentcontrol.cpp  
 M  +10 -1     libktorrent/util/constants.h  
 M  +68 -19    plugins/infowidget/infowidget.cpp  
 M  +4 -2      plugins/infowidget/infowidget.h  
 M  +12 -5     plugins/infowidget/iwfiletreediritem.cpp  
 M  +1 -1      plugins/infowidget/iwfiletreediritem.h  
 M  +16 -10    plugins/infowidget/iwfiletreeitem.cpp  
 M  +1 -1      plugins/infowidget/iwfiletreeitem.h