Skip to content
This repository has been archived by the owner on Apr 27, 2020. It is now read-only.

Fixes #46 #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Telegram_Backup
Copyright 2016 Fabian Schlenz
Copyright 2017 Fabian Schlenz
Licensed under GPLv3

## Description
Expand Down Expand Up @@ -59,8 +59,6 @@ amazon.
The library I'm using to access Telegram has some small bugs. One of those
is the display of meaningless (because they are being acted accordingly upon)
error messages. Those include:
* `Exception in thread "pool-x-thread-y" java.lang.Error:
java.nio.channels.ClosedChannelException`
* Something containing `AUTH_ERROR`
You can just ignore these messages.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private static boolean downloadFileFromDc(TelegramClient client, String target,
boolean try_again;
do {
try_again = false;
int block_size = size;
int block_size = 1024;
logger.trace("offset: {} block_size: {} size: {}", offset, block_size, size);
TLRequestUploadGetFile req = new TLRequestUploadGetFile(loc, offset, block_size);
try {
Expand All @@ -350,7 +350,6 @@ private static boolean downloadFileFromDc(TelegramClient client, String target,

fos.write(response.getBytes().getData());
fos.flush();
try { TimeUnit.MILLISECONDS.sleep(Config.DELAY_AFTER_GET_FILE); } catch(InterruptedException e) {}
} while(offset < size && (response.getBytes().getData().length>0 || try_again));
fos.close();
if (offset < size) {
Expand All @@ -377,6 +376,7 @@ private static boolean downloadFileFromDc(TelegramClient client, String target,
throw last_exception;
}
last_download_succeeded = true;
try { TimeUnit.MILLISECONDS.sleep(Config.DELAY_AFTER_GET_FILE); } catch(InterruptedException e) {}
return true;
} catch (java.io.IOException ex) {
if (fos!=null) fos.close();
Expand Down