Ticket #2267 (closed enhancement: fixed)
Implement resuming file downloads (reget) in FISH VFS
Reported by: | zaytsev | Owned by: | angel_il |
---|---|---|---|
Priority: | major | Milestone: | 4.7.4 |
Component: | mc-vfs | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: | committed-master |
Description
Hi!
Currently when the connection is dropped during the download, we get an incomplete file on the recipient drive. The framework for resuming file downloads is already present in the VFS layer, all it takes is to implement its support in FISH.
Thanks!
Change History
comment:2 follow-up: ↓ 3 Changed 14 years ago by ossi
specifying ibs=1 will make dd actually read one byte at a time. you will get a terrible throughput and still 100% cpu usage.
to get some efficiency, you'd have to use bigger blocks (10k or more) and round down the offset to the next multiple of the block size. the transfer of the extra bytes shouldn't be much of a problem ...
alternatively you could try 'tail -c +$FISH_OFFSET ...' - i don't know how portable this is, so you should look up the man pages of some non-gnu systems.
comment:3 in reply to: ↑ 2 Changed 14 years ago by angel_il
Replying to ossi:
alternatively you could try 'tail -c +$FISH_OFFSET ...' - i don't know how portable this is, so you should look up the man pages of some non-gnu systems.
Unfortunately, many embedded systems with busybox do not support 'tail -c'...
if the host supports perl, I'll try to use it...
comment:4 Changed 14 years ago by angel_il
branch: 2267_fish_resume_download
changeset: e2f94f73ae29f3a8a88d4567bcd1a900f6edd7cb
comment:8 Changed 14 years ago by zaytsev
1) Please rename fish_get_ -> fish_got_
2) Perl version: what if the device doesn't have enough memory to read everything in $content? Reget is mostly useful on huge files, like few gigabytes in size and this will most likely kill even desktop PCs not even speaking about embedded junk.
Am I missing something?
comment:10 Changed 14 years ago by angel_il
changeset: 40bb3a5c9ca576145d2c200f916a45d3f5c7ba13
comment:11 Changed 14 years ago by zaytsev
1) Please rename fish_get_ -> fish_got_ (asked already)
2) Looks good. Does it make any sense to use $blksize instead of 4096? I don't know.
comment:12 Changed 14 years ago by angel_il
1) Please rename fish_get_ -> fish_got_ (asked already)
No, wherefore? in this case, 'get' is not verb is a name of method...
2) Looks good. Does it make any sense to use $blksize instead of 4096? I don't know.
I do not think it's a good idea to increase the size of the script, just to make the script look nicer...
comment:13 Changed 14 years ago by zaytsev
No, wherefore? in this case, 'get' is not verb is a name of method...
OK, my bad.
I do not think it's a good idea to increase the size of the script, just to make the script look nicer...
To decrease the size of the script, you could have named the return values of stat $a, $b, $c, $d etc. (at least for those, that are unused). My question is whether reading by block size instead of hardcoded 4096 will be faster or not. If it will, I think that has to be done.
comment:14 Changed 14 years ago by andrew_b
- Votes for changeset changed from slavazanko to slavazanko andrew_b
- severity changed from on review to approved
comment:15 Changed 14 years ago by angel_il
- Status changed from assigned to testing
- Votes for changeset changed from slavazanko andrew_b to committed-master
- Resolution set to fixed
- severity changed from approved to merged
comment:17 Changed 14 years ago by andrew_b
- Keywords vfs fish removed
Implemented in 4.7.0-stable in #2367.
2 zaytsev: try