mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-03 15:14:53 -04:00
Implemented recursive resource segmentation for large transfers
This commit is contained in:
parent
73a3516db8
commit
e4dfd052e6
2 changed files with 26 additions and 19 deletions
|
@ -251,8 +251,10 @@ def client(destination_hexhash, configpath):
|
|||
|
||||
# Requests the specified file from the server
|
||||
def download(filename):
|
||||
global server_link, menu_mode, current_filename
|
||||
global server_link, menu_mode, current_filename, transfer_size, download_started
|
||||
current_filename = filename
|
||||
download_started = 0
|
||||
transfer_size = 0
|
||||
|
||||
# We just create a packet containing the
|
||||
# requested filename, and send it down the
|
||||
|
@ -454,14 +456,16 @@ def link_closed(link):
|
|||
# so the user can be shown a progress of
|
||||
# the download.
|
||||
def download_began(resource):
|
||||
global menu_mode, current_download, download_started, transfer_size, file_size
|
||||
current_download = resource
|
||||
|
||||
download_started = time.time()
|
||||
transfer_size = resource.size
|
||||
file_size = resource.uncompressed_size
|
||||
|
||||
menu_mode = "downloading"
|
||||
global menu_mode, current_download, download_started, transfer_size, file_size
|
||||
current_download = resource
|
||||
|
||||
if download_started == 0:
|
||||
download_started = time.time()
|
||||
|
||||
transfer_size += resource.size
|
||||
file_size = resource.total_size
|
||||
|
||||
menu_mode = "downloading"
|
||||
|
||||
# When the download concludes, successfully
|
||||
# or not, we'll update our menu state and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue