Antifrag

Archived discussion about features (predating the use of Bugzilla as a bug and feature tracker)

Moderator: Moderators

Locked
Garet Jax
Posts: 34
Joined: 2003-05-26 15:06
Location: Poland
Contact:

Antifrag

Post by Garet Jax » 2003-05-29 14:27

That's nice feature :), but...

I feel a little bit uncomfortable with it, knowing that "If DC++ crashes, you'll lose the whole downloaded part + any resumed part as well, as
there's no way to know how much valid data there is in the file.
"

Wouldn't it be possible to make something like "advanced smart-antifrag" or whatever, which would know where I finished downloading?

??
"Blessed is he who expects nothing,
for he shall never be disappointed."

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-05-29 15:30

it'd be possible to add a downloadedBytes attribute to the queue item, and save the queue every couple of minutes, yes..
perhaps someone is willing to build that.. don't know really.. you could always use a good filesystem with better anti-fragmentation features (I think ntfs spreads its files pretty neatly, in constrast to FAT) and disable the option altogether
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

Garet Jax
Posts: 34
Joined: 2003-05-26 15:06
Location: Poland
Contact:

Post by Garet Jax » 2003-05-29 15:57

Maybe someday I'll switch to NTFS...

It could update itself every time buffer is flushed to disk - so no reading of the filesize would be necessary (because WriteBufferSize is constant, isn't it?).
That will be nice if s o m e o n e adds it. :]

Thank You in advance.
"Blessed is he who expects nothing,
for he shall never be disappointed."

distiller
Posts: 66
Joined: 2003-01-05 18:05
Location: Sweden
Contact:

Post by distiller » 2003-07-29 21:02

Should be easy enough to add, I want that feature as well, so I'll code it this weekend.

distiller
Posts: 66
Joined: 2003-01-05 18:05
Location: Sweden
Contact:

Post by distiller » 2003-08-02 12:45

So I got the downloadedbytes added to the queue, it saves every minute and does not truncates the files. Works like a charm so far. Will run some extensive tests on it to make sure it's quality code and then make a patch for arne.

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-08-02 17:33

since you've got it in the queue now, are you gonna add it to show it in the queue manager?

distiller
Posts: 66
Joined: 2003-01-05 18:05
Location: Sweden
Contact:

Post by distiller » 2003-08-02 22:38

Not in this patch, maybee a later one. Don't even know if this one will make it to DC++ source... But it's an easy thing to add now if anyone's up for it. =) The patch will be up at http://www.lowertech.net/dcpppatch later today.

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-09-20 18:40

Hey distiller,

I was looking at doing a patch to show downloded size in the queue manager, however I am alittle confused about your code. I presumed I could call

+ int64_t getDownloadedBytes() { return downloadedBytes; };

on any Queueitem to get its downloaded size, however this returns a really weird value (I'm guessing cos the variable was never initialized) so I set it to 0 in the two constructers now

QueueItem(const string& aTarget, int64_t aSize, Priority aPriority, bool aResume) : downloadedBytes(0), ....

but now all it returns is 0. I traced it and it does set the downloaded Bytes correctly from the queue.xml. Are these queueitems not the same objects as the ones you set in the first place, or am I missing something here?.

Anyone got some ideas as I'm sure most people feel this would be a nice addition to dc++ (anyone else made the patch already?)

distiller
Posts: 66
Joined: 2003-01-05 18:05
Location: Sweden
Contact:

Post by distiller » 2003-10-22 23:08

Oh, that sounds weird... Will look into it, the patch isn't very good so far either, it behaves incorrectly sometimes. I'll clean it up for you and make sure that function works as well. Then you could add the % completed for me in the queue. =)

By the way, I think you're trying to get the value in some window-manager, the queue-displayer or what it's called? (I'm at work, no source here) I had that problem when trying to make a different patch... The returned value was always 0 even though the correct valyue was stored in the variable. Anyone know something about that?

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-10-24 03:03

it may have been my hand patching skills (I couldn't autopatch it for some reason) but I did check it at least 10 times, I ended up removing the patch my from mod, as it screwed up antifrag downloads totally (as it couldn't save how far thru the file it was)

distiller
Posts: 66
Joined: 2003-01-05 18:05
Location: Sweden
Contact:

Post by distiller » 2003-10-29 18:34

The patch originally worked fine regarding the saving of progress to queue.xml and loading that at start and resuming at the correct position. It only failed when that initial connection dropped and a new user/(doanload object) was created. My bad. But it should've worked so far at least with your project.

distiller
Posts: 66
Joined: 2003-01-05 18:05
Location: Sweden
Contact:

Post by distiller » 2003-11-02 12:02

I've fixed the patch now, it resumes correctly at all times, haven't found any bugs sofar. The page mentioned above works, it patched against 0.301. There's a debug executable to download, so try it out. Don't forget to enable antifrag in advanced settings.

Any files you may have in queue will restart from 0!

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-11-02 20:38

yeah that does seem to be better, however I still can't do what I thought I could with it.

does my idea

QueueFrame::StringListInfo::StringListInfo(QueueItem* qi) {
columns[COLUMN_DONE] = Util::formatBytes(qi->getDownloadedBytes());
.....

not make sense?, it still gives me a nice 0 B

distiller
Posts: 66
Joined: 2003-01-05 18:05
Location: Sweden
Contact:

Post by distiller » 2003-11-03 00:51

That's what I meant by my cryptic blabbering earlier, in the queueframe the result is always 0 for any such functions.

It's really weird, never figured that problem out. It's not specific to the patch though, the problem is something else.

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-11-03 00:51

columns[COLUMN_DONE] = Util::formatBytes(QueueManager::getInstance()->getDownloadedBytes(qi->getTarget())); works nicely thou

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-11-03 00:52

would that be better as a percentage or in size thou =(

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-11-03 05:00

http://twink.orcon.net.nz/downloaded.png for what progress I've made on this (yes I removed the filenames from the image) seems to show great potential.

(Edit: url fix - GargoyleMT)

MIAMI SOUTH
Posts: 6
Joined: 2003-10-09 02:42
Location: Miami Florida USA

Re: Antifrag

Post by MIAMI SOUTH » 2003-11-03 05:52

Garet Jax wrote:That's nice feature :), but...

I feel a little bit uncomfortable with it, knowing that "If DC++ crashes, you'll lose the whole downloaded part + any resumed part as well, as
there's no way to know how much valid data there is in the file.
"

Wouldn't it be possible to make something like "advanced smart-antifrag" or whatever, which would know where I finished downloading?

??
If you really want to use the feature, copy and paste the data already downloaded to another location. Re-save at regular intervals to keep it current.

distiller
Posts: 66
Joined: 2003-01-05 18:05
Location: Sweden
Contact:

Post by distiller » 2003-11-03 12:19

MIAMI SOUTH wrote:If you really want to use the feature, copy and paste the data already downloaded to another location. Re-save at regular intervals to keep it current.
Copy and paste? Like text? Lol...

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-11-04 01:35

anyway my patch is at http://twink.orcon.net.nz/patches/queue_downloaded.diff you need distillers patch first thou =D.

Locked